Is this crash due to too much logging?

I'm occasionally getting a crash (on iOS) after a hang and termination by the OS. While reproducing it and watching the Mac console I don't see any obvious cause of the issue. There shouldn't be anything synchronous and long running in the main thread. Verbose logging is turned on, is it possible too much logging is causing this (its using NSLog for the console and also echoing logging to Crashlytics.log())? If so why is it not deterministic in its reproducibility? Here's a crash stack:

> Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[application<com.appname>:3315] failed to terminate gracefully after 5.0s
ProcessVisibility: Unknown
ProcessState: Running
WatchdogEvent: process-exit
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 4.260 (user 2.150, system 2.110), 11% CPU",
"Elapsed application CPU time (seconds): 0.022, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>
 
Triggered by Thread:  0

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x1dd27b7dc __ulock_wait + 8 1 libsystem_platform.dylib 0x1fe05efb0 _os_unfair_lock_lock_slow + 176 2 CoreFoundation 0x19e3a6648 _logToStderr + 148 3 CoreFoundation 0x19e421500 __CFLogCString + 84 4 CoreFoundation 0x19e34fc8c _CFLogvEx2Predicate + 344 5 CoreFoundation 0x19e35e548 _CFLogvEx3 + 252 6 Foundation 0x1986195c0 _NSLogv + 124 7 Foundation 0x198617f58 NSLog + 56 8 AppName 0x1042dd480 +[Logger trace:] + 70784 (Logger.m:48) 9 AppName 0x104311ae4 CallExtensionManager.appBecameActive() + 285412 (<compiler-generated>:0) 10 AppName 0x104312004 @objc CallExtensionManager.appBecameActive() + 286724 (<compiler-generated>:0) 11 CoreFoundation 0x19e2f2590 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 12 CoreFoundation 0x19e396828 ___CFXRegistrationPost_block_invoke + 88 13 CoreFoundation 0x19e3798b8 _CFXRegistrationPost + 440 14 CoreFoundation 0x19e306afc _CFXNotificationPost + 700 15 Foundation 0x1985d1d18 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 16 UIKitCore 0x1a05b61e8 -[UIApplication _stopDeactivatingForReason:] + 1236 17 UIKitCore 0x1a05b5c98 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 280 18 UIKitCore 0x1a05b5a84 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 620 19 UIKitCore 0x1a05b5634 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 252 20 UIKitCore 0x1a05b5500 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 148 21 UIKitCore 0x1a0ca2a68 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:fromCurrentState:actions:completion:] + 736 22 UIKitCore 0x1a0d41074 _UISceneSettingsDiffActionPerformChangesWithTransitionContextAndCompletion + 224 23 UIKitCore 0x1a0462c70 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 316 24 UIKitCore 0x1a08d41ac __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke.223 + 556 25 UIKitCore 0x1a0533c60 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 216 26 UIKitCore 0x1a0533ad0 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 244 27 UIKitCore 0x1a0533910 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 336 28 FrontBoardServices 0x1b4340ac8 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 420 29 FrontBoardServices 0x1b4340904 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 152 30 FrontBoardServices 0x1b4344120 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 31 FrontBoardServices 0x1b434403c __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 344 32 libdispatch.dylib 0x1a578beac _dispatch_client_callout + 20 33 libdispatch.dylib 0x1a578f91c _dispatch_block_invoke_direct + 264 34 FrontBoardServices 0x1b434e24c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 35 FrontBoardServices 0x1b434dde8 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 36 FrontBoardServices 0x1b4350694 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 37 CoreFoundation 0x19e38e128 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 38 CoreFoundation 0x19e39a7b4 __CFRunLoopDoSource0 + 176 39 CoreFoundation 0x19e31f648 __CFRunLoopDoSources0 + 340 40 CoreFoundation 0x19e3350d4 __CFRunLoopRun + 828 41 CoreFoundation 0x19e33a3ec CFRunLoopRunSpecific + 612 42 GraphicsServices 0x1d985035c GSEventRunModal + 164 43 UIKitCore 0x1a06c6f58 -[UIApplication _run] + 888 44 UIKitCore 0x1a06c6bbc UIApplicationMain + 340 45 AppName 0x1042dfbf0 main + 80880 (main.m:7) 46 dyld 0x1bd86cdec start + 2220

<snip>

Can't get the stack trace for Thread 0 to display nicely

Replies

And a little more that couldn't fit in the original post

Thread 0 crashed with ARM Thread State (64-bit): x0: 0xfffffffffffffffc x1: 0x0000000000000000 x2: 0x0000000000005d02 x3: 0x0000000000000000 x4: 0x0000000000000000 x5: 0x000000016bb30d20 x6: 0x0000000000000032 x7: 0x00000000000a0400 x8: 0x0000000000005d02 x9: 0x0000000000005d03 x10: 0x0000000000000200 x11: 0x0000000000000003 x12: 0x0000000000000003 x13: 0x00000000001ff800 x14: 0x00000000000007fb x15: 0x00000000b620b829 x16: 0x0000000000000203 x17: 0x00000001f63c25e0 x18: 0x0000000000000000 x19: 0x0000000000000103 x20: 0x0000000000000000 x21: 0x00000001f4c74048 x22: 0x0000000001000002 x23: 0x0000000000005d02 x24: 0x0000000000000000 x25: 0x00000000ffffffff x26: 0x0000000000000103 x27: 0x000000019858f17c x28: 0x000000016bb31128 fp: 0x000000016bb30dc0 lr: 0x00000001fe05efb0 sp: 0x000000016bb30d80 pc: 0x00000001dd27b7dc cpsr: 0x40001000 far: 0x0000000b9c861208 esr: 0x56000080 Address size fault