We encountered a large number of crashes about XPC reported by our tool, but we could not reproduce it.
All we know is that
- App crashes on iOS8 or iOS9.
- App crashes while it backed from background to foreground.
- There are something happened between com.apple.nsurlsessiond and our app.
Here is the crash log.
Date/Time: 2016-04-21T17:32:24Z
OS Version: iPhone OS 9.2.1 (13D15)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x18107c140
Crashed Thread: 0
Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[_NSXPCDistantObject methodSignatureForSelector:]: No protocol has been set on connection <NSXPCConnection: 0x1471921a0> connection to service named com.apple.nsurlsessiond'
Last Exception Backtrace: 0
CoreFoundation 0x00000001814d9900 __exceptionPreprocess + 124 1
libobjc.A.dylib 0x0000000180b47f80 objc_exception_throw + 56 2
CoreFoundation 0x00000001814d9848 +[NSException raise:format:] + 120 3
Foundation 0x0000000181dace7c -[_NSXPCDistantObject methodSignatureForSelector:] + 376 4
CoreFoundation 0x00000001814dd324 ___forwarding___ + 212 5
CoreFoundation 0x00000001813e168c _CF_forwarding_prep_0 + 92 6
CoreFoundation 0x000000018147efc4 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 7
CoreFoundation 0x000000018147e7e4 _CFXRegistrationPost + 396 8
CoreFoundation 0x000000018147e564 ___CFXNotificationPost_block_invoke + 60 9
CoreFoundation 0x00000001814e3de4 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1532 10
CoreFoundation 0x00000001813bf0f4 _CFXNotificationPost + 368 11
Foundation 0x0000000181daed2c -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 12
UIKit 0x000000018644f9f8 -[UIApplication _sendWillEnterForegroundCallbacks] + 264 13
UIKit 0x0000000186489988 -[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:] + 1752 14
UIKit 0x0000000186489038 -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 448 15
UIKit 0x0000000186473588 __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 152 16
UIKit 0x0000000186473210 -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 712 17
FrontBoardServices 0x0000000182a8f790 -[FBSSerialQueue _performNext] + 184 18
FrontBoardServices 0x0000000182a8fb10 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 19
CoreFoundation 0x0000000181490efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 20
CoreFoundation 0x0000000181490990 __CFRunLoopDoSources0 + 540 21
CoreFoundation 0x000000018148e690 __CFRunLoopRun + 724 22
CoreFoundation 0x00000001813bd680 CFRunLoopRunSpecific + 384 23
GraphicsServices 0x00000001828cc088 GSEventRunModal + 180 24
UIKit 0x0000000186234d90 UIApplicationMain + 204 25
Does anyone know the root cause of this crash ?