Skip to content

Instantly share code, notes, and snippets.

@craftzdog
Last active December 18, 2015 22:29
Show Gist options
  • Save craftzdog/5854972 to your computer and use it in GitHub Desktop.
Save craftzdog/5854972 to your computer and use it in GitHub Desktop.
I got some crash reports where MKNetworkKit caused exceptions on my app. I hope these reports help to improve MKNetworkKit. Of course, it might be a memory management issue of my app so I'm glad to hear any suggestion. Thanks.
SIGSEGV
_mh_execute_header
Crashed Thread
0
Foundation 0x34fc5b14 +[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]
1
Foundation 0x34fd309b NSKeyValueNotifyObserver
2
Foundation 0x34fd2da5 NSKeyValueDidChange
3
Foundation 0x34fa9997 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:]
4
walknote 0x0013ddab -[MKNetworkOperation setState:] (MKNetworkOperation.m:337)
5
walknote 0x001441cd -[MKNetworkOperation connectionDidFinishLoading:] (MKNetworkOperation.m:1316)
6
Foundation 0x3506dc29 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0
7
Foundation 0x34fc56d9 -[NSURLConnectionInternalConnection invokeForDelegate:]
8
Foundation 0x34fc56a3 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]
9
Foundation 0x34fc55c5 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:]
10
CFNetwork 0x34d2a7f5 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE
11
CFNetwork 0x34d1f4a5 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl
12
CFNetwork 0x34d1f1a3 _ZN19URLConnectionClient13processEventsEv
13
CFNetwork 0x34d1f0d9 _ZN17MultiplexerSource7performEv
14
CoreFoundation 0x354fcad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
15
CoreFoundation 0x354fc29f __CFRunLoopDoSources0
16
CoreFoundation 0x354fb045 __CFRunLoopRun
17
CoreFoundation 0x3547e4a5 CFRunLoopRunSpecific
18
CoreFoundation 0x3547e36d CFRunLoopRunInMode
19
GraphicsServices 0x3711a439 GSEventRunModal
20
UIKit 0x32f8acd5 UIApplicationMain
21
walknote 0x00132503 main (main.m:19)
SIGSEGV
__27-[MKNetworkOperation start]_block_invoke499 (MKNetworkOperation.m:896)
Crashed Thread
0
libobjc.A.dylib 0x3b50f5b0 objc_msgSend + 16
1
CoreFoundation 0x33734ec1 CFSetAddValue + 117
2
CoreFoundation 0x337633cf CFRunLoopAddSource + 195
3
CFNetwork 0x3349f75b _ZN13URLConnection14pinThisRunLoopEP11__CFRunLoopPK10__CFString + 123
4
CFNetwork 0x33454b23 _ZN13URLConnection19scheduleWithRunLoopEP11__CFRunLoopPK10__CFString + 39
5
Foundation 0x34068d57 -[NSURLConnectionInternalConnection scheduleInRunLoop:forMode:] + 67
6
walknote 0x000df371 __27-[MKNetworkOperation start]_block_invoke499 (MKNetworkOperation.m:896)
7
libdispatch.dylib 0x3b92c11f _dispatch_call_block_and_release + 11
8
libdispatch.dylib 0x3b92b4b7 _dispatch_client_callout + 23
9
libdispatch.dylib 0x3b9301bd _dispatch_main_queue_callback_4CF$VARIANT$mp + 225
10
CoreFoundation 0x337bff3b __CFRunLoopRun + 1291
11
CoreFoundation 0x33732ebd CFRunLoopRunSpecific + 357
12
CoreFoundation 0x33732d49 CFRunLoopRunInMode + 105
13
GraphicsServices 0x3730b2eb GSEventRunModal + 75
14
UIKit 0x35648301 UIApplicationMain + 1121
15
walknote 0x000cf503 main (main.m:19)
NSInvalidArgumentException
-[__NSCFString count]: unrecognized selector sent to instance 0x1ea688a0
Crashed Thread
0
CoreFoundation 0x3a1912a3 __exceptionPreprocess + 163
1
libobjc.A.dylib 0x3408097f objc_exception_throw + 31
2
CoreFoundation 0x3a194e07 -[NSObject(NSObject) doesNotRecognizeSelector:] + 171
3
CoreFoundation 0x3a193531 ___forwarding___ + 393
4
CoreFoundation 0x3a0eaf68 _CF_forwarding_prep_0 + 24
5
walknote 0x000a70a5 -[MKNetworkOperation isCacheable] (MKNetworkOperation.m:122)
6
walknote 0x000a5103 __48-[MKNetworkEngine enqueueOperation:forceReload:]_block_invoke (MKNetworkEngine.m:457)
7
libdispatch.dylib 0x3848411f _dispatch_call_block_and_release + 11
8
libdispatch.dylib 0x38488961 _dispatch_root_queue_drain + 253
9
libdispatch.dylib 0x38488ac1 _dispatch_worker_thread2 + 85
10
libsystem_c.dylib 0x351eda11 _pthread_wqthread + 361
11
libsystem_c.dylib 0x351ed8a4 start_wqthread + 8
SIGSEGV
__39-[MKNetworkOperation endBackgroundTask]_block_invoke (MKNetworkOperation.m:857)
Crashed Thread
0
libobjc.A.dylib 0x3b9805ec objc_msgSend
1
libdispatch.dylib 0x3bda280f <redacted>
2
BackBoardServices 0x36837b91 <redacted>
3
SpringBoardServices 0x391c6115 <redacted>
4
CoreFoundation 0x33bcb79f CFRelease
5
UIKit 0x35ab166b <redacted>
6
UIKit 0x35ab1623 <redacted>
7
walknote 0x000a1e35 __39-[MKNetworkOperation endBackgroundTask]_block_invoke (MKNetworkOperation.m:857)
8
libdispatch.dylib 0x3bd9f793 <redacted>
9
libdispatch.dylib 0x3bd9f5db <redacted>
10
libdispatch.dylib 0x3bda2e45 _dispatch_main_queue_callback_4CF
11
CoreFoundation 0x33c5e1b1 <redacted>
12
CoreFoundation 0x33bd123d CFRunLoopRunSpecific
13
CoreFoundation 0x33bd10c9 CFRunLoopRunInMode
14
GraphicsServices 0x377b033b GSEventRunModal
15
UIKit 0x35aed2b9 UIApplicationMain
16
walknote 0x00092503 main (main.m:19)
SIGSEGV
_mh_execute_header
Crashed Thread
0
Foundation 0x3555fb14 +[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]
1
Foundation 0x3556d09b NSKeyValueNotifyObserver
2
Foundation 0x3556cda5 NSKeyValueDidChange
3
Foundation 0x35543997 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:]
4
walknote 0x0006fdab -[MKNetworkOperation setState:] (MKNetworkOperation.m:337)
5
walknote 0x00073f31 -[MKNetworkOperation start] (MKNetworkOperation.m:906)
6
Foundation 0x355d5793 __block_global_6
7
libdispatch.dylib 0x3494fc59 _dispatch_call_block_and_release
8
libdispatch.dylib 0x34952817 _dispatch_worker_thread2
9
libsystem_c.dylib 0x32e7fdfb _pthread_wqthread
SIGSEGV
-[MKNetworkOperation url] (MKNetworkOperation.m:215)
Crashed Thread
0
CoreFoundation 0x31db2c96 scanCharacters + 110
1
CoreFoundation 0x31db2ad9 computeSanitizedString + 361
2
CoreFoundation 0x31da5a6b CFURLGetString + 95
3
Foundation 0x326bad17 -[NSURL(NSURL) absoluteString] + 67
4
walknote 0x0006e55d -[MKNetworkOperation url] (MKNetworkOperation.m:215)
5
walknote 0x0006e9f1 -[MKNetworkOperation uniqueIdentifier] (MKNetworkOperation.m:278)
6
walknote 0x0006be31 -[MKNetworkEngine cachedDataForOperation:] (MKNetworkEngine.m:413)
7
walknote 0x0006c129 __48-[MKNetworkEngine enqueueOperation:forceReload:]_block_invoke (MKNetworkEngine.m:459)
8
libdispatch.dylib 0x39f5b793 _dispatch_call_block_and_release + 11
9
libdispatch.dylib 0x39f5f657 _dispatch_root_queue_drain + 279
10
libdispatch.dylib 0x39f5f7d9 _dispatch_worker_thread2 + 93
11
libsystem_c.dylib 0x39f837f1 _pthread_wqthread + 361
SIGSEGV
__39-[MKNetworkOperation endBackgroundTask]_block_invoke (MKNetworkOperation.m:857)
Crashed Thread
0
libobjc.A.dylib 0x3c0e05b6 objc_msgSend + 22
1
libdispatch.dylib 0x3c50a90f _dispatch_barrier_sync_f_invoke + 27
2
BackBoardServices 0x36fd1b83 -[BKSProcessAssertion setInvalidationHandler:] + 83
3
SpringBoardServices 0x399740f5 SBSProcessAssertionDealloc + 197
4
CoreFoundation 0x343813d1 CFRelease + 293
5
UIKit 0x36260657 -[_UIBackgroundTaskInfo invalidate] + 31
6
UIKit 0x3626060f -[UIApplication endBackgroundTask:] + 83
7
walknote 0x000d9e35 __39-[MKNetworkOperation endBackgroundTask]_block_invoke (MKNetworkOperation.m:857)
8
libdispatch.dylib 0x3c4fd11f _dispatch_call_block_and_release + 11
9
libdispatch.dylib 0x3c4fc4b7 _dispatch_client_callout + 23
10
libdispatch.dylib 0x3c4fddcb _dispatch_main_queue_callback_4CF$VARIANT$up + 227
11
CoreFoundation 0x34413f3b __CFRunLoopRun + 1291
12
CoreFoundation 0x34386ebd CFRunLoopRunSpecific + 357
13
CoreFoundation 0x34386d49 CFRunLoopRunInMode + 105
14
GraphicsServices 0x37f4a2eb GSEventRunModal + 75
15
UIKit 0x3629c301 UIApplicationMain + 1121
16
walknote 0x000ca503 main (main.m:19)
@craftzdog
Copy link
Author

