XPC API Misuse - iOS 9 crash

We encountered a large number of crashes reported by Crashlytics, but our development team was unable to reproduce it so far. It seems to happen after upgrading to iOS 9 or iOS 9.0.1.


Here is the stacktrace from Crashlytics:


Thread : Crashed: XPC API Misuse: Attempt to send a message expecting a reply to  (com.apple.networking.connection.0x15b636bc0)
0  libxpc.dylib                   0x00000001999e288c _xpc_api_misuse + 52
1  libxpc.dylib                   0x00000001999e288c _xpc_api_misuse + 52
2  libxpc.dylib                   0x00000001999cdb38 _xpc_serializer_create
3  libxpc.dylib                   0x00000001999cda1c xpc_connection_send_message + 80
4  libsystem_network.dylib        0x0000000199930be0 net_helper_send + 256
5  libsystem_network.dylib        0x000000019992bc94 tcp_connection_create_waiting_reply + 84
6  libsystem_network.dylib        0x000000019992ee6c __tcp_connection_allocate_block_invoke + 224
7  libsystem_network.dylib        0x000000019993424c __net_helper_endpoint_deliver_block_invoke_2 + 44
8  libdispatch.dylib              0x00000001997897b0 _dispatch_call_block_and_release + 24
9  libdispatch.dylib              0x0000000199789770 _dispatch_client_callout + 16
10 libdispatch.dylib              0x000000019979575c _dispatch_queue_drain + 864
11 libdispatch.dylib              0x000000019978d274 _dispatch_queue_invoke + 464
12 libdispatch.dylib              0x000000019979762c _dispatch_root_queue_drain + 728
13 libdispatch.dylib              0x000000019979734c _dispatch_worker_thread3 + 112
14 libsystem_pthread.dylib        0x000000019999d478 _pthread_wqthread + 1092


Does anybody know about what could be the cause of this crash? If so, is there a fix/workaround for it?


Thanks,

Peter

Replies

Are you asking for iOS 9.0..<9.2? As I mentioned on 10 Dec, this was reported as fixed in iOS 9.2.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

We have one crash for iOS 9.2.1 (OS Version: iPhone OS 9.2.1 (13D15))


Thread 15 Crashed: 0 libxpc.dylib 0x00000001834fa8a4 _xpc_api_misuse + 52 1 libxpc.dylib 0x00000001834ea19c xpc_dictionary_set_value + 84 2 libxpc.dylib 0x00000001834e5664 xpc_dictionary_set_int64 + 48 3 libsystem_network.dylib 0x00000001834459b4 tcp_connection_create_waiting_reply + 76 4 libsystem_network.dylib 0x0000000183464cac __network_proxy_complete_block_invoke + 76 5 libdispatch.dylib 0x00000001832a1630 _dispatch_call_block_and_release + 20 6 libdispatch.dylib 0x00000001832a15f0 _dispatch_client_callout + 12 7 libdispatch.dylib 0x00000001832ad634 _dispatch_queue_drain + 860 8 libdispatch.dylib 0x00000001832a50f4 _dispatch_queue_invoke + 460 9 libdispatch.dylib 0x00000001832af504 _dispatch_root_queue_drain + 724 10 libdispatch.dylib 0x00000001832af224 _dispatch_worker_thread3 + 108 11 libsystem_pthread.dylib 0x00000001834b5470 _pthread_wqthread + 1088 12 libsystem_pthread.dylib 0x00000001834b5020 start_wqthread + 0

It would help if you formatted your crash log excerpt as code.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thread 15 Crashed: 0 libxpc.dylib 0x00000001834fa8a4 _xpc_api_misuse + 52

1 libxpc.dylib 0x00000001834ea19c xpc_dictionary_set_value + 84

2 libxpc.dylib 0x00000001834e5664 xpc_dictionary_set_int64 + 48

3 libsystem_network.dylib 0x00000001834459b4 tcp_connection_create_waiting_reply + 76

4 libsystem_network.dylib 0x0000000183464cac __network_proxy_complete_block_invoke + 76

5 libdispatch.dylib 0x00000001832a1630 _dispatch_call_block_and_release + 20

