Bug 24294 - Native crash after dismissing popover during a UINavigationController pop transition
Summary: Native crash after dismissing popover during a UINavigationController pop tra...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.4.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-11-05 18:31 UTC by Adam Kemp
Modified: 2014-11-05 18:47 UTC (History)
1 user (show)

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

Example project (9.76 KB, application/zip)
2014-11-05 18:31 UTC, Adam Kemp
Xcode project which also reproduces this bug (33.43 KB, application/zip)
2014-11-05 18:47 UTC, Adam Kemp

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:

Description Adam Kemp 2014-11-05 18:31:25 UTC
Created attachment 8636 [details]
Example project

Using the new iOS 8 API for presenting a popover I am getting a native crash (EXC_BAD_ACCESS) after programmatically dismissing the popover during UINavigationController pop transition. Specifically I am dismissing the popover (without an animation) in ViewWillDisappear in the view controller that is being popped.

My dismissal callback (popoverPresentationControllerDidDismissPopover:) is getting called, but we crash sometime later. It doesn't seem to matter whether I use a delegate or not.

The call stack is this:

#0	0x073ec0b2 in objc_msgSend ()
#1	0x03893a43 in __63-[UIPopoverPresentationController dismissalTransitionWillBegin]_block_invoke521 ()
#2	0x038d6dbb in -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] ()
#3	0x038d347e in -[_UIViewControllerTransitionContext _runAlongsideCompletions] ()
#4	0x038d319a in -[_UIViewControllerTransitionContext completeTransition:] ()
#5	0x03057bc0 in __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke93 ()
#6	0x030e641e in -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] ()
#7	0x030caf72 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
#8	0x030cb2e2 in -[UIViewAnimationState animationDidStop:finished:] ()
#9	0x096d49d9 in CA::Layer::run_animation_callbacks(void*) ()
#10	0x076f003f in _dispatch_client_callout ()
#11	0x076d9764 in _dispatch_main_queue_callback_4CF ()
#13	0x0065a760 in __CFRunLoopRun ()
#14	0x00659bcb in CFRunLoopRunSpecific ()
#15	0x006599fb in CFRunLoopRunInMode ()
#16	0x098ba24f in GSEventRunModal ()
#17	0x098ba08c in GSEventRun ()
#18	0x030638b6 in UIApplicationMain ()

I think the selector it is trying to invoke is "layer", but it's not clear which object is involved. I have not yet attempted to do this in Objective-C yet.

Attached is a sample project. To reproduce run the app, tap the button (transitions to new screen), tap the next button (shows the popup), then tap on the back button in the top left while the popup is still showing. At some point shortly after that back transition the app crashes.

Any suggested workarounds woule be very welcome!
Comment 1 Adam Kemp 2014-11-05 18:46:06 UTC
It appears that this is actually an iOS bug. Awesome.

I'll be filing an Apple bug report instead. *sigh*...
Comment 2 Adam Kemp 2014-11-05 18:47:11 UTC
Created attachment 8638 [details]
Xcode project which also reproduces this bug