Crash: exception thrown in UIPopoverPresentationController presentationTransitionWillBegin

RESOLVED FIXED in 2.0

Status

()

Firefox for iOS
General
--
critical
RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: rnewman, Assigned: bnicholson)

Tracking

(Depends on: 1 bug, {crash, reproducible})

unspecified
ARM
iOS
crash, reproducible

Firefox Tracking Flags

(fxios2.0+)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
Created attachment 8679477 [details]
Crash

Incident Identifier: E20AB62C-F9F0-460C-81B7-A815CF02CB92
Beta Identifier:     D98FFC12-BD61-40B4-BB0D-1D9BEE81DE67
Hardware Model:      iPad5,3
Process:             Client [965]
Path:                /private/var/mobile/Containers/Bundle/Application/068FD816-3230-4EA8-B905-D378B4674983/Client.app/Client
Identifier:          org.mozilla.ios.Firefox
Version:             1113 (1.1)
Beta:                YES
Code Type:           ARM-64 (Native)
Parent Process:      launchd [1]

Date/Time:           2015-10-26 21:02:28.28 -0500
Launch Time:         2015-10-26 18:19:55.55 -0500
OS Version:          iOS 9.1 (13B143)
Report Version:      105

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x184a84f48 __exceptionPreprocess + 124 (NSException.m:162)
1   libobjc.A.dylib               	0x1996f7f80 objc_exception_throw + 56 (objc-exception.mm:531)
2   UIKit                         	0x18a9355c4 -[UIPopoverPresentationController presentationTransitionWillBegin] + 2884 (UIPopoverPresentationController.m:1197)
3   UIKit                         	0x18a371210 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1640 (UIPresentationController.m:1137)
4   UIKit                         	0x18a36f328 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 332 (UIPresentationController.m:704)
5   UIKit                         	0x18a38e6bc +[UIViewController _scheduleTransition:] + 152 (UIViewController.m:5919)
6   UIKit                         	0x18a36f138 -[UIPresentationController runTransitionForCurrentState] + 1744 (UIPresentationController.m:851)
7   UIKit                         	0x18a36d330 -[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] + 1152 (UIPresentationController.m:396)
8   UIKit                         	0x18a390314 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1392 (UIViewController.m:6118)
9   UIKit                         	0x18a391d94 -[UIViewController _presentViewController:withAnimationController:completion:] + 4644 (UIViewController.m:6436)
10  UIKit                         	0x18a394540 __62-[UIViewController presentViewController:animated:completion:]_block_invoke_2 + 68 (UIViewController.m:6815)
11  UIKit                         	0x18a02686c +[UIView(Animation) performWithoutAnimation:] + 80 (UIView.m:9030)
12  UIKit                         	0x18a3944b0 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 312 (UIViewController.m:6816)
13  UIKit                         	0x18a394800 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 472 (UIViewController.m:6858)
14  UIKit                         	0x18a111ea0 -[UIViewController presentViewController:animated:completion:] + 184 (UIViewController.m:6823)
15  UIKit                         	0x18a7dccf0 -[UIPopoverController _presentShimmedPopoverFromRect:inView:permittedArrowDirections:animated:] + 200 (UIPopoverController.m:1262)
16  UIKit                         	0x18a7dcf60 -[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:] + 412 (UIPopoverController.m:1282)
17  CoreFoundation                	0x184a2a60c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:676)
18  CoreFoundation                	0x184a29e2c _CFXRegistrationPost + 396 (CFNotificationCenter.c:172)
19  CoreFoundation                	0x184a29bac ___CFXNotificationPost_block_invoke + 60 (CFNotificationCenter.c:1017)
20  CoreFoundation                	0x184a8f424 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1532 (CFXNotificationRegistrar.m:164)
21  CoreFoundation                	0x18496a714 _CFXNotificationPost + 368 (CFNotificationCenter.c:1037)
22  Foundation                    	0x1858dadcc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 (NSNotification.m:499)
23  UIKit                         	0x18a30d46c __59-[UIWindow _rotateToBounds:withAnimator:transitionContext:]_block_invoke991 + 208 (UIWindow.m:2876)
24  UIKit                         	0x18a147698 -[_UIViewControllerTransitionContext completeTransition:] + 164 (UIViewControllerTransitioning.m:239)
25  UIKit                         	0x18a6669b8 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2204 + 28 (_UIWindowAnimationController.m:197)
26  UIKit                         	0x18a32a4e8 +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 220 (UIView.m:10389)
27  UIKit                         	0x18a66695c __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke203 + 124 (_UIWindowAnimationController.m:199)
28  UIKit                         	0x18a66644c -[_UIWindowRotationAnimationController animateTransition:] + 536 (_UIWindowAnimationController.m:211)
29  UIKit                         	0x18a30d0ec -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 556 (UIWindow.m:2888)
30  UIKit                         	0x18a30e35c -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1248 (UIWindow.m:3437)
31  UIKit                         	0x18a6ba8b4 __109+[UIStatusBarAnimationParameters animateWithParameters:fromCurrentState:frameInterval:animations:completion:]_block_invoke21 + 32 (UIStatusBarAnimations.m:67)
32  UIKit                         	0x18a02686c +[UIView(Animation) performWithoutAnimation:] + 80 (UIView.m:9030)
33  UIKit                         	0x18a08bd58 +[UIStatusBarAnimationParameters animateWithParameters:fromCurrentState:frameInterval:animations:completion:] + 444 (UIStatusBarAnimations.m:69)
34  UIKit                         	0x18a08bb7c +[UIStatusBarAnimationParameters animateWithParameters:fromCurrentState:animations:completion:] + 96 (UIStatusBarAnimations.m:47)
35  UIKit                         	0x18a08c814 -[UIStatusBarWindow setOrientation:animationParameters:] + 244 (UIStatusBarWindow.m:113)
36  UIKit                         	0x18a2c2810 -[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:updateBlock:] + 736 (UIApplication.m:4648)
37  UIKit                         	0x18a30e740 __78-[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:]_block_invoke1183 + 292 (UIWindow.m:3410)
38  UIKit                         	0x18a666748 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 168 (_UIWindowAnimationController.m:176)
39  UIKit                         	0x18a32a4e8 +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 220 (UIView.m:10389)
40  UIKit                         	0x18a666558 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 136 (_UIWindowAnimationController.m:187)
41  UIKit                         	0x18a66643c -[_UIWindowRotationAnimationController animateTransition:] + 520 (_UIWindowAnimationController.m:209)
42  UIKit                         	0x18a30d0ec -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 556 (UIWindow.m:2888)
43  UIKit                         	0x18a30e35c -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1248 (UIWindow.m:3437)
44  UIKit                         	0x18a09b598 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 1360 (UIWindow.m:3479)
45  UIKit                         	0x18a09aecc -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 172 (UIWindow.m:3306)
46  UIKit                         	0x18a091684 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 132 (UIWindow.m:3000)
47  UIKit                         	0x18a019798 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 476 (UIWindow.m:3033)
48  UIKit                         	0x18a49ca90 -[UIScreen _notifySceneBoundsChanged:] + 460 (UIScreen.m:1700)
49  UIKit                         	0x18a49ae34 -[UIScreen _computeMetrics:] + 1524 (UIScreen.m:1081)
50  UIKit                         	0x18a49a790 -[UIScreen _updateReferenceBoundsToSceneReferenceBounds:fromInterfaceOrientation:animated:] + 416 (UIScreen.m:983)
51  UIKit                         	0x18a2c836c __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke_2 + 36 (UIApplication.m:6425)
52  UIKit                         	0x18a38e5f0 +[UIViewController _performWithoutDeferringTransitions:] + 128 (UIViewController.m:5903)
53  UIKit                         	0x18a2c8314 __83-[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:]_block_invoke + 140 (UIApplication.m:6427)
54  UIKit                         	0x18a02686c +[UIView(Animation) performWithoutAnimation:] + 80 (UIView.m:9030)
55  UIKit                         	0x18a2c7f28 -[UIApplication _createSnapshotContextForScene:withName:performLayoutWithSettings:] + 428 (UIApplication.m:6429)
56  UIKit                         	0x18a2c954c __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke_2 + 124 (UIApplication.m:6553)
57  FrontBoardServices            	0x18e6e62b0 -[FBSSceneSnapshotAction _executeNextRequest] + 240 (FBSSceneSnapshotAction.m:146)
58  FrontBoardServices            	0x18e6e5ed4 -[FBSSceneSnapshotAction executeRequestsWithHandler:completionHandler:expirationHandler:] + 224 (FBSSceneSnapshotAction.m:95)
59  UIKit                         	0x18a2c9474 __65-[UIApplication _performSnapshotsWithAction:forScene:completion:]_block_invoke + 272 (UIApplication.m:6579)
60  UIKit                         	0x18a2c8a74 -[UIApplication _beginSnapshotSessionForScene:withSnapshotBlock:] + 900 (UIApplication.m:6504)
61  UIKit                         	0x18a2c9310 -[UIApplication _performSnapshotsWithAction:forScene:completion:] + 560 (UIApplication.m:6580)
62  UIKit                         	0x18a2c9064 -[UIApplication _handleSnapshotAction:forScene:completion:] + 156 (UIApplication.m:6538)
63  UIKit                         	0x18a2c5994 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke1988 + 272 (UIApplication.m:5882)
64  UIKit                         	0x18a2c55c4 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke1974 + 776 (UIApplication.m:5887)
65  UIKit                         	0x18a2c856c _runAfterCACommitDeferredBlocks + 292 (UIApplication.m:2299)
66  UIKit                         	0x18a2d54bc _cleanUpAfterCAFlushAndRunDeferredBlocks + 92 (UIApplication.m:2276)
67  UIKit                         	0x18a009984 _afterCACommitHandler + 96 (UIApplication.m:2328)
68  CoreFoundation                	0x184a3bbd0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1623)
69  CoreFoundation                	0x184a39974 __CFRunLoopDoObservers + 372 (CFRunLoop.c:1716)
70  CoreFoundation                	0x184a39da4 __CFRunLoopRun + 928 (CFRunLoop.c:711)
71  CoreFoundation                	0x184968ca0 CFRunLoopRunSpecific + 384 (CFRunLoop.c:2814)
72  GraphicsServices              	0x18f9e8088 GSEventRunModal + 180 (GSEvent.c:2247)
73  UIKit                         	0x18a080ffc UIApplicationMain + 204 (UIApplication.m:3668)
74  Client                        	0x10010de9c 0x1000dc000 + 204444
75  libdyld.dylib                 	0x199f3a8b8 start + 4 (start_glue.s:80)

