Bug 42651 - Pushing a page on the navigation stack while device is rotating crashes the app
Summary: Pushing a page on the navigation stack while device is rotating crashes the app
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-07-19 02:22 UTC by adrianknight89
Modified: 2017-02-02 16:49 UTC (History)
6 users (show)

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


Attachments
repro (903.56 KB, application/zip)
2016-07-19 02:22 UTC, adrianknight89
Details


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:
VERIFIED FIXED

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