I recommend that you remove your third-party crash reporter and see if you can get an Apple crash report for this. If so, please post it here. See Posting a Crash Report for advice on how to do that.
Third-party crash reporters are always problematic, as I explain in detail in Implementing Your Own Crash Reporter. However, in this specific case the crash report is most definitely bogus. Consider this:
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1728 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x4e38 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x4d50 mach_msg_overwrite + 424
3 libsystem_kernel.dylib 0x4b9c mach_msg + 24
4 CoreFoundation 0x547cc __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x53e78 __CFRunLoopRun + 1212
6 CoreFoundation 0x535b8 CFRunLoopRunSpecific + 572
7 GraphicsServices 0x11c4 GSEventRunModal + 164
8 UIKitCore 0x3dfb6c -[UIApplication _run] + 816
9 UIKitCore 0x48dfdc UIApplicationMain + 340
10 App 0xe6b61c main + 23 (AppDelegate.swift:23)
Your main thread is blocked in mach_msg2_trap
waiting for an event to come in. It can’t possibly ‘crash’ while it’s in that state.
Now consider this:
BSXPCCnx:com.apple.backboard.hid-services.xpc (BSCnx:client:BKHIDEventDeliveryManager)
0 App 0x1653638 GMSx_absl::Mutex::~Mutex() + 766
1 libsystem_c.dylib 0x23b64 exit + 32
2 BackBoardServices 0x57bf0 -[BKSHIDEventDeliveryManager _initForTestingWithService:] + 98
3 BoardServices 0xbae8 __31-[BSServiceConnection activate]_block_invoke.182 + 128
4 BoardServices 0x17620 __61-[BSXPCServiceConnectionEventHandler _connectionInvalidated:]_block_invoke + 196
5 BoardServices 0x8f64 BSXPCServiceConnectionExecuteCallOut + 240
6 BoardServices 0x18e5c -[BSXPCServiceConnectionEventHandler _connectionInvalidated:] + 180
7 libdispatch.dylib 0x2370 _dispatch_call_block_and_release + 32
8 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20
9 libdispatch.dylib 0xb6d8 _dispatch_lane_serial_drain + 744
10 libdispatch.dylib 0xc214 _dispatch_lane_invoke + 432
11 libdispatch.dylib 0x17258 _dispatch_root_queue_drain_deferred_wlh + 288
12 libdispatch.dylib 0x16aa4 _dispatch_workloop_worker_thread + 540
13 libsystem_pthread.dylib 0x4c7c _pthread_wqthread + 288
14 libsystem_pthread.dylib 0x1488 start_wqthread + 8
It suggest that your app is in the middle of terminating and somehow got stuck in a mutex destructor, probably due to an atexit
handler.
Trying to untangle this without a trustworthy crash report is a challenge. However, even without that there’s still something you can do: Get rid of that atexit
handler. This looks like it’s coming from a C++ static destructor. Running a static destructor at exit like this is almost always a mistake, because once the exit completes the entire process will go away.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"