Updated

3 years ago
Severity: normal → critical
tracking-fxios: --- → ?
tracking-fxios: ? → 1.2+
Assignee: nobody → etoop
Status: NEW → ASSIGNED
I've tried to reproduce this on the following popovers on iPad, iPad Air, iPad Air 2 on iOS 9.1. No crashing. Can anyone think of anything else that might cause it?

Popovers:

* Initial tour
* URLBar long press actions popover
* Settings
* Share/Actions toolbar button menu
* Web View Link Long Press actions popover

steps I tried to reproduce crash with each popover on each device.

* rotate
* enter app switcher
* rotate
* return to firefox
* open multitasking
* rotate to landscape
* change size of multitasking window.
* open firefox as multitasking window
* close popover.
* enter/exit app switcher
Unable to replicate this crash. Can reopen if it happens again with better stack trace/STR.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 3

3 years ago
http://stackoverflow.com/questions/26019660/app-crashing-in-uipopoverpresentationcontroller-but-no-explicit-popovers ?

https://developer.appcelerator.com/question/181937/ios-8-crash-related-to-uipopoverpresentationcontroller-on-ipad

suggests that it might be due to interacting with dropdowns in web content.

Another page I found suggests that this might be because a UIPopoverController is deallocated before being presented, with the fix being to have a strong property hold it.
(Reporter)

