@mouness2020, In situations like this a crash report snippet is not helpful, alas. I need a full Apple crash report to make any insight into such weird problems.
@swee153, Thanks for the crash report!
Looking in that, the immediate cause of the crash is the dereference of a bogus pointer:
Code Block Exception Type: EXC_BAD_ACCESS (SIGSEGV) |
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000abc1264a0 |
The value is
way off in the weeds:
Code Block VM Region Info: 0xabc1264a0 is not in any region. Bytes after previous region: 34830705825 Bytes before following region: 21540739936 |
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL |
MALLOC_NANO 280000000-2a0000000 [512.0M] rw-/rwx SM=PRV |
---> GAP OF 0xd20000000 BYTES |
commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=NUL ...(unallocated) |
Looking at the crashing thread we see this:
Code Block Thread 37 name: |
Thread 37 Crashed: |
0 libobjc.A.dylib … objc_release + 16 (objc-object.h:756) |
1 Foundation … NSKeyValuePopPendingNotificationLocal + 60 (NSKeyValueObserving.m:1078) |
2 Foundation … NSKeyValueDidChange + 356 (NSKeyValueObserving.m:533) |
3 Foundation … -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 624 (NSKeyValueObserving.m:2591) |
4 Foundation … -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 68 (NSKeyValueObserving.m:2606) |
5 Foundation … _NSSetLongLongValueAndNotify + 284 (NSKeyValueObserverNotifying.m:100) |
6 CFNetwork … 51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.194 + 60 (Session.mm:778) |
7 Foundation … NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16 (NSOperation.m:1544) |
objc_release, in frame 0, is unlikely to have any bugs so we need to look deeper in the stack. Frame 1 through 5 are standard Key-Value Observing (KVO) goo. Someone is changing a property whose value is being observed by someone else. And that leads is to frame 6. Note that this includes a file name and line number,
Session.mm:778. I looked that up and it’s very likely to be
NSURLSession setting the
state property on the task to
NSURLSessionTaskStateCompleted.
There are two potential reasons for that failing:
I recommend that you investigate the latter first (there
are plenty of bugs in KVO but there’s not much you can do about them)-: Do you you know who’s observing the
state property on your tasks?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"