Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.apple.NSURLSession-work EXC_BAD_ACCESS Crash debugging

I'm seeing the following crash report, but it's not reproducible. How would I go about debugging it? Is this an AFNetworking issue? I'm using version 2.4.1.

Crashed: com.apple.NSURLSession-work
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000000000000

Thread : Crashed: com.apple.NSURLSession-work
0  CoreFoundation                 0x0000000184aad978 CFDictionaryGetValue + 56
1  Foundation                     0x0000000185aa9300 _NSSetLongLongValueAndNotify + 72
2  Foundation                     0x0000000185aa9300 _NSSetLongLongValueAndNotify + 72
3  CFNetwork                      0x0000000184543468 -[__NSCFLocalSessionTask _task_onqueue_didFinish] + 472
4  CFNetwork                      0x0000000184544b38 -[__NSCFLocalSessionTask connection:didFinishLoadingWithError:] + 40
5  CFNetwork                      0x000000018458d030 __46-[__NSCFURLSessionConnection _task_sendFinish]_block_invoke + 136
6  libdispatch.dylib              0x0000000196a49994 _dispatch_call_block_and_release + 24
7  libdispatch.dylib              0x0000000196a49954 _dispatch_client_callout + 16
8  libdispatch.dylib              0x0000000196a540a4 _dispatch_queue_drain + 1448
9  libdispatch.dylib              0x0000000196a4ca5c _dispatch_queue_invoke + 132
10 libdispatch.dylib              0x0000000196a56318 _dispatch_root_queue_drain + 720
11 libdispatch.dylib              0x0000000196a57c4c _dispatch_worker_thread3 + 108
12 libsystem_pthread.dylib        0x0000000196c2922c _pthread_wqthread + 816
like image 848
soleil Avatar asked Sep 09 '15 23:09

soleil


People also ask

What is COM Apple Nsurlsession delegate?

A protocol that defines methods that URL session instances call on their delegates to handle session-level events, like session life cycle changes. iOS 7.0+ iPadOS 7.0+ macOS 10.9+ Mac Catalyst 13.1+ tvOS 9.0+ watchOS 2.0+

What is Exc_bad_access in Swift?

What does EXC_BAD_ACCESS mean? EXC_BAD_ACCESS is an exception raised as a result of accessing bad memory. We're constantly working with pointers to memory in Swift that link to a specific memory address. An application will crash whenever we try to access a pointer that is invalid or no longer exists.

What is Kern_invalid_address?

A memory leak occurs when memory is still allocated but nothing references it (or nothing references it usefully). A dangling pointer occurs when a pointer references memory that has been deallocated. EXC_BAD_ACCESS implies a dangling pointer, not the former. It could also imply an uninitialized pointer.


2 Answers

Yes, it's probably an AFNetworking bug (fixed in 2.5.0), in all likelihood. Specifically, this one:

https://github.com/AFNetworking/AFNetworking/issues/1477

If not, then it is probably something similar—a key-value observer trying to observe some aspect of a URL session task has been deallocated and didn't stop observing that task prior to being deallocated.

like image 114
dgatwood Avatar answered Oct 30 '22 02:10

dgatwood


I got the same issue and I found it is because I was using Firebase SDK and I upgraded it to 7.0.0,(Although this issue is reported by many developers from > 6.32.1 to 7.0.0) So the firebasePerformance is causing this issue in the first place, which later caused a crash while downloading images using SDWebImage. More information about this issue is here:

firebase/firebase-ios-sdk#6734

Firebase recently fixed this and released a new version for FirebasePerformance (7.0.1) After upgrading to version 7.0.1, I wasn't able to reproduce the crash any longer.

So upgrading of FirebasePerformance SDK to 7.0.1 version worked for me.

like image 45
Avneesh Agrawal Avatar answered Oct 30 '22 02:10

Avneesh Agrawal