Crashed: com.apple.CFNetwork.Connection

Hi, i have a crash received in my Firebase Crashlytics. I couldn't figure out the root cause of the issue. Could anyone please help me with it.

Crashed: com.apple.CFNetwork.Connection
0  libobjc.A.dylib                0x1c38 objc_msgSend + 56
1  CoreFoundation                 0x7a3e8 __CFBasicHashDrain + 320
2  CoreFoundation                 0x7ea10 _CFRelease + 316
3  Security                       0x1116c SecCertificateParse + 1844
4  Security                       0x17f08 SecCertificateCreateWithBytes + 124
5  Security                       0x150a4 SecCertificateCreateWithXPCArrayAtIndex + 80
6  Security                       0x13904 SecXPCDictionaryCopyChainOptional + 148
7  Security                       0xedfb8 __handle_trust_evaluate_xpc_async_block_invoke_2 + 112
8  Security                       0x30f60 __securityd_send_async_and_do_block_invoke + 128
9  Security                       0x30d5c ___securityd_message_with_reply_async_inner_block_invoke + 84
10 libxpc.dylib                   0x1df1c _xpc_connection_reply_callout + 124
11 libxpc.dylib                   0x10fb4 _xpc_connection_call_reply_async + 88
12 libdispatch.dylib              0x405c _dispatch_client_callout3 + 20
13 libdispatch.dylib              0x21f58 _dispatch_mach_msg_async_reply_invoke + 344
14 libdispatch.dylib              0xb56c _dispatch_lane_serial_drain + 376
15 libdispatch.dylib              0xc214 _dispatch_lane_invoke + 436
16 libdispatch.dylib              0xd4f8 _dispatch_workloop_invoke + 1780
17 libdispatch.dylib              0x16e10 _dispatch_workloop_worker_thread + 652
18 libsystem_pthread.dylib        0xdf8 _pthread_wqthread + 288
19 libsystem_pthread.dylib        0xb98 start_wqthread + 8

Here is the complete crash report.

Answered by DTS Engineer in 737975022

Consider the backtrace of your crashing thread:

Crashed: com.apple.CFNetwork.Connection
0  libobjc.A.dylib … objc_msgSend + 56
1  CoreFoundation  … __CFBasicHashDrain + 320
2  CoreFoundation  … _CFRelease + 316
3  Security        … SecCertificateParse + 1844
4  Security        … SecCertificateCreateWithBytes + 124
5  Security        … SecCertificateCreateWithXPCArrayAtIndex + 80
6  Security        … SecXPCDictionaryCopyChainOptional + 148
7  Security        … __handle_trust_evaluate_xpc_async_block_invoke_2 + 112
8  Security        … __securityd_send_async_and_do_block_invoke + 128
9  Security        … ___securityd_message_with_reply_async_inner_block_invoke + 84
10 libxpc.dylib    … _xpc_connection_reply_callout + 124
…

Frames 10 through 3 are Security framework code being called by XPC to handle a reply from the trust daemon (trustd). Frame 3 is the interesting one. It seems to be parsing a certificate that came back from the daemon. There are two possibilities here:

  • The trust daemon send a completely bogus response that crashed the parser.

  • Something else within your process is causing this problem.

I suspect it’s the latter. Given that frame 2 is a memory management call, I suspect that something in your process is corrupting memory and this code is just an innocent bystander.

My advice is that you run your app with the standard memory debugging tools to see if you can make this problem reproduce locally.

Share and Enjoy

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

Accepted Answer

Consider the backtrace of your crashing thread:

Crashed: com.apple.CFNetwork.Connection
0  libobjc.A.dylib … objc_msgSend + 56
1  CoreFoundation  … __CFBasicHashDrain + 320
2  CoreFoundation  … _CFRelease + 316
3  Security        … SecCertificateParse + 1844
4  Security        … SecCertificateCreateWithBytes + 124
5  Security        … SecCertificateCreateWithXPCArrayAtIndex + 80
6  Security        … SecXPCDictionaryCopyChainOptional + 148
7  Security        … __handle_trust_evaluate_xpc_async_block_invoke_2 + 112
8  Security        … __securityd_send_async_and_do_block_invoke + 128
9  Security        … ___securityd_message_with_reply_async_inner_block_invoke + 84
10 libxpc.dylib    … _xpc_connection_reply_callout + 124
…

Frames 10 through 3 are Security framework code being called by XPC to handle a reply from the trust daemon (trustd). Frame 3 is the interesting one. It seems to be parsing a certificate that came back from the daemon. There are two possibilities here:

  • The trust daemon send a completely bogus response that crashed the parser.

  • Something else within your process is causing this problem.

I suspect it’s the latter. Given that frame 2 is a memory management call, I suspect that something in your process is corrupting memory and this code is just an innocent bystander.

My advice is that you run your app with the standard memory debugging tools to see if you can make this problem reproduce locally.

Share and Enjoy

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

Crashed: com.apple.CFNetwork.Connection
 
 
Q