CoreFoundation Crash (CoreFoundation: __CFRunLoopServiceMachPort + 160)

I've been seeing this crash for a few months now, and have not been able to reproduce this or make sense of the stack trace. I would really appreciate any help deciphering what the stack trace is telling me. I'm seeing mention of GRDB and from what I can tell, it looks like this is happening right as the app launches? The app does do some writing to GRDB on app launch, if that is of any relevance.

Please let me know what would be a good approach to making sense of this stack trace and investigating this crash. Thank you so much in advance.

Stack trace:

Triggered by Thread:  0


Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x000000018fa2fb1c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x000000018fa2da14 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x000000018fa2d478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   GraphicsServices              	0x00000001d2fae4f8 GSEventRunModal + 164 (GSEvent.c:2196)
8   UIKitCore                     	0x0000000191e5162c -[UIApplication _run] + 888 (UIApplication.m:3685)
9   UIKitCore                     	0x0000000191e50c68 UIApplicationMain + 340 (UIApplication.m:5270)
10  Ruby                          	0x0000000104f476d0 main + 64 (AppDelegate.swift:28)
11  dyld                          	0x00000001b2766dcc start + 2240 (dyldMain.cpp:1269)

Thread 1 name:
Thread 1:
0   libsystem_kernel.dylib        	0x00000001d7166e5c guarded_pwrite_np + 8 (:-1)
1   libsqlite3.dylib              	0x00000001b8e5a3e4 seekAndWrite + 456 (sqlite3.c:44224)
…
40  libdispatch.dylib             	0x00000001979f1300 _dispatch_client_callout + 20 (object.m:561)
41  libdispatch.dylib             	0x0000000197a02dbc _dispatch_root_queue_drain + 864 (queue.c:7051)
42  libdispatch.dylib             	0x0000000197a033ec _dispatch_worker_thread2 + 156 (queue.c:7119)
43  libsystem_pthread.dylib       	0x00000001f9a1b928 _pthread_wqthread + 228 (pthread.c:2642)
44  libsystem_pthread.dylib       	0x00000001f9a1ba04 start_wqthread + 8 (:-1)

Thread 2:
0   libsystem_pthread.dylib       	0x00000001f9a1b9fc start_wqthread + 0 (:-1)

Thread 3:
0   libsystem_pthread.dylib       	0x00000001f9a1b9fc start_wqthread + 0 (:-1)

Thread 4 name:
Thread 4:
0   libsystem_kernel.dylib        	0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x000000018fa2fb1c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x000000018fa2da14 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x000000018fa2d478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   Foundation                    	0x000000018e9c048c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                    	0x000000018e9ed74c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                     	0x0000000191db34a8 -[UIEventFetcher threadMain] + 420 (UIEventFetcher.m:1208)
10  Foundation                    	0x000000018ea43de0 __NSThread__start__ + 732 (NSThread.m:991)
11  libsystem_pthread.dylib       	0x00000001f9a1c4d4 _pthread_start + 136 (pthread.c:904)
12  libsystem_pthread.dylib       	0x00000001f9a1ba10 thread_start + 8 (:-1)

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib        	0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                	0x000000018fa2fb1c __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                	0x000000018fa2da14 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                	0x000000018fa2d478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   CFNetwork                     	0x0000000190d2b060 +[__CFN_CoreSchedulingSetRunnable _run:] + 384 (CoreSchedulingSet.mm:1479)
8   Foundation                    	0x000000018ea43de0 __NSThread__start__ + 732 (NSThread.m:991)
9   libsystem_pthread.dylib       	0x00000001f9a1c4d4 _pthread_start + 136 (pthread.c:904)
10  libsystem_pthread.dylib       	0x00000001f9a1ba10 thread_start + 8 (:-1)

Thread 6:
0   libsystem_pthread.dylib       	0x00000001f9a1b9fc start_wqthread + 0 (:-1)

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib        	0x00000001d7159178 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib        	0x00000001d7158f10 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib        	0x00000001d7158e28 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib        	0x00000001d7158c68 mach_msg + 24 (mach_msg.c:323)
4   FirebaseCrashlytics           	0x00000001065bf1f4 FIRCLSMachExceptionReadMessage + 56 (FIRCLSMachException.c:192)
5   FirebaseCrashlytics           	0x00000001065bf1f4 FIRCLSMachExceptionServer + 104 (FIRCLSMachException.c:168)
6   libsystem_pthread.dylib       	0x00000001f9a1c4d4 _pthread_start + 136 (pthread.c:904)
7   libsystem_pthread.dylib       	0x00000001f9a1ba10 thread_start + 8 (:-1)

Thread 8:
0   libsystem_pthread.dylib       	0x00000001f9a1b9fc start_wqthread + 0 (:-1)


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000010004005   x1: 0x0000000507000806   x2: 0x0000000200000000   x3: 0x0000250300000000
    x4: 0x0000000000000000   x5: 0x0000250300000000   x6: 0x0000000000000002   x7: 0x00000000ffffffff
    x8: 0xfffffffffffffbbf   x9: 0x0000000000002503  x10: 0x0000000000000000  x11: 0x0000000000000001
   x12: 0x0000000000002503  x13: 0x0000000000050fc8  x14: 0x0000000000000000  x15: 0x0000000000000000
   x16: 0xffffffffffffffd1  x17: 0x0000000197a390e4  x18: 0x0000000000000000  x19: 0x00000000ffffffff
   x20: 0x0000000000000002  x21: 0x0000250300000000  x22: 0x0000000000000000  x23: 0x0000250300000000
   x24: 0x000000016b00e7b8  x25: 0x0000000200000000  x26: 0x0000000507000806  x27: 0x0000000507000806
   x28: 0x0000000107000806   fp: 0x000000016b00e720   lr: 0x00000001d7158f10
    sp: 0x000000016b00e6d0   pc: 0x00000001d7159178     cpsr: 0x1000
   esr: 0x56000080  Address size fault
Answered by DTS Engineer in 777725022

Thread 7 shows you’re using a third-party crash reporter. I recommend that you remove that [1]. If you continue to see these crashes, please post a full Apple crash report, using the instructions in Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] For a detailed explanation as to why, see Implementing Your Own Crash Reporter. For a recent example of how third-party crash reporters cause problems, see this thread.

Accepted Answer

Thread 7 shows you’re using a third-party crash reporter. I recommend that you remove that [1]. If you continue to see these crashes, please post a full Apple crash report, using the instructions in Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] For a detailed explanation as to why, see Implementing Your Own Crash Reporter. For a recent example of how third-party crash reporters cause problems, see this thread.

Will do, thank you for your response.

Hi @eskimo, thanks again for the suggestion. I removed the third party crash reporter.

Two crash reports came in which I am attaching below. While the kernel triage show different issues happening and the stack traces are not 100% identical, they both show a crash happening during the RubyLocalDB.saveStoreMetadata call and seem related.

I did see another post where it was suggested a speculative fix may be to get the Extended Virtual Addressing Entitlement? I was unsure if that would apply in my situation as well.

Any additional insight into what the crash reports are saying, particularly the kernel triage, would be really appreciated. Thank you very much.

CoreFoundation Crash (CoreFoundation: __CFRunLoopServiceMachPort + 160)
 
 
Q