A user of my app, which shows subtitles loaded from a text file above a video loaded from another file, reported that it crashes within minutes of launching it. The user confirmed that the crash only happens when they load a video within the app; if they use it without a video, it doesn't crash. The subtitles are shown in a NSTextView
added to AVPlayerView.contentOverlayView
.
What could cause such a crash? I'm not able to reproduce it.
(I tried attaching the full crash report but I always got a validation error "This post contains sensitive language. Please revise it in order to continue.")
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000019c50cae8
Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process: exc handler [20614]
Application Specific Backtrace 0:
0 CoreFoundation 0x0000000198a472ec __exceptionPreprocess + 176
1 libobjc.A.dylib 0x000000019852e788 objc_exception_throw + 60
2 Foundation 0x0000000199b2caa0 -[NSKeyValueNestedProperty object:withObservance:didChangeValueForKeyOrKeys:recurse:forwardingValues:] + 664
3 Foundation 0x0000000199af4e08 -[NSKeyValueUnnestedProperty object:withObservance:didChangeValueForKeyOrKeys:recurse:forwardingValues:] + 196
4 Foundation 0x0000000199b8bc54 NSKeyValueDidChange + 200
5 Foundation 0x0000000199acde1c -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 684
6 Foundation 0x0000000199af7484 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 64
7 Foundation 0x0000000199b110e8 _NSSetObjectValueAndNotify + 284
8 AVKit 0x00000001bd3ff694 -[AVPlayerControlsViewController setPlayerController:] + 376
9 Foundation 0x0000000199acddd0 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 608
10 Foundation 0x0000000199af7484 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 64
11 Foundation 0x0000000199b110e8 _NSSetObjectValueAndNotify + 284
12 AVKit 0x00000001bd3c6e68 -[AVPlayerView setPlaybackControlsViewController:] + 88
13 Foundation 0x0000000199b11074 _NSSetObjectValueAndNotify + 168
14 AVKit 0x00000001bd40f4b8 -[AVPlayerView _updatePlaybackControlsViewControllerIfNeeded] + 536
15 AVKit 0x00000001bd3cc0b4 -[AVPlayerView viewDidMoveToWindow] + 136
16 AppKit 0x000000019c24456c -[NSView _setWindow:] + 1788
17 AppKit 0x000000019ccce4a0 __21-[NSView _setWindow:]_block_invoke.146 + 268
18 AppKit 0x000000019c244564 -[NSView _setWindow:] + 1780
19 AppKit 0x000000019ccce4a0 __21-[NSView _setWindow:]_block_invoke.146 + 268
20 AppKit 0x000000019c244564 -[NSView _setWindow:] + 1780
...
35 AppKit 0x000000019ccce4a0 __21-[NSView _setWindow:]_block_invoke.146 + 268
36 AppKit 0x000000019c244564 -[NSView _setWindow:] + 1780
37 AppKit 0x000000019c428ec0 -[NSWindow dealloc] + 684
38 Foundation 0x000000019a1fa118 _NSKVOPerformWithDeallocatingObservable + 172
39 Foundation 0x0000000199b17404 NSKVODeallocate + 180
40 Foundation 0x0000000199b122f0 empty + 88
41 Foundation 0x0000000199af77fc dealloc + 60
42 Foundation 0x0000000199af7740 -[NSConcreteMapTable dealloc] + 76
43 AppKit 0x000000019c936e80 ___NSTouchBarFinderSetNeedsUpdateOnMain_block_invoke_2 + 1388
44 AppKit 0x000000019c2d4c4c NSDisplayCycleObserverInvoke + 168
45 AppKit 0x000000019c2d48a8 NSDisplayCycleFlush + 644
46 QuartzCore 0x00000001a0bc3f64 _ZN2CA11Transaction19run_commit_handlersE18CATransactionPhase + 120
47 QuartzCore 0x00000001a0bc2d04 _ZN2CA11Transaction6commitEv + 320
48 AppKit 0x000000019c3589d0 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 272
49 AppKit 0x000000019cd18208 ___NSRunLoopObserverCreateWithHandler_block_invoke + 64
50 CoreFoundation 0x00000001989d187c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
51 CoreFoundation 0x00000001989d1768 __CFRunLoopDoObservers + 536
52 CoreFoundation 0x00000001989d0d94 __CFRunLoopRun + 776
53 CoreFoundation 0x00000001989d0434 CFRunLoopRunSpecific + 608
54 HIToolbox 0x00000001a317419c RunCurrentEventLoopInMode + 292
55 HIToolbox 0x00000001a3173e2c ReceiveNextEventCommon + 220
...
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 AppKit 0x19c50cae8 -[NSApplication _crashOnException:] + 240
1 AppKit 0x19c358b44 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 644
2 AppKit 0x19cd18208 ___NSRunLoopObserverCreateWithHandler_block_invoke + 64
3 CoreFoundation 0x1989d187c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
4 CoreFoundation 0x1989d1768 __CFRunLoopDoObservers + 536
5 CoreFoundation 0x1989d0d94 __CFRunLoopRun + 776
6 CoreFoundation 0x1989d0434 CFRunLoopRunSpecific + 608
7 HIToolbox 0x1a317419c RunCurrentEventLoopInMode + 292
8 HIToolbox 0x1a3173e2c ReceiveNextEventCommon + 220
9 HIToolbox 0x1a3173d30 _BlockUntilNextEventMatchingListInModeWithFilter + 76
10 AppKit 0x19c22fd68 _DPSNextEvent + 660
11 AppKit 0x19ca25808 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 700
12 AppKit 0x19c22309c -[NSApplication run] + 476
13 AppKit 0x19c1fa2e0 NSApplicationMain + 880
14 Underword 0x102c099ac 0x102c08000 + 6572
15 dyld 0x19856a0e0 start + 2360