Afnetworking: crash in SessionConnectionLoadable::_loaderClientEvent_DidReceiveConnectionCacheKey

Created on 20 May 2016  路  20Comments  路  Source: AFNetworking/AFNetworking

Hi, we are using AFNetworking 2.6.3 (NSURLSession API) and seeing a high number of the following crash in HockeyApp. No luck reproducing it locally, just getting lots of these crash logs from the users in the wild. Any advice will be appreciated. Thanks.

Here is the excerpt from the crash report:

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x400012eb40150
Crashed Thread:  10

Application Specific Information:
objc_msgSend() selector name: _didReceiveConnectionCacheKey:

Thread 10 Crashed:
1   libobjc.A.dylib objc_msgSend + 8
2   CFNetwork   SessionConnectionLoadable::_loaderClientEvent_DidReceiveConnectionCacheKey(HTTPConnectionCacheKey*) + 52
3   CFNetwork   ___ZN19URLConnectionLoader36protocolDidReceiveConnectionCacheKeyEP22HTTPConnectionCacheKey_block_invoke + 36
4   libdispatch.dylib   _dispatch_call_block_and_release + 20
5   libdispatch.dylib   _dispatch_client_callout + 12
6   libdispatch.dylib   _dispatch_queue_drain + 860
7   libdispatch.dylib   _dispatch_queue_invoke + 460
8   libdispatch.dylib   _dispatch_root_queue_drain + 724
9   libdispatch.dylib   _dispatch_worker_thread3 + 108
10  libsystem_pthread.dylib _pthread_wqthread + 1088
11  libsystem_pthread.dylib start_wqthread + 0
WWDC Followup stale

Most helpful comment

I confirm @xozyain fact. The crash is not happening in iOS 10 and we keep receiving it only from iOS 9 and below.

All 20 comments

I have same issue.

I have the same exact issue in AlamoFire.

I also found this
https://forums.developer.apple.com/message/131367#131367

Do you guys found out something about this?

I have tried to disable background fetches since it is the only other object in my app that uses the network

Just wanted to tell you that we are experiencing this issue with our application as well! And again we are using AFNetworking 1.3.0 (indirectly with ResKit)

The following is the stack trace. Hope this will help.
Crash due to signal: SIGSEGV(SEGV_MAPERR) at 1bf04beb8{ 0 libobjc.A.dylib 0x18f7941d0 objc_msgSend + 16 1 CFNetwork 0x18299d338 -[__NSCFLocalSessionBridge taskTerminating:] + 164 2 CFNetwork 0x18299b568 -[__NSCFLocalSessionBridge demuxv:args:] + 88 3 CFNetwork 0x18299bbf4 __64-[__NSCFLocalSessionBridge initWithConfiguration:session:queue:]_block_invoke + 72 4 CFNetwork 0x1829c3470 ___ZNK24ClassicConnectionSession28_connection_didFinishLoadingEP16_CFURLConnection_block_invoke + 140 5 libdispatch.dylib 0x18fd5c014 _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x18fd5bfd4 _dispatch_client_callout + 16 7 libdispatch.dylib 0x18fd624a8 _dispatch_queue_drain + 640 8 libdispatch.dylib 0x18fd5e4c0 _dispatch_queue_invoke + 68 9 libdispatch.dylib 0x18fd630f4 _dispatch_root_queue_drain + 104 10 libdispatch.dylib 0x18fd634fc _dispatch_worker_thread2 + 76 11 libsystem_pthread.dylib 0x18fef16bc _pthread_wqthread + 356 12 libsystem_pthread.dylib 0x18fef154c start_wqthread + 4 }

Number one crash on our side too, using 3.1.0 (latest to date).

I only experience this issue on iOS 9

@NikolajMosbaek actually it does! I assume that you mean it doesn't reproduce on iOS 10? because it does happen with iOS 8 for my users.
I haven't experienced this with my iOS 10 devices as well (fingers crossed!), but nothing is final until they release the last version AND it is deployed to enough users.

Hi, experiencing the same crash.
I am looking the custom logs from the crashes and can see that almost all of the times, if not all, might be getting from a thread started due to 'backgroundFetch' event or a geofencing event.

I think this has to do with Background Fetching. In the link added, one can see some things, specially in the section: Background Transfer Considerations

Do we have to use AF in a different way when the app is triggered from a backgroundFetch, not in foreground by user taping the app icon, for example?

Thanks

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/UsingNSURLSession.html

+1 to seeing this

has anyone verified that this is actually related to AFNetworking?

Since all of our users are on iOS 10 now - the issue is gone and we haven't experienced any additional crashes.
Thus I conclude it wasn't an AFN issue, but an Apple/iOS issue.

+1 anyone fix this issue? I encounter this bug crash in our user. They are iOS9.2 and iOS9.3.Tens of thousands of users affected. The crash log:

16 Thread
SIGSEGV
SEGV_ACCERR
0聽CFNetwork | SessionConnectionLoadable::_loaderClientEvent_asyncError(__CFString const, long)聽+聽80
-- | --
1聽CFNetwork | SessionConnectionLoadable::_loaderClientEvent_asyncError(__CFString const
, long)聽+聽72
2聽libdispatch.dylib | __dispatch_call_block_and_release聽+聽24
3聽libdispatch.dylib | __dispatch_client_callout聽+聽16
4聽libdispatch.dylib | __dispatch_queue_drain聽+聽864
5聽libdispatch.dylib | __dispatch_queue_invoke聽+聽464
6聽libdispatch.dylib | __dispatch_client_callout聽+聽16
7聽libdispatch.dylib | __dispatch_root_queue_drain聽+聽2140
8聽libdispatch.dylib | __dispatch_worker_thread3聽+聽112
9聽libsystem_pthread.dylib | _pthread_wqthread聽+聽1092

I confirm @xozyain fact. The crash is not happening in iOS 10 and we keep receiving it only from iOS 9 and below.

@alaeddineG me too

same for us too, still happend in iOS 9. Any solution?

Any progress?

This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This issue has been auto-closed because there hasn't been any activity for at least 21 days. However, we really appreciate your contribution, so thank you for that! 馃檹 Also, feel free to open a new issue if you still experience this problem 馃憤.

Was this page helpful?
0 / 5 - 0 ratings