Bug 58592 - [iOS] ListView System.IndexOutOfRangeException in UnevenListViewDataSource.GetEstimatedRowHeight
Summary: [iOS] ListView System.IndexOutOfRangeException in UnevenListViewDataSource.Ge...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.3.5
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-04 17:12 UTC by Chase Long
Modified: 2017-09-12 20:07 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Chase Long 2017-08-04 17:12:21 UTC
Related to #57978 https://bugzilla.xamarin.com/show_bug.cgi?id=57978#c2

ListViews with ItemsSource bound to List<T> sometimes throw exceptions with stack traces like the following. 

System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at (wrapper stelemref) System.Object:virt_stelemref_complex (intptr,object)
  at System.Collections.Generic.List`1[T].Add (T item) <0x1004bbaec + 0x000af> in <2f4074c3120b4d80802e10af84b67d41#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Element.Xamarin.Forms.IElement.AddResourcesChangedListener (System.Action`2[T1,T2] onchanged) <0x1018c5b6c + 0x0005b> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Element.set_Parent (Xamarin.Forms.Element value) <0x1018c5bec + 0x00137> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.ListView.SetupContent (Xamarin.Forms.Cell content, System.Int32 index) <0x10189d414 + 0x000b3> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.ItemsView`1[TVisual].Xamarin.Forms.IItemsView<TVisual>.SetupContent (TVisual content, System.Int32 index) <0x1018a02c0 + 0x0001b> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].UpdateContent (TItem content, System.Int32 index, System.Object item) <0x1018e98ec + 0x0009f> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].CreateContent (System.Int32 index, System.Object item, System.Boolean insert) <0x1018e92e4 + 0x000b3> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].GetOrCreateContent (System.Int32 index, System.Object item) <0x1018e978c + 0x00093> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2+<GetEnumerator>d__79[TView,TItem].MoveNext () <0x1018005d0 + 0x00167> in <937957814f5d45be82b66795cb584841#bb3ab163bc4bbe603c89837cb011228b>:0 
  at System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Boolean& found) <0x1009f640c + 0x0012b> in <efafd07f54d8415e9134a80c889fcffb#bb3ab163bc4bbe603c89837cb011228b>:0 
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) <0x1009f62bc + 0x00037> in <efafd07f54d8415e9134a80c889fcffb#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.GetEstimatedRowHeight (UIKit.UITableView table) <0x1019a97a0 + 0x0007f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer.UpdateEstimatedRowHeight () <0x101992220 + 0x000c3> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) <0x10199123c + 0x0059b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) <0x101982f4c + 0x0025f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x101982ccc + 0x00043> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x10197e5f8 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) <0x101982170 + 0x0002b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () <0x101981fb8 + 0x000a7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) <0x101982f4c + 0x001c7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x101982ccc + 0x00043> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x10197e5f8 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) <0x101982170 + 0x0002b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () <0x101981fb8 + 0x000a7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) <0x101982f4c + 0x001c7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x101982ccc + 0x00043> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x10197e5f8 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) <0x101982170 + 0x0002b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () <0x101981fb8 + 0x000a7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) <0x101982f4c + 0x001c7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x101982ccc + 0x00043> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x10197e5f8 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) <0x101982170 + 0x0002b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () <0x101981fb8 + 0x000a7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) <0x101982f4c + 0x001c7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x101982ccc + 0x00043> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x10197e5f8 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) <0x101982170 + 0x0002b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () <0x101981fb8 + 0x000a7> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () <0x101996f04 + 0x001a3> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at (wrapper managed-to-native) ObjCRuntime.Messaging:objc_msgSendSuper (intptr,intptr)
  at UIKit.UIViewController.get_View () <0x1008b3b18 + 0x00033> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Company.Client.Mobile.iOS.Renderers.MyCustomPageRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.VisualElementChangedEventArgs e) <0x100191b8c + 0x0007b> in <f7417f1e580543c38b59f621339b25ed#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x101996c88 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x10197e5f8 + 0x0006f> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage (Xamarin.Forms.Page page) <0x1019950f0 + 0x00037> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPushAsync>d__44.MoveNext () <0x1019ada64 + 0x00033> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x10049e81c + 0x000d4> in <2f4074c3120b4d80802e10af84b67d41#bb3ab163bc4bbe603c89837cb011228b>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x10049e744 + 0x000c7> in <2f4074c3120b4d80802e10af84b67d41#bb3ab163bc4bbe603c89837cb011228b>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x1004f8d30 + 0x0003b> in <2f4074c3120b4d80802e10af84b67d41#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<<ViewDidLoad>b__39_0>d.MoveNext () <0x1019589b0 + 0x0012b> in <443ea0b8d4894b2e92db56e31708fec3#bb3ab163bc4bbe603c89837cb011228b>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) <0x10049e40c + 0x00050> in <2f4074c3120b4d80802e10af84b67d41#bb3ab163bc4bbe603c89837cb011228b>:0 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () <0x1008ed91c + 0x0001b> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () <0x1008d87bc + 0x00023> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#bb3ab163bc4bbe603c89837cb011228b>:0 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) <0x1008f2524 + 0x0009b> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#bb3ab163bc4bbe603c89837cb011228b>:0 
  at Company.Client.Mobile.iOS.Application.Main (System.String[] args) <0x1001904d8 + 0x0001b> in <f7417f1e580543c38b59f621339b25ed#bb3ab163bc4bbe603c89837cb011228b>:0 

Xamarin.Forms 2.3.5-pre6
Observed on iOS 10.3.2
I cannot reliably reproduce the exceptions, but they have happened to some of our users multiple times since we upgraded to Xamarin.Forms 2.3.5-pre6.
Comment 1 Paul DiPietro [MSFT] 2017-08-08 00:33:58 UTC
I'm setting this to need info for the moment, but just for lack of a reproduction. If you or someone else can produce one, please do, since we want to catch any possible regressions.
Comment 2 Paul DiPietro [MSFT] 2017-09-12 20:07:53 UTC
Just to follow our usual upkeep, I'm going to mark this as not reproducible since we haven't had any comments or a reproduction provided in a little over a month. If this becomes a recurring issue again as of the latest prerelease and a reproduction method is found, please do reopen this with a project we can use to investigate further.