Comment 4

3 years ago
This stack is also very snapshot-heavy, so my guess is that we're snapshotting while being backgrounded while hitting the share button or a menu in web content.
Assignee: etoop → nobody
Status: RESOLVED → REOPENED
tracking-fxios: 1.2+ → ---
Resolution: WORKSFORME → ---

Updated

3 years ago
Flags: needinfo?(misbahkhan9211)
Comment hidden (spam)
High up on 1.4, nothing on 2.0 so far. All iPads/Pro devices in the signatures.
Reproducible on master (2.0)

Visit http://www.westjet.com/ on an iPad, open the drop-down on the right side 'View Fares From', background the application:

016-02-08 15:46:47.128 Client[39415:24025635] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<UIPopoverPresentationController: 0x7f9c494dbe40>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000107b9fe65 __exceptionPreprocess + 165
	1   libobjc.A.dylib                     0x0000000106ebfdeb objc_exception_throw + 48
	2   UIKit                               0x0000000109355b63 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3407
	3   UIKit                               0x0000000108b0d8dc __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2035
	4   UIKit                               0x0000000108b0b50e __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 309
tracking-fxios: --- → ?
Keywords: reproducible
Needs an assignee for 2.0
Status: REOPENED → NEW
(Reporter)

Updated

2 years ago
Assignee: nobody → bnicholson
Status: NEW → ASSIGNED
tracking-fxios: ? → 2.0+
(Assignee)

Comment 9

2 years ago
The popover for HTML elements seems to be owned by WKWebView, so I don't think we can fix this directly. As a workaround, we can try removing focus from any active <select> elements when backgrounding, which should dismiss the popover.

This is also reproducible in Safari. Filed http://openradar.appspot.com/radar?id=5033179731722240.
(Assignee)

Comment 10

2 years ago
Created attachment 8717589 [details] [review]
Link to Github pull-request: https://github.com/mozilla/firefox-ios/pull/1514
Attachment #8717589 - Flags: review?(rnewman)
(Reporter)

Comment 11

2 years ago
Comment on attachment 8717589 [details] [review]
Link to Github pull-request: https://github.com/mozilla/firefox-ios/pull/1514

r+ with comments. Please file a follow-up to remove the workaround.
Attachment #8717589 - Flags: review?(rnewman) → review+
(Assignee)

Updated

2 years ago
Depends on: 1247115
(Assignee)

Comment 12

2 years ago
https://github.com/mozilla/firefox-ios/commit/f7d7c2d68f5cc02969c122632fa88328c54f855f
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0
You need to log in before you can comment on or make changes to this bug.