Bug 57978 - Null Reference in ListViewRenderer+UnevenListViewDataSource.<CacheDefinedRowHeights>
Summary: Null Reference in ListViewRenderer+UnevenListViewDataSource.<CacheDefinedRowH...
Status: ASSIGNED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-07-06 14:18 UTC by jmelliadis
Modified: 2017-11-10 15:50 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
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 for Bug 57978 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
ASSIGNED

Description jmelliadis 2017-07-06 14:18:27 UTC
We are using Xamarin Forms 2.3.5.255-pre5 in our application and Insights is reporting a NullReferenceException in the Xamarin Forms ListViewRenderer. This has only happened on versions of our app since we updated to v2.3.5 from v2.3.3.

System.NullReferenceExceptionObject reference not set to an instance of an object
null
System.NullReferenceExceptionObject reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.<CacheDefinedRowHeights>b__6_0 () <0x100aa3990 + 0x00038> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Threading.Tasks.Task.InnerInvoke () <0x1002d78b0 + 0x0005f> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Threading.Tasks.Task.Execute () <0x1002d70b0 + 0x00043> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0
Comment 1 Jimmy [MSFT] 2017-07-07 17:01:54 UTC
Are you also seeing this issue locally instead of just on Insights? If so, when the does crash occur, after navigating to another page? If possible, can you share a repro project to help us investigate this further? 

When providing the requested information, please set the report's status back to NEW otherwise we may close this issue after 30 days of no response. Thanks!
Comment 2 jmelliadis 2017-07-11 23:32:18 UTC
I have yet to be able to reproduce the issue locally. A similar issue has started showing in Insights as well. I have copied that below. I will attempt to get a repro project to help with investigation.

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) <0x1002a2910 + 0x0007b> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Element.Xamarin.Forms.IElement.AddResourcesChangedListener (System.Action`2[T1,T2] onchanged) <0x100455aa0 + 0x00077> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Element.set_Parent (Xamarin.Forms.Element value) <0x100455b70 + 0x001bf> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.ListView.SetupContent (Xamarin.Forms.Cell content, System.Int32 index) <0x10041d1c0 + 0x0009b> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.ItemsView`1[TVisual].Xamarin.Forms.IItemsView<TVisual>.SetupContent (TVisual content, System.Int32 index) <0x100421070 + 0x0002f> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].UpdateContent (TItem content, System.Int32 index, System.Object item) <0x100485cc0 + 0x000b7> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].CreateContent (System.Int32 index, System.Object item, System.Boolean insert) <0x100485690 + 0x000bf> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].GetOrCreateContent (System.Int32 index, System.Object item) <0x100485b70 + 0x000b7> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2+<GetEnumerator>d__79[TView,TItem].MoveNext () <0x10048b430 + 0x00167> in <6857c3e3d8934a01aedef43d5fab1604#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Boolean& found) <0x10054dd70 + 0x0014b> in <efafd07f54d8415e9134a80c889fcffb#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) <0x10054dc00 + 0x00037> in <efafd07f54d8415e9134a80c889fcffb#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.GetEstimatedRowHeight (UIKit.UITableView table) <0x100a13270 + 0x000df> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer.UpdateEstimatedRowHeight () <0x1009ee050 + 0x000c7> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) <0x1009ecb10 + 0x008cb> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at iSurvey.iOS.CustomListViewRenderer_iOS.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) <0x10005fa10 + 0x00023> in <d35487508fb449cbb0b486aee5627421#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) <0x1009d83f0 + 0x003f7> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x1009d8100 + 0x0003f> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x1009d1d30 + 0x0008b> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) <0x1009d7020 + 0x00023> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () <0x1009d6de0 + 0x000b3> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () <0x1009f5710 + 0x002b7> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at (wrapper managed-to-native) ObjCRuntime.Messaging:objc_msgSendSuper (intptr,intptr)
  at UIKit.UIViewController.get_View () <0x100a81540 + 0x00073> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () <0x1009f53b0 + 0x00023> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) <0x1009f53f0 + 0x000c7> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) <0x1009d1d30 + 0x0008b> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage (Xamarin.Forms.Page page) <0x1009f2640 + 0x0003f> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPushAsync>d__44.MoveNext () <0x100a18f70 + 0x0003f> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x10027ae20 + 0x00028> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x10027db80 + 0x000d3> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x10027dae0 + 0x0007f> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x10027da80 + 0x00047> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x10033fbe0 + 0x0001b> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<<ViewDidLoad>b__39_0>d.MoveNext () <0x100a19eb0 + 0x0012b> in <6516852fe46f4179bc5c05639ebf074c#618a55be97dd8aea3a48dedfba5a9551>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x10027ae20 + 0x00028> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) <0x10027d540 + 0x00053> in <2f4074c3120b4d80802e10af84b67d41#618a55be97dd8aea3a48dedfba5a9551>:0 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () <0x100ae5140 + 0x00027> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#618a55be97dd8aea3a48dedfba5a9551>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () <0x100ac8840 + 0x00023> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#618a55be97dd8aea3a48dedfba5a9551>:0 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) <0x100aeb1a0 + 0x0002b> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#618a55be97dd8aea3a48dedfba5a9551>:0 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) <0x100aeb0e0 + 0x000ab> in <58a9bd8a3cbb4d0092bc0a767ff66c0f#618a55be97dd8aea3a48dedfba5a9551>:0 
  at iSurvey.iOS.Application.Main (System.String[] args) <0x100046de0 + 0x00023> in <d35487508fb449cbb0b486aee5627421#618a55be97dd8aea3a48dedfba5a9551>:0
Comment 3 alan.spires 2017-07-25 15:01:15 UTC
+1 I'm getting a bunch of these in my insights as well.

  at Xamarin.Forms.ListProxy+ProxyEnumerator.MoveNext () <0x100d07668 + 0x00084> in <937957814f5d45be82b66795cb584841#e866e6b4821b5fcb99ecf32caabdb259>:0 
  at Xamarin.Forms.Internals.TemplatedItemsList`2+<GetEnumerator>d__79[TView,TItem].MoveNext () <0x100c65200 + 0x001d3> in <937957814f5d45be82b66795cb584841#e866e6b4821b5fcb99ecf32caabdb259>:0 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.<CacheDefinedRowHeights>b__6_0 () <0x100e0ec0c + 0x00097> in <443ea0b8d4894b2e92db56e31708fec3#e866e6b4821b5fcb99ecf32caabdb259>:0 
  at System.Threading.Tasks.Task.InnerInvoke () <0x1003d7854 + 0x0004f> in <2f4074c3120b4d80802e10af84b67d41#e866e6b4821b5fcb99ecf32caabdb259>:0 
  at System.Threading.Tasks.Task.Execute () <0x1001ec830 + 0x00043> in <2f4074c3120b4d80802e10af84b67d41#e866e6b4821b5fcb99ecf32caabdb259>:0
Comment 4 Chase Long 2017-11-10 15:09:13 UTC
I'm seeing a lot of these on Xamarin Insights and Raygun on various revisions of iOS 9, iOS 10, and iOS 11.

System.Collections.Generic.List`1[T].Add(T item) in <a89624c267f94034b6cf9aa0c56f8864#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Element.Xamarin.Forms.IElement.AddResourcesChangedListener(System.Action`2[T1,T2] onchanged) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Element.set_Parent(Xamarin.Forms.Element value) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.ListView.SetupContent(Xamarin.Forms.Cell content, System.Int32 index) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.ItemsView`1[TVisual].Xamarin.Forms.IItemsVie.TVisual(TVisual content, System.Int32 index) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].UpdateContent(TItem content, System.Int32 index, System.Object item) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].CreateContent(System.Int32 index, System.Object item, System.Boolean insert) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Internals.TemplatedItemsList`2[TView,TItem].GetOrCreateContent(System.Int32 index, System.Object item) in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Internals.TemplatedItemsList`2.GetEnumerator() in <937957814f5d45be82b66795cb584841#479295eb66edf821a0df2d50cc452aeb>:0
System.Linq.Enumerable.TryGetFirst[TSource](System.Collections.Generic.IEnumerable`1[T] source, System.Boolean& found) in <773264786149499a986a13db6a7d46fe#479295eb66edf821a0df2d50cc452aeb>:0
System.Linq.Enumerable.First[TSource](System.Collections.Generic.IEnumerable`1[T] source) in <773264786149499a986a13db6a7d46fe#479295eb66edf821a0df2d50cc452aeb>:0
 
Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.GetEstimatedRowHeight(UIKit.UITableView table) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.ListViewRenderer.UpdateEstimatedRowHeight() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.ListViewRenderer.OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement(TElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded(Xamarin.Forms.VisualElement view) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.VisualElementPackager.Load() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
UIKit.UIViewController.get_View() in <29f41243cfd34e8ea50ebe632d8c4bc7#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.PageRenderer.SetElement(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.Platform.CreateRenderer(Xamarin.Forms.VisualElement element) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage(Xamarin.Forms.Page page) in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
Xamarin.Forms.Platform.iOS.NavigationRenderer.OnPushAsync() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task task) in <a89624c267f94034b6cf9aa0c56f8864#479295eb66edf821a0df2d50cc452aeb>:0
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task) in <a89624c267f94034b6cf9aa0c56f8864#479295eb66edf821a0df2d50cc452aeb>:0
System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult() in <a89624c267f94034b6cf9aa0c56f8864#479295eb66edf821a0df2d50cc452aeb>:0
 
Xamarin.Forms.Platform.iOS.NavigationRenderer.<ViewDidLoad() in <443ea0b8d4894b2e92db56e31708fec3#479295eb66edf821a0df2d50cc452aeb>:0
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0(System.Object state) in <a89624c267f94034b6cf9aa0c56f8864#479295eb66edf821a0df2d50cc452aeb>:0
UIKit.UIKitSynchronizationContext.Post() in <29f41243cfd34e8ea50ebe632d8c4bc7#479295eb66edf821a0df2d50cc452aeb>:0
Foundation.NSAsyncActionDispatcher.Apply() in <29f41243cfd34e8ea50ebe632d8c4bc7#479295eb66edf821a0df2d50cc452aeb>:0
UIKit.UIApplication.Main(System.String[] args, System.String principalClassName, System.String delegateClassName) in <29f41243cfd34e8ea50ebe632d8c4bc7#479295eb66edf821a0df2d50cc452aeb>:0
Comment 5 Chase Long 2017-11-10 15:12:02 UTC
RE: Comment #4

Those instances are from Xamarin.Forms v2.3.5.256-pre6
Comment 6 Chase Long 2017-11-10 15:24:35 UTC
RE: Comment #2, Comment #3, Comment #4

It seems the IndexOutOfRangeException exception happens at https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Core/Element.cs#L187. This would happen when _changeHandlers is modified on multiple threads, which can cause List.Add to throw an IndexOutOfRangeException.
Comment 7 Chase Long 2017-11-10 15:44:30 UTC
I'm only glancing at this, but I think https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs#L213 is the call where this originates. This call

navPage.Pages.ForEach(async p => await PushPageAsync(p, false));

appears to start some asynchronous work that is not properly awaited. The next line can be executed before the PushPageAsyncs all finish. Also, the PushPageAsync calls might not finish in order, because the ForEach extension method's parameter is of type Action<T>, and therefore it does not await the async lambda before calling it on the next item in the sequence.

Perhaps making `Xamarin.Forms.Platform.iOS.NavigationRenderer.ViewDidLoad` async void and properly awaiting the async calls would fix this.
Comment 8 Chase Long 2017-11-10 15:50:50 UTC
Everything after Comment #1 should probably be in a separate bug report.