lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
246 stars 17 forks source link

29919046: [iPhone] Crash when user dismisses AVPlayerViewController from fullscreen mode. #16670

Open openradar-mirror opened 7 years ago

openradar-mirror commented 7 years ago

Description

Summary: Our app recently started using HLS streams to deliver some tutorial / on boarding videos. These were simply presented as a nested AVPlayerViewController using normal UIViewController containment.

Since then, we have started receiving crash reports from the wild indicating that when the user uses the built-in full-screen presentation button, and then dismisses the fullscreen video, occasionally, the app will crash, and present to us information about UIViewControllerHierarchyInconsistency that comes from private childviewcontrollers of AVPlayerViewController (AVFullScreenPlaybackControlsViewController and AVFullScreenViewController)

Since this involves private classes, consuming code can't fix the issue.

Steps to Reproduce:

  1. Create an AVPlayerViewController
  2. Assign a simple HLS Stream (wrapped in an AVPlayerItem)
  3. Configure it to not allow picture-in-picture and not updatesNowPlayingInfoCenter
  4. Present AVPlayerView as a childViewController using addChildViewController
  5. Either autoplay or user taps to play video
  6. User taps the standard playback control to toggle the video into fullscreen
  7. User Taps to dismiss from fullscreen

Expected Results: User should be able to tap to present fullscreen & dismiss, indefinitely, without ever seeing a crash.

Actual Results: (rarely) the app crashes with unhandled UIViewControllerHierarchyInconsistency exception which states an inconsistency between internal UIViewControllers that are part of AVPlayerViewController

-- See attached log for exact callstack, & unhandled exception line.

Version:

I suspect this just reflects our current user distribution.

Notes:

Configuration: Our crash reports from the wild document that this affects all iPhone-class devices that we currently see. It does not appear to affect iPads.

Attachments: ============= Begin 'AVPlayerViewController_FullScreen_Crash.log' ============= Fatal Exception: UIViewControllerHierarchyInconsistency child view controller:<AVFullScreenPlaybackControlsViewController: 0x15f104c00> should have parent view controller:<AVPlayerViewController: 0x15f0cf800> but actual parent is:<AVFullScreenViewController: 0x15e5c5080> Raw Text

0 CoreFoundation exceptionPreprocess 1 libobjc.A.dylib objc_exception_throw 2 CoreFoundation -[NSException initWithCoder:] 3 UIKit -[UIView(Hierarchy) _associatedViewControllerForwardsAppearanceCallbacks:performHierarchyCheck:isRoot:] 4 UIKit -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] 5 UIKit -[UIView(Internal) _addSubview:positioned:relativeTo:] 6 AVKit -[AVPlayerViewController _updatePlaybackControlsViewController] 7 AVKit -[AVPlayerViewController observeValueForKeyPath:ofObject:change:context:] 8 Foundation -[NSKeyValueObservance observeValueForKeyPath:ofObject:change:context:] 9 Foundation NSKeyValueNotifyObserver 10 Foundation NSKeyValueDidChange 11 Foundation -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] 12 AVKit -[AVPlayerView _updateViewWindowState] 13 AVKit -[AVPlayerView setFrame:] 14 UIKit -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] 15 CoreFoundation 53-[NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke 16 CoreFoundation -[NSArrayM enumerateObjectsWithOptions:usingBlock:] 17 UIKit -[UIView(Geometry) resizeSubviewsWithOldSize:] 18 UIKit -[UIView(Geometry) setFrame:] 19 UIKit -[UIViewController window:statusBarWillChangeFromHeight:toHeight:windowSizedViewController:] 20 UIKit -[UIViewController window:statusBarWillChangeFromHeight:toHeight:] 21 UIKit -[UIWindow handleStatusBarChangeFromHeight:toHeight:] 22 UIKit +[UIWindow _noteStatusBarHeightChanged:oldHeight:forAutolayoutRootViewsOnly:] 23 UIKit 79-[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:]_block_invoke 24 UIKit +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] 25 UIKit +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:completion:] 26 UIKit -[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] 27 UIKit -[UIApplication _updateCurrentStatusBarViewControllerAppearance] 28 UIKit -[UIViewController setNeedsStatusBarAppearanceUpdate] 29 UIKit -[UIViewController setNeedsStatusBarAppearanceUpdate] 30 UIKit -[UIViewController _setPresentedStatusBarViewController:] 31 UIKit -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] 32 UIKit -[UIViewController _presentViewController:withAnimationController:completion:] 33 UIKit -[UIViewController _performCoordinatedPresentOrDismiss:animated:] 34 UIKit -[UIViewController presentViewController:animated:completion:] 35 AVKit -[AVPlayerViewController _transitionToFullScreenViewControllerAnimated:completionHandler:] 36 AVKit -[AVPlayerViewController(AVPlaybackControlsViewControllerActions) fullScreenButtonTapped:] 37 AVKit -[AVPlaybackControlsViewController fullScreenButtonTapped:] 38 UIKit -[UIApplication sendAction:to:from:forEvent:] 39 UIKit -[UIControl sendAction:to:forEvent:] 40 UIKit -[UIControl _sendActionsForEvents:withEvent:] 41 UIKit -[UIControl touchesEnded:withEvent:] 42 UIKit -[UIWindow _sendTouchesForEvent:] 43 UIKit -[UIWindow sendEvent:] 44 UIKit -[UIApplication sendEvent:] 45 UIKit _UIApplicationHandleEventQueue 46 CoreFoundation CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION 47 CoreFoundation CFRunLoopDoSources0 48 CoreFoundation __CFRunLoopRun 49 CoreFoundation CFRunLoopRunSpecific 50 GraphicsServices GSEventRunModal 51UIKit UIApplicationMain 52 [redacted] main.m line 17 main 53 libdispatch.dylib (Missing) ============= End 'AVPlayerViewController_FullScreen_Crash.log' =============

- Product Version: iOS 9/iOS 10 Created: 2017-01-08T20:29:39.741240 Originated: 2017-01-08T12:25:00 Open Radar Link: http://www.openradar.me/29919046

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020

openradar-mirror commented 7 years ago

Modified: 2017-01-08T23:44:17.846020