My app creates almost MKNetworkOperations in non-main thread.
These crashes can't reproduce because each one was occurred only once. (The app has 1,000 launches every day.)

If I get similar crash during debugging, I will send you malloc stack or other debug information.

@craftzdog
Copy link
Author

Very weird crash..

SIGSEGV
-MKNetworkOperation start

Crashed Thread
0 libobjc.A.dylib 0x3be455ca objc_msgSend + 10
1 libdispatch.dylib 0x3c2645db _dispatch_client_callout + 23
2 libdispatch.dylib 0x3c26780f _dispatch_barrier_sync_f_invoke + 27
3 BackBoardServices 0x36cfcb91 -[BKSProcessAssertion setInvalidationHandler:] + 85
4 SpringBoardServices 0x3968ac99 SBSProcessAssertionCreateForPID + 501
5 UIKit 0x3601cd6d -[UIApplication beginBackgroundTaskWithExpirationHandler:] + 69
6 walknote 0x000ccec3 -MKNetworkOperation start
7 Foundation 0x34a55fe7 __block_global_6 + 103
8 libdispatch.dylib 0x3c264793 _dispatch_call_block_and_release + 11
9 libdispatch.dylib 0x3c268657 _dispatch_root_queue_drain + 279
10 libdispatch.dylib 0x3c2687d9 _dispatch_worker_thread2 + 93
11 libsystem_c.dylib 0x3c28c7f1 _pthread_wqthread + 361

@eytanbiala
Copy link

@noradaiko, were you able to discover the cause of the crash? I am seeing a similar issue and would appreciate any advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment