Bug 59172 - Popped page does not appear on top of current navigation stack, please file a bug.
Summary: Popped page does not appear on top of current navigation stack, please file a...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on: 60966
Blocks:
  Show dependency tree
 
Reported: 2017-09-01 11:06 UTC by Evgeny Zborovsky
Modified: 2019-02-27 16:08 UTC (History)
8 users (show)

Tags: navigation stack, popasync, ac
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project (57.01 KB, application/zip)
2017-09-01 11:06 UTC, Evgeny Zborovsky
Details
Simulator behavior (2.76 MB, image/gif)
2017-09-01 12:53 UTC, Paul DiPietro [MSFT]
Details
Simulator behaviour reproducrion (1.54 MB, image/gif)
2017-09-01 13:18 UTC, Evgeny Zborovsky
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 for Bug 59172 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:
CONFIRMED

Description Evgeny Zborovsky 2017-09-01 11:06:45 UTC
Created attachment 24519 [details]
Sample project

Sample project is attached and can be also found on https://github.com/yuv4ik/Xamarin-Forms-Navigation-Bug
Very easy to reproduce in Xamarin.Forms 2.3.4.270 on simulator and actual device with iOS 10.3, didn't test on Android.

Steps to reproduce:
- Create 5 ContentPages
- Set first as NavigationPage
- Set 'NavigationPage.SetHasNavigationBar(this, false);' on Page2 to false and provide a button to navigate back with the next code 'await Navigation.PopAsync();'
- Navigate from Page1 to Page5 and go back

The result is: 'Popped page does not appear on top of current navigation stack, please file a bug.'


=== Visual Studio Community 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: cc6e83eb-699b-4452-94db-5055d36570f1
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	1.1.1
	1.0.4
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
SDK Versions:
	1.0.3
	1.0.1
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.0.20 (Visual Studio Community)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Xamarin.Android ===

Version: 7.4.0.21 (Visual Studio Community)
Android SDK: /Users/xxx/Library/Android/sdk
	Supported Android versions:
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 26.0.2
SDK Platform Tools Version: 26.0.0
SDK Build Tools Version: 26.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.6.0.19 (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

NuGet Package Management Extensions 0.12.2
xUnit.NET 2 testing framework support 0.7.5

StackTrace:
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPopViewAsync>d__43.MoveNext () [0x0005e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:301 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at Xamarin.Forms.NavigationPage+<Xamarin-Forms-INavigationPageController-PopAsyncInner>d__63.MoveNext () [0x000a7] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\NavigationPage.cs:250 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at Xamarin.Forms.NavigationPage+<PopAsync>d__38.MoveNext () [0x00172] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\NavigationPage.cs:131 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at navbugtest.MyPage2+<Handle_Clicked_Back>d__0.MoveNext () [0x00025] in /Users/xxx/Projects/navbugtest/navbugtest/MyPage2.xaml.cs:12 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.12.0.20/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/4991/80b8487d/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/4991/80b8487d/source/xamarin-macios/src/Foundation/NSAction.cs:163 
--- End of stack trace from previous location where exception was thrown ---
  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) [0x00005] in /Users/builder/data/lanes/4991/80b8487d/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/4991/80b8487d/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
  at navbugtest.iOS.Application.Main (System.String[] args) [0x00001] in /Users/xxx/Projects/navbugtest/iOS/Main.cs:17
Comment 1 Paul DiPietro [MSFT] 2017-09-01 12:52:29 UTC
Using the provided reproduction, I am not able to reproduce this on an iOS 10.3 simulator. I am clicking forward to the fifth page, then back to the first, using the back button on the second page. Is there something missing here that needs to be changed, or any more insight that you can provide? I am attaching a .gif recording the simulator to show what's occurring on my end.
Comment 2 Paul DiPietro [MSFT] 2017-09-01 12:53:09 UTC
Created attachment 24521 [details]
Simulator behavior
Comment 3 Evgeny Zborovsky 2017-09-01 13:18:37 UTC
Created attachment 24522 [details]
Simulator behaviour reproducrion
Comment 4 Evgeny Zborovsky 2017-09-01 13:20:50 UTC
Theo only thing I could think of is maybe you should click faster.
Comment 5 Paul DiPietro [MSFT] 2017-09-01 13:51:45 UTC
Yes, that makes a difference and is mandatory for reproducing the bug. I also checked against the nightly build so there's probably some sort of condition where (if I had to guess) the navigation stack hasn't been correctly updated in the time that the window has popped, but only if you're tapping the button(s) quickly enough. It works as expected otherwise.
Comment 6 Evgeny Zborovsky 2017-09-04 06:48:31 UTC
Yes, that's right, however without a custom back button, it is working as expected even if you click BACK very fast. So it seems like 'await Navigation.PopAsync()' is not doing the same thing as auto-generated BACK button.
Comment 7 DesenEnterprises 2017-12-14 17:32:28 UTC
I get this same crash when using the following code to push a new page in the stack and then pop the top one to refresh all listviews, etc...:

    var vUpdatedPage = new MainPage();
    Navigation.InsertPageBefore(vUpdatedPage, this);
    await Navigation.PopAsync();

This must be too fast for the iPhone to deal with...

Is this going to be fixed soon?
Comment 8 Paul Vrugt 2018-02-09 14:52:25 UTC
I have customers running into the same issue. Any ETA on a fix?
Comment 9 DigitApps 2018-04-27 14:01:20 UTC
We have the same issue, please fix or update.