6 libdispatch.dylib 0x00000001832a15f0 _dispatch_client_callout + 12

7 libdispatch.dylib 0x00000001832ad634 _dispatch_queue_drain + 860

8 libdispatch.dylib 0x00000001832a50f4 _dispatch_queue_invoke + 460

9 libdispatch.dylib 0x00000001832af504 _dispatch_root_queue_drain + 724

10 libdispatch.dylib 0x00000001832af224 _dispatch_worker_thread3 + 108

11 libsystem_pthread.dylib 0x00000001834b5470 _pthread_wqthread + 1088

12 libsystem_pthread.dylib 0x00000001834b5020 start_wqthread + 0

Well, that certainly looks very similar. I recommend you file a new bug about this. Feel free to x-ref the other bugs I’ve mentioned in this thread.

Please post your bug number, just for the record.

Given the similarity to the previous issue, I very much doubt there will be any reasonable workaround you can apply.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I created a new bug 2580324.

Did you see the bug 2580324?

Did you see the bug 2580324?

You seem to have mistyped the bug number. That bug tracks a change to the Java HotSpot implementation in Mac OS X 10.0!

Note that modern Radar numbers have 8 digits.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

You are right, the bug number is 25803241

You are right, the bug number is 25803241

Thanks.

Regarding that bug’s status, I don’t have any info to share right now.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

So, and when will you provide some informaton about it?

Do you have any info about this bug?

Not sure if you got an answer, however, the the reason for the trap should be reported in log or crash dump when this occurs. The routine _xpc_api_misuse in your stack trace takes a const char * as a single argument so if you run your app under debugger with a breakpoint set on _xpc_api_misuse and display string associated with the pointer in r0 or x0 depending on your arch should provide a clue.

One of our user just encountered the same issue (Crashed: XPC API Misuse: Over-resume of a connection.) on an iPhone 5 with iOS 10.0.1. It's been reported: 28384630

A user got this crash on iOS 10.0.2:


Crashed: XPC API Misuse: Over-resume of a connection.
0  libxpc.dylib                   0x188b666b0 _xpc_api_misuse + 48
1  libxpc.dylib                   0x188b666b0 _xpc_api_misuse + 48
2  libxpc.dylib                   0x188b52c08 xpc_connection_resume + 76
3  CFNetwork                      0x18a14c500 -[__NSURLBackgroundSession setupXPCConnection] + 292
4  CFNetwork                      0x18a14d260 -[__NSURLBackgroundSession ensureRemoteSession] + 64
5  CFNetwork                      0x18a197bb4 -[__NSCFBackgroundSessionTask setTaskDescription:] + 52
6  Peakbagger                     0x100235b3c -[ANSUploader startNewUploadRequest:filePath:uniqueName:] (ANSUploader.m:228)
7  Peakbagger                     0x1002360a4 __72-[ANSUploader checkSession:forTasksMatchingDescription:completionBlock:]_block_invoke (ANSUploader.m:263)
8  CFNetwork                      0x18a233978 __46-[NSURLSession getTasksWithCompletionHandler:]_block_invoke_2 + 232
9  CFNetwork                      0x18a155d58 __67-[__NSURLBackgroundSession _onqueue_getTasksWithCompletionHandler:]_block_invoke + 28
10 Foundation                     0x18a5417e4 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
11 Foundation                     0x18a486358 -[NSBlockOperation main] + 96
12 Foundation                     0x18a476954 -[__NSOperationInternal _start:] + 620
13 Foundation                     0x18a543b90 __NSOQSchedule_f + 228
14 libdispatch.dylib              0x1889091c0 _dispatch_client_callout + 16
15 libdispatch.dylib              0x188917444 _dispatch_queue_serial_drain + 928
16 libdispatch.dylib              0x18890c9a8 _dispatch_queue_invoke + 652
17 libdispatch.dylib              0x18891938c _dispatch_root_queue_drain + 572
18 libdispatch.dylib              0x1889190ec _dispatch_worker_thread3 + 124
19 libsystem_pthread.dylib        0x188b112c8 _pthread_wqthread + 1288
20 libsystem_pthread.dylib        0x188b10db4 start_wqthread + 4