IOS bug: misuse of the XPC API

We have a crash in our iOS app reported by crashlytics:

Failure: misuse of the XPC API: attempt to send a message waiting to be answered (com.apple.networking.connection.0x46bf35a0)

Stack trace:

Thread : Crashed: XPC API Misuse: Attempt to send a message expecting a reply to (com.apple.networking.connection.0x46bf35a0) 0 libxpc.dylib 0x35cc534a _xpc_api_misuse + 41 1 libsystem_c.dylib 0x35ba49e5 __strlcpy_chk + 48 2 libxpc.dylib 0x35cb5f75 _xpc_serializer_create + 158 3 libxpc.dylib 0x35cb5ea1 xpc_connection_send_message + 60 

This happened under iOS 9.0.2 on iPhone 5. We cannot reproduce the crash, and we do not know how to start debugging / correction. It seems that we are not alone with this .

Maybe someone has ideas.

+8
ios iphone xpc
source share
1 answer

There are many errors in this problem: rdar: // 21832853 is the original error, as well as rdar: // 22860899 and rdar: // 22874333, both of which are on OpenRadar.

I think this is caused by some C-based network code in SCNetworkReachability, and it is trying to talk to the iOS VPN system, presumably to determine if it is connected, or to the background daemon that is used for the NSURLSession request, but I'm not sure. Unfortunately, CFNetwork is not open source, and the libdispatch sources for 10.11 (as close as possible to iOS 9 as they become available) have not yet been published, so I can’t even guess what makes the network code wrong.

In any case, I don’t think you can get around this. With that said, assuming I'm right about the root cause, you could reproduce it by running Network Link Conditioner and turning airplane mode on and off. Anyway, it's worth a try.

+7
source share

All Articles