With the release of iOS 8 we've started getting several types of crashes that we've never seen before. Wondering if anyone else has seen this or has any suggestions.
Several of them look similar to this:
Thread : Crashed: com.apple.NSURLSession-work
0 libsystem_kernel.dylib 0x2fd3adfc __pthread_kill + 8
1 libsystem_pthread.dylib 0x2fdb8d37 pthread_kill + 62
2 libsystem_c.dylib 0x2fcda909 abort + 76
3 libsystem_malloc.dylib 0x2fd6b3af szone_error + 334
4 libsystem_malloc.dylib 0x2fd6b637 free_small_botch + 66
5 CFNetwork 0x21a63935 HTTPMessage::ensureParserFinished() + 72
6 CFNetwork 0x21a7aad3 HTTPMessage::copyHeaderFieldValue(__CFString const*) + 18
7 CFNetwork 0x21b43e87 HTTPSniffing::checkRequestAndUpdateResponseForSniffingPurposes(_CFURLRequest const*, _CFURLResponse*) + 130
8 CFNetwork 0x21b15ddd URLConnectionClient::_loaderClientEvent_DidReceiveResponse(_CFURLResponse*) + 340
9 CFNetwork 0x21b1b7d9 ___ZN19URLConnectionLoader26protocolDidReceiveResponseEP14_CFURLResponse_block_invoke + 24
10 CFNetwork 0x21ac9e03 ___ZN20ClassicURLConnection21withLoaderClientAsyncEU13block_pointerFvP21LoaderClientInterfaceE_block_invoke + 14
11 CFNetwork 0x21b14ca9 ___ZNK25URLConnectionInstanceData18withWorkQueueAsyncEU13block_pointerFvvE_block_invoke + 12
12 libdispatch.dylib 0x2fc548cb _dispatch_call_block_and_release + 10
13 libdispatch.dylib 0x2fc5c651 _dispatch_queue_drain + 952
14 libdispatch.dylib 0x2fc5709d _dispatch_queue_invoke + 84
15 libdispatch.dylib 0x2fc5dba1 _dispatch_root_queue_drain + 320
16 libdispatch.dylib 0x2fc5ecd7 _dispatch_worker_thread3 + 94
17 libsystem_pthread.dylib 0x2fdb5e31 _pthread_wqthread + 668
Thanks,
Dan
This is a bug in Apple's code and there is nothing you can do about it, other than wait for an iOS update (or you may want to avoid using the NSURLSession APIs and invoking -[NSURLHTTPResponse allHeaderFields]). But don't hold your horses, it's been there since at least iOS 7.0 and has been reported multiple times (I have done it and my ticket got closed as dupe) and is still not fixed on iOS 8.0.2.
Try updating to the latest AFNetworking 2.5.3.
Related
After new iOS release in our app become crashing with PHCompositeMediaResult. What I see in Crashlytics.
[PHCompositeMediaResult isPlaceholder]
[PHCompositeMediaResult isDegraded]
[PHCompositeMediaResult isCancelled]
Any idea what can we do with this?
Edit
Stacktrace:
Crashed: com.apple.photos.imageManagerCache
0 libobjc.A.dylib 0x1b12b8190 objc_msgSend + 16
1 CoreFoundation 0x1b146ec04 -[__NSDictionaryM objectForKeyedSubscript:] + 180
2 Photos 0x1bc7f385c -[PHCompositeMediaResult isPlaceholder] + 36
3 Photos 0x1bc84b978 -[PHCachingImageManager _canPopulateCacheForResult:] + 56
4 Photos 0x1bc84e588 __90-[PHCachingImageManager additionalWorkForImageRequestCompletedWithResult:request:context:]_block_invoke + 64
5 libdispatch.dylib 0x1b1260658 _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x1b12611cc _dispatch_client_callout + 16
7 libdispatch.dylib 0x1b120d524 _dispatch_lane_serial_drain$VARIANT$mp + 608
8 libdispatch.dylib 0x1b120df18 _dispatch_lane_invoke$VARIANT$mp + 420
9 libdispatch.dylib 0x1b1217400 _dispatch_workloop_worker_thread + 588
10 libsystem_pthread.dylib 0x1b12b0fa8 _pthread_wqthread + 276
11 libsystem_pthread.dylib 0x1b12b3ae4 start_wqthread + 8
This appears to just happen in iOS 13.0.0. I don't have any instances of it happening on 13.1, 13.1.1, or 13.1.2... So it was probably a bug in the OS that they quickly figured out and fixed. Hopefully not many users stay on 13.0.0 for long. Maybe the "what to do about this?" answer is just to do nothing.
Crashed: com.IPTV.TVLService.GuideProgramService
0 libobjc.A.dylib 0x182a05b90 objc_msgSend + 16
1 CoreFoundation 0x18326f654 CFBasicHashCreateCopy + 668
2 CoreFoundation 0x183291248 CFDictionaryCreateCopy + 148
3 CFNetwork 0x18396fa70 URLResponse::createArchiveList(__CFAllocator const*, long*, void const***, long*) + 228
4 CFNetwork 0x18396f764 URLResponse::copyPropertyList(__CFAllocator const*) + 68
5 CFNetwork 0x1839c1610 ___ZN12__CFURLCache23CreateAndStoreCacheNodeEP16__CFURLCacheNodePK20_CFCachedURLResponsePK10__CFStringPK13_CFURLRequestPKvbRb_block_invoke + 796
6 libdispatch.dylib 0x182dd94bc _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x182dd947c _dispatch_client_callout + 16
8 libdispatch.dylib 0x182de54c0 _dispatch_queue_drain + 864
9 libdispatch.dylib 0x182ddcf80 _dispatch_queue_invoke + 464
10 libdispatch.dylib 0x182de7390 _dispatch_root_queue_drain + 728
11 libdispatch.dylib 0x182de70b0 _dispatch_worker_thread3 + 112
12 libsystem_pthread.dylib 0x182ff1470 _pthread_wqthread + 1092
13 libsystem_pthread.dylib 0x182ff1020 start_wqthread + 4
I am new to iOS development.
How to understand what's causing issue? Please help me with any document or book that help me to learn solving this issues for future.
It seems like your app crashed in thread com.IPTV.TVLService.GuideProgramService and whether this thread is a custom thread or not?
Are you develop on tvOS?
There is something you should offer to make your question clear.
My iOS app uses AFNetworking (2.6.1), and my highest ranking crash is :
Crashed: com.apple.NSURLSession-work
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0004000128ab38a0
This is how most stack traces look like in Crashlytics:
Thread : Crashed: com.apple.NSURLSession-work
0 libobjc.A.dylib 0x180e29bc8 objc_msgSend + 8
1 CFNetwork 0x181df6518 SessionConnectionLoadable::_loaderClientEvent_DidReceiveConnectionCacheKey(HTTPConnectionCacheKey*) + 56
2 CFNetwork 0x181e75178 ___ZN19URLConnectionLoader36protocolDidReceiveConnectionCacheKeyEP22HTTPConnectionCacheKey_block_invoke + 40
3 libdispatch.dylib 0x1811fd630 _dispatch_call_block_and_release + 24
4 libdispatch.dylib 0x1811fd5f0 _dispatch_client_callout + 16
5 libdispatch.dylib 0x181209634 _dispatch_queue_drain + 864
6 libdispatch.dylib 0x1812010f4 _dispatch_queue_invoke + 464
7 libdispatch.dylib 0x18120b504 _dispatch_root_queue_drain + 728
8 libdispatch.dylib 0x18120b224 _dispatch_worker_thread3 + 112
9 libsystem_pthread.dylib 0x181411470 _pthread_wqthread + 1092
10 libsystem_pthread.dylib 0x181411020 start_wqthread + 4
I don't use kvo, and my app uses location and stays in the background at all times.
Any ideas on how to debug / recreate (I can't manage to recreate the issue in a simulator or on a device) ?
Even catching the exception, without knowing where it is or how to handle it correctly would suffice in this case...
I've recently started getting these crashes frequently. But unable to figure out what does it really mean. It seems like the crash occured in MintRequestWorker. But this log is insufficient to know about it.
I am using AFNetworking, Splunk Mint, Crashlytics, Google Analytics.
Can someone guide me what am I probably doing wrong here?
Thread : Crashed: com.apple.root.default-priority
0 IOKit 0x30bc831c IOServiceAddInterestNotification + 47
1 UIKit 0x32950af1 _MatchedBatteries + 76
2 UIKit 0x32950af1 _MatchedBatteries + 76
3 UIKit 0x32950a2f -[UIDevice setBatteryMonitoringEnabled:] + 198
4 Earthmiles 0x001a268f -[DataFixture appendBaseValues] + 1652367
5 Earthmiles 0x001a1f53 -[DataFixture init] + 1650515
6 Earthmiles 0x001ce939 -[EventDataFixture init] + 1833273
7 Earthmiles 0x001ca657 +[GnipDataFixture getInstanceWithAppEnvironment:] + 1816151
8 Earthmiles 0x001db0e9 -[MintRequestJsonSerializer serializeEventToJsonForGnipWithAppEnvironment:] + 1884393
9 Earthmiles 0x001a964d -[MintRequestWorker logEvent:] + 1680973
10 Earthmiles 0x001ab19b -[MintRequestWorker closeSession] + 1687963
11 Earthmiles 0x001ab51d __58-[MintRequestWorker closeSessionAsyncWithCompletionBlock:]_block_invoke + 1688861
12 libdispatch.dylib 0x3ab5bd53 _dispatch_call_block_and_release + 10
13 libdispatch.dylib 0x3ab61689 _dispatch_root_queue_drain + 228
14 libdispatch.dylib 0x3ab618dd _dispatch_worker_thread2 + 56
15 libsystem_pthread.dylib 0x3ac8cc17 _pthread_wqthread + 298
16 libsystem_pthread.dylib 0x3ac8cadc start_wqthread + 8
Getting a lot of crash reports with this stack trace... unable to fix it.
Had suspicion that it has something to do with me manipulating cookies in the shared instance of NSHTTPCookieStorage, so i have added code to do it on the same thread, but I'm still expiring this.
Any thoughts or ideas will be much appreciated.
Thread 4 Crashed:
0 CoreFoundation 0x23363dc4 CFURLCopyAbsoluteURL + 60
1 CFNetwork 0x22e87039 HTTPCookieStorage::copyCookiesForURL(__CFURL const*, unsigned char) + 74
2 CFNetwork 0x22f65ed1 -[NSHTTPCookieStorage cookiesForURL:] + 90
3 CFNetwork 0x22eef4e1 -[__NSURLBackgroundSession requestWithCookiesApplied:] + 218
4 CFNetwork 0x22ef0505 -[__NSURLBackgroundSession _onqueue_uploadTaskForRequest:uploadFile:bodyData:completion:] + 126
5 CFNetwork 0x22ef03e5 __80-[__NSURLBackgroundSession uploadTaskForRequest:uploadFile:bodyData:completion:]_block_invoke + 38
6 CFNetwork 0x22eefadf __68-[__NSURLBackgroundSession performBlockOnQueueAndRethrowExceptions:]_block_invoke + 84
7 libdispatch.dylib 0x31577c6f _dispatch_client_callout + 20
8 libdispatch.dylib 0x31581559 _dispatch_barrier_sync_f_invoke + 46
9 CFNetwork 0x22eefa0f -[__NSURLBackgroundSession performBlockOnQueueAndRethrowExceptions:] + 208
10 CFNetwork 0x22ef0365 -[__NSURLBackgroundSession uploadTaskForRequest:uploadFile:bodyData:completion:] + 218
11 CFNetwork 0x22f497b7 -[NSURLSession uploadTaskWithRequest:fromFile:] + 32
12 Pogoplug 0x001a3ca5 __46-[CENetworkManager uploadRequest:finishBlock:]_block_invoke (CENetworkManager.m:377)
13 Foundation 0x2414abfd __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 6
14 Foundation 0x240b5ac5 -[NSBlockOperation main] + 146
15 Foundation 0x240a8505 -[__NSOperationInternal _start:] + 766
16 Foundation 0x2414d557 __NSOQSchedule_f + 184
17 libdispatch.dylib 0x315824d3 _dispatch_queue_drain$VARIANT$mp + 1460
18 libdispatch.dylib 0x31581da1 _dispatch_queue_invoke$VARIANT$mp + 82
19 libdispatch.dylib 0x31584491 _dispatch_root_queue_drain + 386
20 libdispatch.dylib 0x315858a3 _dispatch_worker_thread3 + 104
21 libsystem_pthread.dylib 0x316f8da9 _pthread_wqthread + 666
22 libsystem_pthread.dylib 0x316f8afc start_wqthread + 6
Finally found the cause after I managed to reproduce this issue while debugging, and its so silly on my part - its happening when url == nil for upload request.
Not sure why Apple allow to create NSURLMutableRequest with url == nil though, and not throwing exception in [NSMutableURLRequest requestWithURL:] method.
I would suggest check once with Instruments Tool, you will have a clear picture why and where exactly it is crashing.