Bug 42651

Summary: Pushing a page on the navigation stack while device is rotating crashes the app
Product: Forms Reporter: adrianknight89
Component: FormsAssignee: Bugzilla <bugzilla>
Status: VERIFIED FIXED    
Severity: normal CC: david, FieldstrikeMobile, jas, mohitk, rui.marinho, sahou
Priority: Normal    
Version: 2.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: ac Is this bug a regression?: ---
Last known good build:
Attachments: repro

Description adrianknight89 2016-07-19 02:22:41 UTC
Created attachment 16712 [details]
repro

Tested this on iOS 9 & XF 2.3.1.111-pre2 

I tried to push a page on the navigation stack while the device is changing orientation, but this crashes the app immediately. If I put a delay and wait till the screen layout changes, pushing the page works fine.

Please see repro.

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

The app has been terminated.
2016-07-18 21:11:26.504 App4iOS[1404:830014] 
Unhandled Exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x00000] in /Users/builder/data/lanes/1381/3afb4af5/source/maccore/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/throwhelper.cs:99 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () <0x10016ff70 + 0x0002f> in <filename unknown>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () <0x10016fea0 + 0x0009f> in <filename unknown>:0 
  at Xamarin.Forms.Page.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00119] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\Page.cs:167 
  at Xamarin.Forms.Page.UpdateChildrenLayout () [0x000d0] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Core\Page.cs:252 
  at Xama
The app has been terminated.
Comment 1 adrianknight89 2016-12-05 02:40:54 UTC
https://github.com/xamarin/Xamarin.Forms/pull/607
Comment 2 Rui Marinho 2016-12-06 12:13:09 UTC
Should be fixed in 2.3.4-pre2
Comment 3 Mohit Kheterpal 2017-02-02 16:49:22 UTC
I have checked this issue and observed that this issue has been fixed in xamarin.forms 2.3.4.184-pre1.

Hence, closing this issue by marking it as Verified.

thanks