Bug 29363 - Pushing and then popping a page modally in succession causes an exception.
Summary: Pushing and then popping a page modally in succession causes an exception.
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.4.2
Hardware: Macintosh Mac OS
: Normal major
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-23 19:01 UTC by Jon Goldberger [MSFT]
Modified: 2016-02-01 14:28 UTC (History)
4 users (show)

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


Attachments
Test Project (552.32 KB, application/zip)
2015-04-23 19:01 UTC, Jon Goldberger [MSFT]
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 Jon Goldberger [MSFT] 2015-04-23 19:01:06 UTC
Created attachment 10886 [details]
Test Project

## Description

ON iOS if you push and then immediately pop a page modally, with:

await Navigation.PushModalAsync(page); 
await Navigation.PopModalAsync(true);

the app crashes with the following error:

>Trying to dismiss the presentation controller while transitioning already. (<_UIFullscreenPresentationController: 0x7e12a3d0>)
>transitionViewForCurrentTransition is not set, presentation controller was dismissed during the presentation? (<_UIFullscreenPresentationController: 0x7e12a3d0>)
>critical: Stacktrace:

>critical:   at <unknown> <0xffffffff>
>critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x000a6, 0xffffffff>
>critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62
>critical:   at UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:46
>critical:   at PlaygroundFormsNewPortable.iOS.Application.Main (string[]) [0x00008] in /Users/apple/Downloads/Playground-FormsNewPortable/iOS/Main.cs:17
>critical:   at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
>critical: 
>Native stacktrace:
>
>critical: 
>=================================================================
>Got a SIGSEGV while executing native code. This usually indicates
>a fatal error in the mono runtime or one of the native libraries 
>used by your application.
>=================================================================


## Steps to reproduce

1. Open the attached test project, restore packages, and deploy to iOS simulator or device.

2. Click the "Modal Push Pop Button"

Expected result: A red page will slide up and then slide right back down.

Actual result: App crashes with above exception.


## Notes:

I realize this is not a very useful thing to do, but I was told by a Forms team member that "this should work," so I am filing this report. 

Introducing a short delay between the push and the pop resolves the issue:

>await Navigation.PushModalAsync(page); 
>await Task.Delay(5); // Seems to work most of the time with a delay as short as 2 ms, but delay of 1 or zero consistently fails
>await Navigation.PopModalAsync(true);


## My Environment

=== Xamarin Studio ===

Version 5.8.3 (build 1)
Installation UUID: 2dc9022f-f9a8-424f-8284-bf224cbbfde0
Runtime:
	Mono 3.12.1 ((detached/0849ec7)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010003

=== Apple Developer Tools ===

Xcode 6.3.1 (7703)
Build 6D1002

=== Xamarin.iOS ===

Version: 8.9.1.3 (Business Edition)
Hash: f7736a4
Branch: 
Build date: 2015-04-09 04:22:08-0400

=== Xamarin.Android ===

Version: 4.20.2.1 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 1.12.0.14 (Business Edition)

=== Build Information ===

Release ID: 508030001
Git revision: 6e8e725e0d689351901c2c70453bfa4ea25e293b
Build date: 2015-04-06 20:31:47-04
Xamarin addins: 051cd5f8c1b5dbfc87eaef80a74aec03f34c60a8

=== Operating System ===

Mac OS X 10.10.3
Darwin Jons-iMac.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 2 Stephane Delcroix 2015-06-11 18:03:52 UTC
will be fixed in 1.4.3 final
Comment 3 Parmendra Kumar 2015-06-17 13:15:49 UTC
I have checked this issue with xamarin.forms.1.4.3.6364-pre3 and its working fine at my end.

Screencast: http://www.screencast.com/t/p64b4kFGb8

Hence closing this issue.

Environment info:

Xamarin Studio  5.9.3 (build 1)
Mono 4.0.1 ((detached/ed1d3ec)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400010044
Xcode 6.2 (6776)
Xamarin.iOS 8.10.1.64 (Enterprise Edition)
Xamarin.Android 5.1.3.1 (Enterprise Edition)
Xamarin.Mac : 2.0.1.64 (Enterprise Edition)
Mac OS X 10.9.4