Apple rejected my app due to crash, can't reproduce it - ios

I just uploaded an app to the appstore, it was developed for ios7.
They rejected the app because of a crash I can't reproduce...
They sent me this crash report:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x000000018e0501c8 objc_msgSend + 8
1 UIKit 0x000000018493e940 __97-[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:]_block_invoke718 + 52
2 UIKit 0x00000001846b6504 -[UIViewController _executeAfterAppearanceBlock] + 60
3 UIKit 0x00000001846b646c _applyBlockToCFArrayCopiedToStack + 352
4 UIKit 0x00000001846224c8 _afterCACommitHandler + 540
5 CoreFoundation 0x00000001816270a4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
6 CoreFoundation 0x000000018162432c __CFRunLoopDoObservers + 368
7 CoreFoundation 0x00000001816246b8 __CFRunLoopRun + 760
8 CoreFoundation 0x00000001815656cc CFRunLoopRunSpecific + 448
9 GraphicsServices 0x0000000187201c08 GSEventRunModal + 164
10 UIKit 0x0000000184696fd8 UIApplicationMain + 1152
11 brandnooz 0x00000001000aaa0c 0x100038000 + 469516
12 libdyld.dylib 0x000000018e633a9c start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x000000018e715aa8 kevent64 + 8
1 libdispatch.dylib 0x000000018e619998 _dispatch_mgr_thread + 48
Thread 2 name: AFNetworking
Thread 2:
0 libsystem_kernel.dylib 0x000000018e715ca0 mach_msg_trap + 8
1 CoreFoundation 0x0000000181626570 __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x0000000181624700 __CFRunLoopRun + 832
3 CoreFoundation 0x00000001815656cc CFRunLoopRunSpecific + 448
4 Foundation 0x00000001821012c0 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 292
5 Foundation 0x000000018215ed74 -[NSRunLoop(NSRunLoop) run] + 92
6 brandnooz 0x0000000100045280 0x100038000 + 53888
7 Foundation 0x00000001821e8408 __NSThread__main__ + 996
8 libsystem_pthread.dylib 0x000000018e7afe18 _pthread_body + 164
9 libsystem_pthread.dylib 0x000000018e7afd70 _pthread_start + 136
10 libsystem_pthread.dylib 0x000000018e7ad550 thread_start + 0
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x000000018e715ca0 mach_msg_trap + 8
1 CoreFoundation 0x0000000181626570 __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x0000000181624700 __CFRunLoopRun + 832
3 CoreFoundation 0x00000001815656cc CFRunLoopRunSpecific + 448
4 Foundation 0x000000018215a424 +[NSURLConnection(Loader) _resourceLoadLoop:] + 344
5 Foundation 0x00000001821e8408 __NSThread__main__ + 996
6 libsystem_pthread.dylib 0x000000018e7afe18 _pthread_body + 164
7 libsystem_pthread.dylib 0x000000018e7afd70 _pthread_start + 136
8 libsystem_pthread.dylib 0x000000018e7ad550 thread_start + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x000000018e72e76c __select + 8
1 libsystem_pthread.dylib 0x000000018e7afe18 _pthread_body + 164
2 libsystem_pthread.dylib 0x000000018e7afd70 _pthread_start + 136
3 libsystem_pthread.dylib 0x000000018e7ad550 thread_start + 0
Thread 5 name: Dispatch queue: com.apple.root.high-priority
Thread 5:
0 libsystem_kernel.dylib 0x000000018e72e394 __psynch_cvwait + 8
1 Foundation 0x00000001821cf8e0 -[__NSOperationInternal _waitUntilFinished:] + 100
2 brandnooz 0x0000000100083928 0x100038000 + 309544
3 brandnooz 0x00000001000cf3c0 0x100038000 + 619456
4 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
5 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
6 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
7 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
8 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
9 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 6 name: Dispatch queue: com.apple.root.default-priority
Thread 6:
0 libsystem_kernel.dylib 0x000000018e715cdc semaphore_wait_trap + 8
1 brandnooz 0x00000001000d8044 0x100038000 + 655428
2 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
3 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
4 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
5 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
6 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
7 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 7 name: Dispatch queue: com.apple.root.high-priority
Thread 7:
0 libsystem_kernel.dylib 0x000000018e72e394 __psynch_cvwait + 8
1 Foundation 0x00000001821cf8e0 -[__NSOperationInternal _waitUntilFinished:] + 100
2 brandnooz 0x0000000100083928 0x100038000 + 309544
3 brandnooz 0x00000001000cf3c0 0x100038000 + 619456
4 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
5 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
6 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
7 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
8 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
9 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 8 name: Dispatch queue: com.apple.root.default-priority
Thread 8:
0 libsystem_kernel.dylib 0x000000018e715cdc semaphore_wait_trap + 8
1 brandnooz 0x00000001000d8044 0x100038000 + 655428
2 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
3 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
4 libdispatch.dylib 0x000000018e61f2b4 _dispatch_root_queue_drain + 552
5 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
6 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
7 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 9 name: Dispatch queue: com.apple.network.helper_queue
Thread 9:
0 libsystem_kernel.dylib 0x000000018e715ca0 mach_msg_trap + 8
1 libdispatch.dylib 0x000000018e621648 _dispatch_mach_msg_send + 364
2 libdispatch.dylib 0x000000018e61a6d4 dispatch_mach_send + 216
3 libxpc.dylib 0x000000018e7c9814 xpc_connection_send_message_with_reply + 124
4 libsystem_network.dylib 0x000000018e77cfe0 __net_helper_send_block_invoke + 48
5 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
6 libdispatch.dylib 0x000000018e61dc80 _dispatch_barrier_sync_f_invoke + 44
7 libsystem_network.dylib 0x000000018e77ab84 net_helper_send + 212
8 libsystem_network.dylib 0x000000018e77bd4c net_helper_connection_start + 264
9 libsystem_network.dylib 0x000000018e778b78 tcp_connection_register_reachability + 164
10 libsystem_network.dylib 0x000000018e77775c __tcp_connection_start_block_invoke + 312
11 libdispatch.dylib 0x000000018e618010 _dispatch_call_block_and_release + 20
12 libdispatch.dylib 0x000000018e617fd0 _dispatch_client_callout + 12
13 libdispatch.dylib 0x000000018e61e4a4 _dispatch_queue_drain + 636
14 libdispatch.dylib 0x000000018e61a4bc _dispatch_queue_invoke + 64
15 libdispatch.dylib 0x000000018e61f0f0 _dispatch_root_queue_drain + 100
16 libdispatch.dylib 0x000000018e61f4f8 _dispatch_worker_thread2 + 72
17 libsystem_pthread.dylib 0x000000018e7ad6b8 _pthread_wqthread + 352
18 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 10:
0 libsystem_kernel.dylib 0x000000018e72ee74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018e7ad548 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000008 x1: 0x0000000184d29a89 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x000000018f24b4b8 x9: 0x0000000100183460 x10: 0x0000000150882c00 x11: 0x000000520000007f
x12: 0x0000000150883390 x13: 0x000001a500183465 x14: 0x0000000000000006 x15: 0x0000000000000000
x16: 0x000000018e0501c0 x17: 0x00000001846484ec x18: 0x0000000000000000 x19: 0x0000000170053500
x20: 0x000000018f287000 x21: 0x000000016fdc6b28 x22: 0x000000016fdc6b20 x23: 0x000000017012d3e0
x24: 0x000000017012d3f0 x25: 0x000000019157a098 x26: 0x000000016fdc6b20 x27: 0x000000016fdc6d00
x28: 0x0000000000000003 fp: 0x000000016fdc6af0 lr: 0x000000018493e944
sp: 0x000000016fdc6ae0 pc: 0x000000018e0501c8 cpsr: 0x20000000
Please help me to solve this issue. Thanks In Advance

You crashed inside objc_msgSend with an EXC_BAD_ACCESS exception. In my experience this probably means that an object has gone out of scope and you're trying to access it or, the object is supposed to do something on another thread and in the mean time (while it's doing that), its gone out of scope on the original thread.
If you're using one of Apple's multithreaded objects (pretty much anything with delegate callbacks), make sure it is retained (strong-ly) by the object in which it is contained. For example if you're using an object with asynchronous callbacks, you can't just instantiate it inside a method and then let it disappear, you have to make it a strong #property so it remains in scope even when the method returns and you are awaiting the callbacks.
EDIT (Based on CFSocket thread):
By the look of it, you're using a socket API which is commonly used with the NSStream class. Remember to create strong #properties for those NSStream objects (or other connection objects you are using), and, if you're wrapping them inside another object, make sure that it is a strong #property of whichever object is using it. You can't get an asynchronous callback from an object that's not there anymore on the thread that created it.
(Note this is not just a case of messaging an object that has been set to nil. Messages to nil do not crash, they just return nil. The issue is a message being sent to something in memory that you don't own anymore).
EDIT 2 (based on main thread):
Are you sure you own every object that is being used in the View Controller transition? Creating a transient object in a block or asynchronous action could also be causing the EXC_BAD_ACCESS.

From what it looks like, may be two threads are accessing the same variables where one of the threads is corrupting the variables used in the other. It is a synchronization issue. Bad access mostly means you are accessing a variable that is nil
You can integrate a crash reporting tool like www.crashlytics.com in your application. It is very easy to implement and the documentation is available once you download the sdk.
After implementation, test your app throughly and it will tell you the exact lines where your code crashes and you can resolve it.

Related

NO_CRASH_STACK + 0 [Xcode 10.1] Crash

Im experiencing an error in my app affecting almost 80% of my active users.
It seems it has something to do with the thread
`com.twitter.crashlytics.ios.MachExceptionServer`
but I haven't been able to track it down, the worst thing of all is that I don't even know when this crash occurs, my guess is that it happens when the app is launching in the DidFinishLaunchingWithOptions method. :/
Hope you can help me out, I am new to this crash tracking thing.
Here is the crash log.
Incident Identifier: F627A1C2-A28A-4200-8920-1F77D3C0855C
CrashReporter Key: 88dbf413f263228712a90868f4c08e9d59a715f8
Hardware Model: iPhone10,4
Process: <APP_NAME> [1285]
Path: /private/var/containers/Bundle/Application/XXXXXXXXXXXXXXXXX/<APP_NAME>.app/<APP_NAME>
Identifier: xxx.xxxxxxxx.<APP_NAME>
Version: 34 (4.0.0)
AppStoreTools: 10B63
AppVariant: 1:iPhone10,4:12
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Coalition: xxx.xxxxxx.xxxxxx [677]
Date/Time: 2018-12-16 16:41:34.1689 -0600
Launch Time: 2018-12-16 15:52:00.9225 -0600
OS Version: iPhone OS 12.1 (16B92)
Baseband Version: 2.01.07
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000f262e3bc0
VM Region Info: 0xf262e3bc0 is not in any region. Bytes after previous region: 53790784449
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_NANO 0000000280000000-00000002a0000000 [512.0M] rw-/rwx SM=PRV
--->
UNUSED SPACE AT END
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [1285]
Triggered by Thread: 10
Thread 0 name:
Thread 0:
0 libsystem_kernel.dylib 0x0000000203c3bed0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000203c3b3a8 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000020403fbc4 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3 CoreFoundation 0x000000020403aa60 __CFRunLoopRun + 1396 (CFRunLoop.c:2971)
4 CoreFoundation 0x000000020403a1cc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5 GraphicsServices 0x00000002062b1584 GSEventRunModal + 100 (GSEvent.c:2245)
6 UIKitCore 0x000000023127d054 UIApplicationMain + 212 (UIApplication.m:4347)
7 <APP_NAME> 0x0000000104ae4548 main + 17736 (AppDelegate.swift:22)
8 libdyld.dylib 0x0000000203afabb4 start + 4
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x0000000203c3bed0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000203c3b3a8 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000020403fbc4 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3 CoreFoundation 0x000000020403aa60 __CFRunLoopRun + 1396 (CFRunLoop.c:2971)
4 CoreFoundation 0x000000020403a1cc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5 Foundation 0x0000000204a2f404 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300 (NSRunLoop.m:367)
6 Foundation 0x0000000204a2f2b0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 148 (NSRunLoop.m:411)
7 UIKitCore 0x000000023136a808 -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:603)
8 Foundation 0x0000000204b621ac __NSThread__start__ + 1040 (NSThread.m:1175)
9 libsystem_pthread.dylib 0x0000000203ccb2ac _pthread_body + 128 (pthread.c:857)
10 libsystem_pthread.dylib 0x0000000203ccb20c _pthread_start + 48 (pthread.c:884)
11 libsystem_pthread.dylib 0x0000000203ccecf4 thread_start + 4
Thread 2 name: com.twitter.crashlytics.ios.MachExceptionServer
Thread 2:
0 libsystem_kernel.dylib 0x0000000203c3bed0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000203c3b3a8 mach_msg + 72
2 <APP_NAME> 0x0000000104f0c490 CLSMachExceptionServer + 952
3 libsystem_pthread.dylib 0x0000000203ccb2ac _pthread_body + 128
4 libsystem_pthread.dylib 0x0000000203ccb20c _pthread_start + 48
5 libsystem_pthread.dylib 0x0000000203ccecf4 thread_start + 4
Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x0000000203c3bed0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000203c3b3a8 mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000020403fbc4 __CFRunLoopServiceMachPort + 236 (CFRunLoop.c:2615)
3 CoreFoundation 0x000000020403aa60 __CFRunLoopRun + 1396 (CFRunLoop.c:2971)
4 CoreFoundation 0x000000020403a1cc CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
5 CFNetwork 0x000000020465b834 -[__CoreSchedulingSetRunnable runForever] + 212 (CoreSchedulingSet.mm:1365)
6 Foundation 0x0000000204b621ac __NSThread__start__ + 1040 (NSThread.m:1175)
7 libsystem_pthread.dylib 0x0000000203ccb2ac _pthread_body + 128 (pthread.c:857)
8 libsystem_pthread.dylib 0x0000000203ccb20c _pthread_start + 48 (pthread.c:884)
9 libsystem_pthread.dylib 0x0000000203ccecf4 thread_start + 4
Thread 4:
0 libsystem_pthread.dylib 0x0000000203ccece8 start_wqthread + 0
Thread 5:
0 libsystem_pthread.dylib 0x0000000203ccece8 start_wqthread + 0
Thread 6:
0 libsystem_pthread.dylib 0x0000000203ccece8 start_wqthread + 0
Thread 7:
0 libsystem_pthread.dylib 0x0000000203ccece8 start_wqthread + 0
Thread 8 name:
Thread 8:
0 libsystem_malloc.dylib 0x0000000203c80c74 nanov2_allocate_from_block$VARIANT$armv81 + 220
1 libsystem_malloc.dylib 0x0000000203c80040 nanov2_allocate$VARIANT$armv81 + 140
2 libsystem_malloc.dylib 0x0000000203c80040 nanov2_allocate$VARIANT$armv81 + 140
3 libsystem_malloc.dylib 0x0000000203c80540 nanov2_calloc$VARIANT$armv81 + 136
4 libsystem_malloc.dylib 0x0000000203c8db74 malloc_zone_calloc + 140 (malloc.c:1475)
5 libsystem_malloc.dylib 0x0000000203c8e3fc calloc + 40 (malloc.c:1731)
6 libobjc.A.dylib 0x0000000203290554 class_createInstance + 72 (objc-runtime-new.mm:0)
7 libdispatch.dylib 0x0000000203ae9ad8 _os_object_alloc_realized + 40 (object.m:55)
8 libdispatch.dylib 0x0000000203ae3af4 dispatch_data_create_concat$VARIANT$armv81 + 164 (data.c:118)
9 CFNetwork 0x00000002048b8ffc invocation function for block in ConnectionProtocolReadInner(nw_protocol*, unsigned int, unsigned int, bool, long long, void (dispatch_data_s*, CFStreamError) block_pointer, void (nw_frame_array_s*, CFStreamError) block_pointer) + 152 (ConnectionProtocol.cpp:771)
10 libnetwork.dylib 0x00000002050d3474 nw_frame_array_foreach + 48 (frame_internal.h:999)
11 CFNetwork 0x00000002048b64ac ConnectionProtocolReadInner(nw_protocol*, unsigned int, unsigned int, bool, long long, void (dispatch_data_s*, CFStreamError) block_pointer, void (nw_frame_array_s*, CFStreamError) block_pointer) + 408 (ConnectionProtocol.cpp:755)
12 CFNetwork 0x00000002048b6264 ConnectionProtocolServiceReads(nw_protocol*) + 380 (ConnectionProtocol.cpp:658)
13 CFNetwork 0x00000002048b7270 ConnectionProtocolInputAvailable(nw_protocol*, nw_protocol*) + 64 (ConnectionProtocol.cpp:964)
14 libboringssl.dylib 0x0000000204f34ac8 nw_boringssl_read + 532 (protocol_boringssl.m:1177)
15 libboringssl.dylib 0x0000000204f362a4 nw_protocol_boringssl_input_available + 120 (protocol_boringssl.m:1218)
16 libusrtcp.dylib 0x00000002053d8e9c nw_protocol_tcp_wake_read + 484 (protocol_tcp.c:269)
17 libusrtcp.dylib 0x00000002053c9774 nw_protocol_tcp_input_flush + 100 (user_north.c:40)
18 libnetwork.dylib 0x0000000205167474 nw_channel_add_input_frames + 4184 (channel.c:1096)
19 libnetwork.dylib 0x00000002051663b8 nw_channel_update_input_source + 136 (channel.c:1138)
20 libnetwork.dylib 0x0000000205165c08 __nw_channel_create_block_invoke.21 + 52 (channel.c:1960)
21 libdispatch.dylib 0x0000000203aea484 _dispatch_client_callout + 16 (object.m:511)
22 libdispatch.dylib 0x0000000203ac0e14 _dispatch_continuation_pop$VARIANT$armv81 + 404 (inline_internal.h:2441)
23 libdispatch.dylib 0x0000000203ad0ab4 _dispatch_source_invoke$VARIANT$armv81 + 1704 (source.c:568)
24 libdispatch.dylib 0x0000000203ac6d70 _dispatch_workloop_invoke$VARIANT$armv81 + 1892 (inline_internal.h:2482)
25 libdispatch.dylib 0x0000000203acdf14 _dispatch_workloop_worker_thread + 584 (queue.c:5889)
26 libsystem_pthread.dylib 0x0000000203ccc0dc _pthread_wqthread + 312 (pthread.c:2363)
27 libsystem_pthread.dylib 0x0000000203ccecec start_wqthread + 4
Thread 9:
0 libsystem_pthread.dylib 0x0000000203ccece8 start_wqthread + 0
Thread 10 name:
Thread 10 Crashed:
0 libobjc.A.dylib 0x0000000203298d70 objc_msgSend + 16
1 CoreData 0x0000000206c17754 -[_PFArray dealloc] + 100 (_PFArray.m:379)
2 libobjc.A.dylib 0x000000020329b38c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 676 (NSObject.mm:1605)
3 libdispatch.dylib 0x0000000203aea464 _dispatch_last_resort_autorelease_pool_pop + 40 (object.m:488)
4 libdispatch.dylib 0x0000000203accddc _dispatch_root_queue_drain + 1080 (queue.c:6049)
5 libdispatch.dylib 0x0000000203acd35c _dispatch_worker_thread2 + 116 (queue.c:6072)
6 libsystem_pthread.dylib 0x0000000203ccc17c _pthread_wqthread + 472 (pthread.c:2353)
7 libsystem_pthread.dylib 0x0000000203ccecec start_wqthread + 4
Thread 11:
0 libsystem_pthread.dylib 0x0000000203ccece8 start_wqthread + 0
Thread 10 crashed with ARM Thread State (64-bit):
x0: 0x0000000280283bb0 x1: 0x00000002317c19b4 x2: 0x0000000000000001 x3: 0x0000000203c8019c
x4: 0x000000014a514400 x5: 0x0000000000000012 x6: 0x000000023b9c4000 x7: 0x000000016b77e538
x8: 0x0000000281685080 x9: 0x0000000000000000 x10: 0x0000000148860a00 x11: 0x0000002f0000003f
x12: 0x0000000148860d40 x13: 0x0000a69f262e3bb0 x14: 0x000000000000004c x15: 0x0000000080000000
x16: 0x0000000f262e3bb0 x17: 0x0000000206c0f138 x18: 0x0000000000000000 x19: 0x0000000282fc8b70
x20: 0x00000002317c19b4 x21: 0x000000000000000c x22: 0x0000000000000020 x23: 0x0000000000000015
x24: 0x0000000000000010 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x000000016b77f0e0 fp: 0x000000016b77ea80 lr: 0x0000000206c17754
sp: 0x000000016b77ea40 pc: 0x0000000203298d70 cpsr: 0x20000000
AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
GeoBasedManager.instance.setCountry()
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
NotificationManager.shared.retrievePushNotifications()
FirebaseApp.configure()
SwiftDate.defaultRegion = Region.local
DropDown.startListeningToKeyboard()
return true
The thread com.twitter.crashlytics.ios.MachExceptionServer is a part of the Crashlytics reporting machinery. It is present in every report that Crashlytics generates, and is not related to your issue.
From your report, that Triggered by Thread: 10 indicates which thread is at fault. From that, we can see that you've got what looks like a classic over-release.
Thread 10 name:
Thread 10 Crashed:
0 libobjc.A.dylib 0x0000000203298d70 objc_msgSend + 16
1 CoreData 0x0000000206c17754 -[_PFArray dealloc] + 100 (_PFArray.m:379)
2 libobjc.A.dylib 0x000000020329b38c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 676 (NSObject.mm:1605)
3 libdispatch.dylib 0x0000000203aea464 _dispatch_last_resort_autorelease_pool_pop + 40 (object.m:488)
4 libdispatch.dylib 0x0000000203accddc _dispatch_root_queue_drain + 1080 (queue.c:6049)
5 libdispatch.dylib 0x0000000203acd35c _dispatch_worker_thread2 + 116 (queue.c:6072)
6 libsystem_pthread.dylib 0x0000000203ccc17c _pthread_wqthread + 472 (pthread.c:2353)
7 libsystem_pthread.dylib 0x0000000203ccecec start_wqthread + 4
From frame 2 and 3, you can see that the system is cleaning up auto-released objects, from what looks like an internal dispatch queue. In there is an object that has already been deallocated, but is now being released again.
This kinds of bugs can manifest themselves in a variety of different-looking crashes. They can be hard to debug. As you are seeing, it is very hard to determine where the actual over-release occurred. Fortunately, Apple provides a few tools that can help. Check out the Zombies feature of Instruments. Good luck!

Xamarin iOS Crash with Twilio Client

I have a crash in a Xamarin app that is using the Twilio Client Component. I use the "Getting Started" code to make a simple app that makes a phone call out when I click a button. From the crash log I see a reference to "CRASHING_DUE_TO_PRIVACY_VIOLATION" in the call stack. I don't know what that could be as I have "Audio and Airplay" and "Voice over IP" check in background modes in my apps plist file.
The odd thing in in simulator it works perfect, the crash only occurs when I run the app on the iPhone. My phone is running ios 10.2. I am including the code and the crash log. Please help as this crash occurs exactly the same way in an app I am building for work so I really need to solve it and I am at my wits end.
using System;
using UIKit;
using Foundation;
using TwilioClient.iOS;
namespace twiliotest
{
public partial class ViewController : UIViewController
{
TCDevice _device;
TCConnection _connection;
protected ViewController(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
string sLink = "https://www.myserver.com/captok.php";
var url = new NSUrl(sLink);
var data = NSData.FromUrl(url);
var token = data.ToString();
// Create a new TCDevice object passing in the token.
_device = new TCDevice(token, null);
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
}
partial void ButtonCall_TouchUpInside(UIButton sender)
{
if (_connection == null || _connection.State == TCConnectionState.Disconnected)
{
var param = new TCConnectionParameters
{
From = "12125551234",
To = "12125554321"
};
_connection = _device.Connect(param, null);
}
else {
_connection.Disconnect();
}
}
void SetupDeviceEvents()
{
if (_device != null)
{
_device.ReceivedIncomingConnection += (sender, e) =>
{
_connection = e.Connection;
_connection.Accept();
};
}
}
}
}
Here is the crash log. Note the crash is in thread 7.
Incident Identifier: FA61C36F-110A-44DF-A862-FD7C37859D8E
CrashReporter Key: dc2811c1cf8685a6f8963c39740ec1af0fb4e080
Hardware Model: iPhone7,2
Process: twiliotest [7846]
Path: /private/var/containers/Bundle/Application/412D52E2-9ECB-4C01-B984-AB2820FBBFB0/twiliotest.app/twiliotest
Identifier: com.davidkbowers.twiliotest
Version: 1.0 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.davidkbowers.twiliotest [1855]
Date/Time: 2017-01-04 18:50:06.7079 -0500
Launch Time: 2017-01-04 18:50:00.8968 -0500
OS Version: iPhone OS 10.2 (14C92)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 7
Application Specific Information:
abort() called
Filtered syslog:
None found
Thread 0 name: tid_403 Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x00000001822c5188 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001822c4ff8 mach_msg + 72
2 CoreFoundation 0x00000001832c25d0 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x00000001832c01ec __CFRunLoopRun + 1132
4 CoreFoundation 0x00000001831ee2b8 CFRunLoopRunSpecific + 444
5 GraphicsServices 0x0000000184ca2198 GSEventRunModal + 180
6 UIKit 0x00000001892357fc -[UIApplication _run] + 684
7 UIKit 0x0000000189230534 UIApplicationMain + 208
8 twiliotest 0x000000010047cd04 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (/<unknown>:1)
9 twiliotest 0x0000000100462a9c UIKit_UIApplication_Main_string___intptr_intptr (UIApplication.cs:79)
10 twiliotest 0x0000000100462a5c UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
11 twiliotest 0x0000000100438e04 twiliotest_Application_Main_string__ (Main.cs:12)
12 twiliotest 0x000000010059bb64 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
13 twiliotest 0x000000010032ee28 mono_jit_runtime_invoke (mini-runtime.c:2524)
14 twiliotest 0x000000010039d1e8 do_runtime_invoke (object.c:2809)
15 twiliotest 0x000000010039f7cc mono_runtime_exec_main (object.c:4585)
16 twiliotest 0x000000010039f3e8 mono_runtime_run_main (object.c:4134)
17 twiliotest 0x0000000100314050 mono_jit_exec (driver.g.c:1048)
18 twiliotest 0x0000000100438bd0 xamarin_main (monotouch-main.m:487)
19 twiliotest 0x00000001005ec148 main (main.arm64.m:45)
20 libdyld.dylib 0x00000001821d15b8 start + 4
Thread 1:
0 libsystem_kernel.dylib 0x00000001822e3a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x00000001823a7344 _pthread_wqthread + 1452
2 libsystem_pthread.dylib 0x00000001823a6d8c start_wqthread + 4
Thread 2:
0 libsystem_pthread.dylib 0x00000001823a6d88 start_wqthread + 0
Thread 3 name: Dispatch queue: com.twilio.TCCommandHandler.commandQ
Thread 3:
0 libsystem_kernel.dylib 0x00000001822c5188 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001822c4ff8 mach_msg + 72
2 AudioToolbox 0x0000000186313c90 AUIOClient_Initialize + 228
3 AudioToolbox 0x00000001861a1864 AURemoteIO::Initialize() + 1328
4 AudioToolbox 0x000000018649c3b0 AUBase::DoInitialize() + 48
5 AudioToolbox 0x00000001864a4888 AUMethodInitialize(void*) + 76
6 twiliotest 0x00000001002251d8 create_audio_unit (coreaudio_dev.m:1507)
7 twiliotest 0x0000000100224c7c ca_factory_create_stream (coreaudio_dev.m:1599)
8 twiliotest 0x0000000100233d4c twilio_pjmedia_aud_stream_create (audiodev.c:790)
9 twiliotest 0x00000001002319d4 twilio_pjmedia_snd_port_create2 (sound_port.c:261)
10 twiliotest 0x0000000100241cec open_snd_dev (pjsua_aud.c:1715)
11 twiliotest 0x00000001002422d8 twilio_pjsua_set_snd_dev (pjsua_aud.c:1974)
12 twiliotest 0x0000000100213998 twilio_pjsua_call_make_call (pjsua_call.c:645)
13 twiliotest 0x00000001001f7090 -[TCCall makeCall] (TCCall.m:51)
14 twiliotest 0x00000001001e04a4 -[TCMakeCallCommand run] (TCCommands.m:215)
15 libdispatch.dylib 0x000000018219e1fc _dispatch_call_block_and_release + 24
16 libdispatch.dylib 0x000000018219e1bc _dispatch_client_callout + 16
17 libdispatch.dylib 0x00000001821ac3dc _dispatch_queue_serial_drain + 928
18 libdispatch.dylib 0x00000001821a19a4 _dispatch_queue_invoke + 652
19 libdispatch.dylib 0x00000001821ac8d8 _dispatch_queue_override_invoke + 360
20 libdispatch.dylib 0x00000001821ae34c _dispatch_root_queue_drain + 572
21 libdispatch.dylib 0x00000001821ae0ac _dispatch_worker_thread3 + 124
22 libsystem_pthread.dylib 0x00000001823a72a0 _pthread_wqthread + 1288
23 libsystem_pthread.dylib 0x00000001823a6d8c start_wqthread + 4
Thread 4 name: SGen worker
Thread 4:
0 libsystem_kernel.dylib 0x00000001822e2e1c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x00000001823a89c0 _pthread_cond_wait + 640
2 twiliotest 0x00000001003fa544 thread_func (mono-os-mutex.h:108)
3 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
4 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
5 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 5 name: Finalizer
Thread 5:
0 libsystem_kernel.dylib 0x00000001822c51c4 semaphore_wait_trap + 8
1 twiliotest 0x00000001003613f8 finalizer_thread (mono-os-semaphore.h:73)
2 twiliotest 0x00000001003ce664 start_wrapper (threads.c:740)
3 twiliotest 0x000000010041efbc inner_start_thread (mono-threads-posix.c:92)
4 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
5 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
6 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 6 name: com.apple.uikit.eventfetch-thread
Thread 6:
0 libsystem_kernel.dylib 0x00000001822c5188 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001822c4ff8 mach_msg + 72
2 CoreFoundation 0x00000001832c25d0 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x00000001832c01ec __CFRunLoopRun + 1132
4 CoreFoundation 0x00000001831ee2b8 CFRunLoopRunSpecific + 444
5 Foundation 0x0000000183d2b26c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x0000000183d4bdd0 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7 UIKit 0x0000000189ba9c38 -[UIEventFetcher threadMain] + 136
8 Foundation 0x0000000183e28e68 __NSThread__start__ + 1024
9 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
10 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
11 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 7 name: Dispatch queue: com.apple.root.default-qos
Thread 7 Crashed:
0 libsystem_kernel.dylib 0x00000001822e3014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001823ab450 pthread_kill + 112
2 libsystem_c.dylib 0x0000000182257400 abort + 140
3 twiliotest 0x0000000100320aa0 mono_handle_native_sigsegv (mini-exceptions.c:2420)
4 libsystem_platform.dylib 0x00000001823a5348 _sigtramp + 52
5 libsystem_kernel.dylib 0x00000001822de49c abort_with_payload_wrapper_internal + 100
6 libsystem_kernel.dylib 0x00000001822de4c8 system_set_sfi_window + 0
7 TCC 0x0000000185552328 __TCCAccessRequest_block_invoke_2.80 + 0
8 TCC 0x0000000185552224 __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 0
9 TCC 0x0000000185555330 __tccd_send_block_invoke + 348
10 libxpc.dylib 0x00000001823e6fcc _xpc_connection_reply_callout + 80
11 libxpc.dylib 0x00000001823e6f3c _xpc_connection_call_reply + 40
12 libdispatch.dylib 0x000000018219e1bc _dispatch_client_callout + 16
13 libdispatch.dylib 0x00000001821aca4c _dispatch_queue_override_invoke + 732
14 libdispatch.dylib 0x00000001821ae34c _dispatch_root_queue_drain + 572
15 libdispatch.dylib 0x00000001821ae0ac _dispatch_worker_thread3 + 124
16 libsystem_pthread.dylib 0x00000001823a72a0 _pthread_wqthread + 1288
17 libsystem_pthread.dylib 0x00000001823a6d8c start_wqthread + 4
Thread 8 name: com.apple.NSURLConnectionLoader
Thread 8:
0 libsystem_kernel.dylib 0x00000001822c5188 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001822c4ff8 mach_msg + 72
2 CoreFoundation 0x00000001832c25d0 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x00000001832c01ec __CFRunLoopRun + 1132
4 CoreFoundation 0x00000001831ee2b8 CFRunLoopRunSpecific + 444
5 CFNetwork 0x00000001839f38f0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 336
6 Foundation 0x0000000183e28e68 __NSThread__start__ + 1024
7 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
8 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
9 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 9:
0 libsystem_kernel.dylib 0x00000001822e3314 __semwait_signal + 8
1 libsystem_c.dylib 0x000000018220125c nanosleep + 212
2 libsystem_c.dylib 0x000000018220117c usleep + 64
3 twiliotest 0x000000010021b694 twilio_pj_thread_sleep (os_core_unix.c:780)
4 twiliotest 0x00000001002902f8 twilio_pj_ioqueue_poll (ioqueue_select.c:862)
5 twiliotest 0x000000010028d608 worker_proc (endpoint.c:332)
6 twiliotest 0x000000010021b4b0 thread_main (os_core_unix.c:531)
7 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
8 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
9 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 10:
0 libsystem_kernel.dylib 0x00000001822e323c __select + 8
1 twiliotest 0x000000010024ead4 twilio_pj_sock_select (sock_select.c:110)
2 twiliotest 0x0000000100290044 twilio_pj_ioqueue_poll (ioqueue_select.c:882)
3 twiliotest 0x000000010027d98c twilio_pjsip_endpt_handle_events2 (sip_endpoint.c:741)
4 twiliotest 0x0000000100221f64 twilio_pjsua_handle_events (pjsua_core.c:1837)
5 twiliotest 0x0000000100221a98 worker_thread (pjsua_core.c:695)
6 twiliotest 0x000000010021b4b0 thread_main (os_core_unix.c:531)
7 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
8 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
9 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 11 name: AVAudioSession Notify Thread
Thread 11:
0 libsystem_kernel.dylib 0x00000001822c5188 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001822c4ff8 mach_msg + 72
2 CoreFoundation 0x00000001832c25d0 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x00000001832c01ec __CFRunLoopRun + 1132
4 CoreFoundation 0x00000001831ee2b8 CFRunLoopRunSpecific + 444
5 AVFAudio 0x000000019ce83d24 GenericRunLoopThread::Entry(void*) + 164
6 AVFAudio 0x000000019cea9d9c CAPThread::Entry(CAPThread*) + 84
7 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
8 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
9 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 12:
0 libsystem_kernel.dylib 0x00000001822c51dc semaphore_timedwait_trap + 8
1 libdispatch.dylib 0x00000001821b0770 _dispatch_semaphore_wait_slow + 112
2 libdispatch.dylib 0x00000001821af808 _dispatch_worker_thread + 268
3 libsystem_pthread.dylib 0x00000001823a9850 _pthread_body + 240
4 libsystem_pthread.dylib 0x00000001823a9760 _pthread_body + 0
5 libsystem_pthread.dylib 0x00000001823a6d94 thread_start + 4
Thread 13:
0 libsystem_pthread.dylib 0x00000001823a6d88 start_wqthread + 0
Thread 7 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x000000015be197a0
x4: 0x000000000000001b x5: 0x000000016e359b00 x6: 0x0000000000000034 x7: 0xffffffffffffffec
x8: 0x000000000c000000 x9: 0x0000000004000000 x10: 0x0000000000003dd5 x11: 0x00000001ab196da3
x12: 0x00000001ab196da3 x13: 0x0000000000000018 x14: 0x0000000000000001 x15: 0x0000000000000881
x16: 0x0000000000000148 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x000000016e35b000 x21: 0x000000010062d6b7 x22: 0x000000010062d77e x23: 0xc698a6e613ac0034
x24: 0x000000016e359ee8 x25: 0x000000010062d731 x26: 0x000000015c8c0e78 x27: 0x0000000000000004
x28: 0xffffffffffffffff fp: 0x000000016e359e80 lr: 0x00000001823ab450
sp: 0x000000016e359e60 pc: 0x00000001822e3014 cpsr: 0x00000000
Binary Images:
0x1000fc000 - 0x1006ebfff twiliotest arm64 <24d1aa9aa95d3911b2709a7a36f9a785> /var/containers/Bundle/Application/412D52E2-9ECB-4C01-B984-AB2820FBBFB0/twiliotest.app/twiliotest
0x100898000 - 0x1008c7fff dyld arm64 /usr/lib/dyld
Remainder deleted due to space considerations...
EOF
Please let me know if there is anything else I need to post. Thank you in advance for your help.
Dave
Be sure you are using the latest iOS voice SDK 2.0 https://www.twilio.com/docs/api/voice-sdk/ios. The Xamarin component you are using might be based on deprecated version (Twilio iOS Client SDK). The new version is Programmable Voice iOS SDK which does support iOS 10.
Details in the changelog.
Apps targeting iOS 10+ will crash if the required permissions string is missing.
In the case of Twilio, it needs access to the phone's microphone, so your app will need to ask the user for microphone usage permission.
You can do this by editing the Info.plist file of your app. Add this code <key>NSMicrophoneUsageDescription</key>
<string>My app needs to use the microphone.</string> within the <dict> ... </dict> section.
See iOS 10 - Changes in asking permissions of Camera, microphone and Photo Library causing application to crash and https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html for more details.

Apple Crash log not able to replicate issue

We have been trying to submit an app with Apple for the last month and it keeps coming back rejected for small reasons. We are completely stuck with this last response and have no idea how to proceed.
They said the app crashed when creating a profile on our app. The problem is we thoroughly tested this on 4 different devices (iPhone 5, iPhone5S, iPhone 6S, iPad Air) and it works flawlessly for us.
They provided us a crash log but after hours of reading it and Googling we are coming up dry. Any help understanding what this crash log means will be a greatly appreciated.
Incident Identifier: 1985D6ED-9ED1-428D-9E27-41DBFD053205
CrashReporter Key: 7623e816ce9df811618c4e9b022a6c8f3c98bddb
Hardware Model: xxx
Process: fitDEGREE [784]
Path: /private/var/mobile/Containers/Bundle/Application/706E0CE8-B30F-4F30-B1B4-BEFE5F3FC51A/fitDEGREE.app/fitDEGREE
Identifier: com.FitDegree.fitDEGREE
Version: 3 (1.0.1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2016-02-02 12:11:39.39 -0800
Launch Time: 2016-02-02 12:07:56.56 -0800
OS Version: iOS 9.2.1 (13D15)
Report Version: 105
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x1832cd900 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x18293bf80 objc_exception_throw + 56
2 CoreFoundation 0x1831bc1a8 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 324
3 CoreFoundation 0x1831bc040 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 64
4 fitDEGREE 0x1000b7964 0x10006c000 + 309604
5 fitDEGREE 0x10014f4b4 0x10006c000 + 930996
6 fitDEGREE 0x100127a94 0x10006c000 + 768660
7 fitDEGREE 0x10014efec 0x10006c000 + 929772
8 libdispatch.dylib 0x182d21630 _dispatch_call_block_and_release + 24
9 libdispatch.dylib 0x182d215f0 _dispatch_client_callout + 16
10 libdispatch.dylib 0x182d26cf8 _dispatch_main_queue_callback_4CF + 1844
11 CoreFoundation 0x183284bb0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
12 CoreFoundation 0x183282a18 __CFRunLoopRun + 1628
13 CoreFoundation 0x1831b1680 CFRunLoopRunSpecific + 384
14 GraphicsServices 0x1846c0088 GSEventRunModal + 180
15 UIKit 0x188028d90 UIApplicationMain + 204
16 fitDEGREE 0x1000fe758 0x10006c000 + 599896
17 libdyld.dylib 0x182d528b8 start + 4
Global Trace Buffer (reverse chronological seconds):
0.099409 CFNetwork 0x0000000183948708 TCP Conn 0x158cf1640 started
0.293100 CFNetwork 0x0000000183947104 TCP Conn 0x158b19340 complete. fd: 22, err: 0
0.293568 CFNetwork 0x0000000183948630 TCP Conn 0x158b19340 event 1. err: 0
0.377927 CFNetwork 0x0000000183948708 TCP Conn 0x158b19340 started
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000182e70140 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000182f38ef8 pthread_kill + 112
2 libsystem_c.dylib 0x0000000182de1dac abort + 140
3 libc++abi.dylib 0x00000001829153f4 __cxa_bad_cast + 0
4 libc++abi.dylib 0x0000000182931e98 default_unexpected_handler() + 0
5 libobjc.A.dylib 0x000000018293c248 _objc_terminate() + 124
6 libc++abi.dylib 0x000000018292ef44 std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x000000018292e85c __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8 libobjc.A.dylib 0x000000018293c094 _objc_exception_destructor(void*) + 0
9 CoreFoundation 0x00000001831bc1a8 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 324
10 CoreFoundation 0x00000001831bc040 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 64
11 fitDEGREE 0x00000001000b7964 0x10006c000 + 309604
12 fitDEGREE 0x000000010014f4b4 0x10006c000 + 930996
13 fitDEGREE 0x0000000100127a94 0x10006c000 + 768660
14 fitDEGREE 0x000000010014efec 0x10006c000 + 929772
15 libdispatch.dylib 0x0000000182d21630 _dispatch_call_block_and_release + 24
16 libdispatch.dylib 0x0000000182d215f0 _dispatch_client_callout + 16
17 libdispatch.dylib 0x0000000182d26cf8 _dispatch_main_queue_callback_4CF + 1844
18 CoreFoundation 0x0000000183284bb0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
19 CoreFoundation 0x0000000183282a18 __CFRunLoopRun + 1628
20 CoreFoundation 0x00000001831b1680 CFRunLoopRunSpecific + 384
21 GraphicsServices 0x00000001846c0088 GSEventRunModal + 180
22 UIKit 0x0000000188028d90 UIApplicationMain + 204
23 fitDEGREE 0x00000001000fe758 0x10006c000 + 599896
24 libdyld.dylib 0x0000000182d528b8 start + 4
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000182e714fc kevent_qos + 8
1 libdispatch.dylib 0x0000000182d3494c _dispatch_mgr_invoke + 232
2 libdispatch.dylib 0x0000000182d237bc _dispatch_source_invoke + 0
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x0000000182e554bc mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000182e55338 mach_msg + 72
2 CoreFoundation 0x0000000183284ac0 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x00000001832827c4 __CFRunLoopRun + 1032
4 CoreFoundation 0x00000001831b1680 CFRunLoopRunSpecific + 384
5 CFNetwork 0x0000000183921434 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
6 Foundation 0x0000000183c8fc40 __NSThread__start__ + 1000
7 libsystem_pthread.dylib 0x0000000182f37b28 _pthread_body + 156
8 libsystem_pthread.dylib 0x0000000182f37a8c _pthread_body + 0
9 libsystem_pthread.dylib 0x0000000182f35028 thread_start + 4
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x0000000182e70368 __select + 8
1 CoreFoundation 0x000000018328b028 __CFSocketManager + 648
2 libsystem_pthread.dylib 0x0000000182f37b28 _pthread_body + 156
3 libsystem_pthread.dylib 0x0000000182f37a8c _pthread_body + 0
4 libsystem_pthread.dylib 0x0000000182f35028 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x0000000182e70b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000182f35530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x0000000182f35020 start_wqthread + 4
Thread 5:
0 libsystem_kernel.dylib 0x0000000182e70b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000182f35530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x0000000182f35020 start_wqthread + 4
Thread 6 name: Dispatch queue: com.apple.CoreLocation.ConnectionClient.0x156e82f30.events
Thread 6:
0 libsystem_kernel.dylib 0x0000000182e55510 semaphore_timedwait_trap + 8
1 libdispatch.dylib 0x0000000182d32508 _dispatch_semaphore_wait_slow + 160
2 CoreLocation 0x0000000189b3ed78 0x189b3c000 + 11640
3 CoreLocation 0x0000000189b437ec 0x189b3c000 + 30700
4 CoreLocation 0x0000000189b7df28 0x189b3c000 + 270120
5 CoreLocation 0x0000000189b7bb7c 0x189b3c000 + 260988
6 CoreLocation 0x0000000189b7bab0 0x189b3c000 + 260784
7 CoreLocation 0x0000000189b7ccfc 0x189b3c000 + 265468
8 libxpc.dylib 0x0000000182f69358 _xpc_connection_call_event_handler + 68
9 libxpc.dylib 0x0000000182f67100 _xpc_connection_mach_event + 2132
10 libdispatch.dylib 0x0000000182d216ec _dispatch_client_callout4 + 16
11 libdispatch.dylib 0x0000000182d259d8 _dispatch_mach_msg_invoke + 656
12 libdispatch.dylib 0x0000000182d2d808 _dispatch_queue_drain + 1332
13 libdispatch.dylib 0x0000000182d24aec _dispatch_mach_invoke + 600
14 libdispatch.dylib 0x0000000182d2d808 _dispatch_queue_drain + 1332
15 libdispatch.dylib 0x0000000182d250f4 _dispatch_queue_invoke + 464
16 libdispatch.dylib 0x0000000182d2d808 _dispatch_queue_drain + 1332
17 libdispatch.dylib 0x0000000182d250f4 _dispatch_queue_invoke + 464
18 libdispatch.dylib 0x0000000182d215f0 _dispatch_client_callout + 16
19 libdispatch.dylib 0x0000000182d2fa88 _dispatch_root_queue_drain + 2140
20 libdispatch.dylib 0x0000000182d2f224 _dispatch_worker_thread3 + 112
21 libsystem_pthread.dylib 0x0000000182f35470 _pthread_wqthread + 1092
22 libsystem_pthread.dylib 0x0000000182f35020 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x0000000182e70b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000182f35530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x0000000182f35020 start_wqthread + 4
Thread 8:
0 libsystem_kernel.dylib 0x0000000182e70b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000182f35530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x0000000182f35020 start_wqthread + 4
Thread 9 name: Dispatch queue: com.apple.networking.connection.0x158cf1640
Thread 9:
0 libsystem_kernel.dylib 0x0000000182e56830 close + 8
1 libsystem_network.dylib 0x0000000182eca31c nw_network_agent_internal_copy_dictionary_for_uuid + 472
2 libsystem_network.dylib 0x0000000182ef089c nw_path_create_evaluator_for_helper_client_id + 2576
3 libsystem_network.dylib 0x0000000182ec298c __tcp_connection_start_block_invoke + 368
4 libdispatch.dylib 0x0000000182d21630 _dispatch_call_block_and_release + 24
5 libdispatch.dylib 0x0000000182d215f0 _dispatch_client_callout + 16
6 libdispatch.dylib 0x0000000182d2d634 _dispatch_queue_drain + 864
7 libdispatch.dylib 0x0000000182d250f4 _dispatch_queue_invoke + 464
8 libdispatch.dylib 0x0000000182d2f504 _dispatch_root_queue_drain + 728
9 libdispatch.dylib 0x0000000182d2f224 _dispatch_worker_thread3 + 112
10 libsystem_pthread.dylib 0x0000000182f35470 _pthread_wqthread + 1092
11 libsystem_pthread.dylib 0x0000000182f35020 start_wqthread + 4
Thread 10:
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000158ce0df7
x4: 0x0000000182932e02 x5: 0x000000016fd91450 x6: 0x000000000000006e x7: 0x0000000000000fa0
x8: 0x0000000008000000 x9: 0x0000000004000000 x10: 0x0000000000000002 x11: 0x0000000000000010
x12: 0x0000000000000000 x13: 0x0000000000000002 x14: 0x0000000009010810 x15: 0x0000000010808020
x16: 0x0000000000000148 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x00000001a0bbf000 x21: 0x000000016fd91450 x22: 0x0000000156d207d0 x23: 0x800029e5f0542d01
x24: 0x00000000000000b8 x25: 0x0000000158cf3d00 x26: 0xa006769666e6f636 x27: 0x0000000000000000
x28: 0xa0030303a35302d6 fp: 0x000000016fd913b0 lr: 0x0000000182f38ef8
sp: 0x000000016fd91390 pc: 0x0000000182e70140 cpsr: 0x00000000

iOS 8 crash log (AVPlayer)

I am unable to diagnose this crash log, which occurs when using the AVPlayer class-- sometimes it happens right away, and sometimes it happens when trying to play the 2nd or 3rd video..
Incident Identifier: 4E82E665-228D-4A97-8B85-6F5B65E2B457
CrashReporter Key: 46be3f0cd4d380b2ce08823fedd6d6d22c38df2f
Hardware Model: iPad4,2
Process: App [2433]
Path: /private/var/mobile/Containers/Bundle/Application/66E1EFE7-1BD0-4CE3-8FEF-47D58C36ADF7/App.app/App
Identifier: SXX.app
Version: 1.3 (1.3)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2015-03-31 15:59:07.361 -0700
Launch Time: 2015-03-31 15:57:50.272 -0700
OS Version: iOS 8.2 (12D508)
Report Version: 105
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 6
Last Exception Backtrace:
0 CoreFoundation 0x18530a530 __exceptionPreprocess + 132
1 libobjc.A.dylib 0x1964280e4 objc_exception_throw + 60
2 CoreFoundation 0x18530a470 +[NSException raise:format:] + 128
3 Foundation 0x1861865e0 NSKVODeallocate + 340
4 AVFoundation 0x183b27b38 __destroy_helper_block_1474 + 28
5 libsystem_blocks.dylib 0x196ad1910 _Block_release + 256
6 libdispatch.dylib 0x196a79954 _dispatch_client_callout + 16
7 libdispatch.dylib 0x196a7e20c _dispatch_main_queue_callback_4CF + 1608
8 CoreFoundation 0x1852c22ec __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9 CoreFoundation 0x1852c0394 __CFRunLoopRun + 1492
10 CoreFoundation 0x1851ed1f4 CFRunLoopRunSpecific + 396
11 GraphicsServices 0x18e51f6fc GSEventRunModal + 168
12 UIKit 0x189b7e10c UIApplicationMain + 1488
13 App 0x10001d4ac main (main.m:8)
14 libdyld.dylib 0x196aa6a08 start + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x0000000196bbf594 __semwait_signal_nocancel + 8
1 libsystem_c.dylib 0x0000000196aef1a0 nanosleep$NOCANCEL + 200
2 libsystem_c.dylib 0x0000000196b142b8 usleep$NOCANCEL + 64
3 libsystem_c.dylib 0x0000000196b36b1c abort + 116
4 App 0x0000000100042b50 uncaught_exception_handler + 32
5 CoreFoundation 0x000000018530a8ec __handleUncaughtException + 688
6 libobjc.A.dylib 0x00000001964283b0 _objc_terminate() + 112
7 libc++abi.dylib 0x0000000195c25bb0 std::__terminate(void (*)()) + 12
8 libc++abi.dylib 0x0000000195c25474 __cxa_throw + 132
9 libobjc.A.dylib 0x0000000196428200 objc_exception_throw + 344
10 CoreFoundation 0x000000018530a46c +[NSException raise:format:] + 124
11 Foundation 0x00000001861865dc NSKVODeallocate + 336
12 AVFoundation 0x0000000183b27b34 __destroy_helper_block_1474 + 24
13 libsystem_blocks.dylib 0x0000000196ad190c _Block_release + 252
14 libdispatch.dylib 0x0000000196a79950 _dispatch_client_callout + 12
15 libdispatch.dylib 0x0000000196a7e208 _dispatch_main_queue_callback_4CF + 1604
16 CoreFoundation 0x00000001852c22e8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
17 CoreFoundation 0x00000001852c0390 __CFRunLoopRun + 1488
18 CoreFoundation 0x00000001851ed1f0 CFRunLoopRunSpecific + 392
19 GraphicsServices 0x000000018e51f6f8 GSEventRunModal + 164
20 UIKit 0x0000000189b7e108 UIApplicationMain + 1484
21 App 0x000000010001d4a8 main (main.m:8)
22 libdyld.dylib 0x0000000196aa6a04 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x0000000196ba4c24 kevent64 + 8
1 libdispatch.dylib 0x0000000196a89e6c _dispatch_mgr_invoke + 272
2 libdispatch.dylib 0x0000000196a7b998 _dispatch_mgr_thread + 48
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x0000000196ba4e0c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000196ba4c84 mach_msg + 68
2 CoreFoundation 0x00000001852c2214 __CFRunLoopServiceMachPort + 196
3 CoreFoundation 0x00000001852c0168 __CFRunLoopRun + 936
4 CoreFoundation 0x00000001851ed1f0 CFRunLoopRunSpecific + 392
5 CFNetwork 0x0000000184cee2a0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 436
6 Foundation 0x0000000186202304 __NSThread__main__ + 1068
7 libsystem_pthread.dylib 0x0000000196c5bdc4 _pthread_body + 160
8 libsystem_pthread.dylib 0x0000000196c5bd20 _pthread_start + 156
9 libsystem_pthread.dylib 0x0000000196c58ef4 thread_start + 0
Thread 3:
0 libsystem_kernel.dylib 0x0000000196bbfc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000196c592d8 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000196c58eec start_wqthread + 0
Thread 4 name: com.apple.CFSocket.private
Thread 4:
0 libsystem_kernel.dylib 0x0000000196bbf498 __select + 8
1 CoreFoundation 0x00000001852c7c0c __CFSocketManager + 656
2 libsystem_pthread.dylib 0x0000000196c5bdc4 _pthread_body + 160
3 libsystem_pthread.dylib 0x0000000196c5bd20 _pthread_start + 156
4 libsystem_pthread.dylib 0x0000000196c58ef4 thread_start + 0
Thread 5 name: com.apple.coremedia.player.remote
Thread 5:
0 libsystem_kernel.dylib 0x0000000196ba4e0c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000196ba4c84 mach_msg + 68
2 MediaToolbox 0x00000001876efe7c FigExpressNotificationThread + 100
3 CoreMedia 0x0000000185b22028 figThreadMain + 244
4 libsystem_pthread.dylib 0x0000000196c5bdc4 _pthread_body + 160
5 libsystem_pthread.dylib 0x0000000196c5bd20 _pthread_start + 156
6 libsystem_pthread.dylib 0x0000000196c58ef4 thread_start + 0
Thread 6 Crashed:
0 libsystem_kernel.dylib 0x0000000196bbfc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000196c592d8 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000196c58eec start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x0000000196bbfc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000196c592d8 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000196c58eec start_wqthread + 0
Thread 8 name: com.apple.coremedia.player.async
Thread 8:
0 libsystem_kernel.dylib 0x0000000196ba4e48 semaphore_wait_trap + 8
1 libdispatch.dylib 0x0000000196a87f3c _dispatch_semaphore_wait_slow + 252
2 MediaToolbox 0x00000001876e95bc fpa_AsyncMovieControlThread + 1952
3 CoreMedia 0x0000000185b22028 figThreadMain + 244
4 libsystem_pthread.dylib 0x0000000196c5bdc4 _pthread_body + 160
5 libsystem_pthread.dylib 0x0000000196c5bd20 _pthread_start + 156
6 libsystem_pthread.dylib 0x0000000196c58ef4 thread_start + 0
Thread 9 name: com.apple.coremedia.player.async
Thread 9:
0 libsystem_kernel.dylib 0x0000000196ba4e48 semaphore_wait_trap + 8
1 libdispatch.dylib 0x0000000196a87f3c _dispatch_semaphore_wait_slow + 252
2 MediaToolbox 0x00000001876e95bc fpa_AsyncMovieControlThread + 1952
3 CoreMedia 0x0000000185b22028 figThreadMain + 244
4 libsystem_pthread.dylib 0x0000000196c5bdc4 _pthread_body + 160
5 libsystem_pthread.dylib 0x0000000196c5bd20 _pthread_start + 156
6 libsystem_pthread.dylib 0x0000000196c58ef4 thread_start + 0
Thread 10:
0 libsystem_kernel.dylib 0x0000000196bbfc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000196c592d8 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000196c58eec start_wqthread + 0
Thread 11:
0 libsystem_kernel.dylib 0x0000000196bbfc78 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x0000000196c592d8 _pthread_wqthread + 988
2 libsystem_pthread.dylib 0x0000000196c58eec start_wqthread + 0
Thread 6 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000004 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000000002d1f x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x0000000000000000 x9: 0x6800a3c4679d3eb0 x10: 0x0000000000000015 x11: 0x0000000000000000
x12: 0x000000012d0ea200 x13: 0x000000019ab850d8 x14: 0x0000000000000000 x15: 0x0000000000000001
x16: 0x0000000000000170 x17: 0x00000001964426b8 x18: 0x0000000000000000 x19: 0x000000010469c000
x20: 0x0000000000000009 x21: 0x00000000800002ff x22: 0x0000000000009f0f x23: 0x0000000000010000
x24: 0x000000019abab000 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x0000000000000000 fp: 0x000000010469bf70 lr: 0x0000000196c592dc
sp: 0x000000010469bf10 pc: 0x0000000196bbfc78 cpsr: 0x40000000
Crash logs like this can be unhelpful. The most likely culprit is a nil pointer somewhere in your code. You may have no option but to step through your code with a debugger making sure that all your variables have the values you expect them to have.

Crash with NSManagedObject release: "objc_msgSend() selector name: _queueForDealloc"

I have been getting a strange crash reported by lots of users through HockeyApp with the following stack trace. It seems to have something to do with NSManagedObject being released in a different dispatch queue ... but I don't get any symbolication for where the problem might be. It seems like a memory management issue, but I'm using ARC so not sure how it would over-release an NSManagedObject.
This is the crash report I get (the main thread shows different traces at different times):
Code Type: ARM-64
Parent Process: launchd [1]
Date/Time: 2014-05-12T05:43:54Z
OS Version: iPhone OS 7.0.6 (11B651)
Report Version: 104
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0x1c3dbeb8
Crashed Thread: 2
Application Specific Information:
objc_msgSend() selector name: _queueForDealloc:
Thread 0:
0 CoreFoundation 0x000000018e384618 CFNumberGetType + 0
1 CoreFoundation 0x000000018e3333b8 _CFAppendXML0 + 2768
2 CoreFoundation 0x000000018e333304 _CFAppendXML0 + 2588
3 CoreFoundation 0x000000018e332268 _CFPropertyListCreateXMLData + 196
4 Foundation 0x000000018ef152f4 -[NSDictionary(NSDictionary) writeToFile:atomically:] + 232
5 SimpleList 0x00000001001ae48c __55-[SharedSettingController writeToContactsReferenceFile]_block_invoke (SharedSettingController.m:620)
6 libdispatch.dylib 0x000000019a974420 _dispatch_call_block_and_release + 20
7 libdispatch.dylib 0x000000019a9743e0 _dispatch_client_callout + 12
8 libdispatch.dylib 0x000000019a97756c _dispatch_main_queue_callback_4CF + 340
9 CoreFoundation 0x000000018e3e6d64 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
10 CoreFoundation 0x000000018e3e50a4 __CFRunLoopRun + 1448
11 CoreFoundation 0x000000018e325b38 CFRunLoopRunSpecific + 448
12 GraphicsServices 0x0000000193d4b830 GSEventRunModal + 164
13 UIKit 0x00000001913640e8 UIApplicationMain + 1152
14 SimpleList 0x000000010006347c _mh_execute_header (main.m:18)
15 libdyld.dylib 0x000000019a98faa0 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x000000019aa71ac8 kevent64 + 8
1 libdispatch.dylib 0x000000019a975d78 _dispatch_mgr_thread + 48
Thread 2 Crashed:
0 libobjc.A.dylib 0x000000019a39f9d0 objc_msgSend + 16
1 CoreData 0x000000018e13b284 -[NSManagedObject release] + 168
2 CoreData 0x000000018e131154 -[_PFArray dealloc] + 96
3 libobjc.A.dylib 0x000000019a3a13d4 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 520
4 libdispatch.dylib 0x000000019a97b428 _dispatch_root_queue_drain + 440
5 libdispatch.dylib 0x000000019a97b638 _dispatch_worker_thread2 + 72
6 libsystem_pthread.dylib 0x000000019ab09918 _pthread_wqthread + 352
7 libsystem_pthread.dylib 0x000000019ab097a8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x000000019aa71cc0 mach_msg_trap + 8
1 CoreFoundation 0x000000018e3e6cac __CFRunLoopServiceMachPort + 180
2 CoreFoundation 0x000000018e3e4e3c __CFRunLoopRun + 832
3 CoreFoundation 0x000000018e325b38 CFRunLoopRunSpecific + 448
4 Foundation 0x000000018ef127fc +[NSURLConnection(Loader) _resourceLoadLoop:] + 344
5 Foundation 0x000000018efa0770 __NSThread__main__ + 996
6 libsystem_pthread.dylib 0x000000019ab0c1b0 _pthread_body + 164
7 libsystem_pthread.dylib 0x000000019ab0c108 _pthread_start + 136
8 libsystem_pthread.dylib 0x000000019ab097b0 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x000000019aa8a76c __select + 8
1 libsystem_pthread.dylib 0x000000019ab0c1b0 _pthread_body + 164
2 libsystem_pthread.dylib 0x000000019ab0c108 _pthread_start + 136
3 libsystem_pthread.dylib 0x000000019ab097b0 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x000000019aa8ae74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019ab097a8 start_wqthread + 0
Thread 6:
0 libsystem_kernel.dylib 0x000000019aa8ae74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019ab097a8 start_wqthread + 0
Thread 7:
0 libsystem_kernel.dylib 0x000000019aa8ae74 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019ab097a8 start_wqthread + 0
Thread 2 crashed with ARM-64 Thread State:
pc: 0x000000019a39f9d0 fp: 0x0000000102b479c0 sp: 0x0000000102b479a0 x0: 0x00000001782451f0
x1: 0x000000018e2eeb56 x2: 0x00000001705336a0 x3: 0x000000019aac3d18 x4: 0x0000000000000001
x5: 0x0000000000000010 x6: 0x000000017013f900 x7: 0x0000000000000000 x8: 0x000000019ad5bdb8
x9: 0x000000001c3dbea8 x10: 0x0000000000000000 x11: 0x000000230000003f x12: 0x000000014f073410
x13: 0xbadd5bcc1c3dbead x14: 0xffffffffffffffff x15: 0x0000000000000001 x16: 0x000000019a39f9c0
x17: 0x000000018e13b1d8 x18: 0x0000000000000000 x19: 0x00000001705336a0 x20: 0x000000019ad7b000
x21: 0x000000019adc9200 x22: 0x000000019ad7b000 x23: 0x0000000000000715 x24: 0x0000000000000010
x25: 0x0000000102a64038 x26: 0xa3a3a3a3a3a3a3a3 x27: 0x0000000000000001 x28: 0x0000000000000000
lr: 0x000000018e13b284 cpsr: 0x0000000020000000
At launch, I do initiate a couple of dispatch queues to do some background work (they use a separate MOC to load managed objects and process them), so those might be responsible, but the queues are labelled in my app, and the stack trace doesn't seem to show which queue is responsible (if it is my own queues). I've run the app with NSZombies enabled but that doesn't help. I have also ran the static analysis tool, and that doesn't turn up anything.
Any ideas what might be causing this problem, and what I can do to debug it?
EDIT:
I'm pretty sure I can isolate the problem area down to a piece of code that gets called after launching the app:
SLAppDelegate *delegate = (SLAppDelegate *) [[UIApplication sharedApplication] delegate];
dispatch_async(delegate.coreDataController.filterMainQueue, ^{
NSManagedObjectContext *backgroundContextImage = [[NSManagedObjectContext alloc] init];
[backgroundContextImage setPersistentStoreCoordinator: delegate.coreDataController.persistentStoreCoordinator];
NSArray *items = [Person getAllPersonsWithContext: backgroundContextImage];
// possibly update some of the items
dispatch_async(dispatch_get_main_queue(), ^{
// writes the file inside another dispatch_asyn(dispatch_get_main_queue)
[[SharedSettingController sharedSettings] writeToContactsReferenceFile];
};
});
I'm just not sure what is wrong with this. It works fine 99% of the time. But that 1% is causing a few crashes that I'd love to get resolved.
We hit into a a similar issue when using a private managed object context inside an NSOperation and we ended up working around it by weakifying any parameters and using a private #autoreleasepool. I'll elaborate further below.
Our current set up has an NSOperationQueue which has a long running calculation we do in the background. The operation first creates a private managed object context with the parent set as the main object context and goes and fetches its objects.
In the mean time, we have a separate NSOperationQueue elsewhere that syncs down new data from our server, potentially adding, updating, or removing objects used by our calculation operation.
We first saw a bunch of these crashes out in the wild and the only way to repro it locally is to have both calculation and sync operations run continuously and after 5-10 minutes, we would see a crash similar to one of the below:
Thread : Crashed: background queue :: NSOperation 0x18f43c90
0 libobjc.A.dylib 0x36f11f46 objc_msgSend + 5
1 CoreData 0x2928408f -[NSManagedObject release] + 166
2 CoreData 0x2927b4d7 -[_PFArray dealloc] + 94
3 libobjc.A.dylib 0x36f201a9 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 404
4 CoreFoundation 0x294713a9 _CFAutoreleasePoolPop + 16
5 Foundation 0x2a1b6453 -[__NSOperationInternal _start:] + 1058
6 Foundation 0x2a25b44b __NSOQSchedule_f + 186
7 libdispatch.dylib 0x3746d651 _dispatch_queue_drain + 952
8 libdispatch.dylib 0x3746809d _dispatch_queue_invoke + 84
9 libdispatch.dylib 0x3746eba1 _dispatch_root_queue_drain + 320
10 libdispatch.dylib 0x3746fcd7 _dispatch_worker_thread3 + 94
11 libsystem_pthread.dylib 0x375c6e31 _pthread_wqthread + 668
Thread : Crashed: background queue :: NSOperation 0x1db59e80
0 libsystem_kernel.dylib 0x3722edfc __pthread_kill + 8
1 libsystem_pthread.dylib 0x372acd37 pthread_kill + 62
2 libsystem_c.dylib 0x371ce909 abort + 76
3 libsystem_malloc.dylib 0x37258331 szone_size
4 libobjc.A.dylib 0x36bf1621 object_dispose + 20
5 CoreData 0x28ec571d -[_PFManagedObjectReferenceQueue dealloc] + 80
6 CoreData 0x28e5630f -[NSManagedObject dealloc] + 166
7 CoreData 0x28e55217 -[_PFManagedObjectReferenceQueue _queueForDealloc:] + 246
8 CoreData 0x28e5508f -[NSManagedObject release] + 166
9 CoreData 0x28e4c4d7 -[_PFArray dealloc] + 94
10 libobjc.A.dylib 0x36c031a9 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 404
11 CoreFoundation 0x29042149 _CFAutoreleasePoolPop + 16
12 Foundation 0x29d88c23 -[__NSOperationInternal _start:] + 1058
13 Foundation 0x29e2dc1b __NSOQSchedule_f + 186
14 libdispatch.dylib 0x371505b1 _dispatch_queue_drain + 952
15 libdispatch.dylib 0x3714af85 _dispatch_queue_invoke + 84
16 libdispatch.dylib 0x37151b9b _dispatch_root_queue_drain + 338
17 libdispatch.dylib 0x37152cd7 _dispatch_worker_thread3 + 94
18 libsystem_pthread.dylib 0x372a9e31 _pthread_wqthread + 668
Thread : Crashed: NSOperationQueue Serial Queue
0 libsystem_kernel.dylib 0x396871f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x396ef7b7 pthread_kill + 58
2 libsystem_c.dylib 0x39637ff9 abort + 76
3 libsystem_malloc.dylib 0x396aed25 szone_size
4 libobjc.A.dylib 0x390d93a9 object_dispose + 20
5 CoreData 0x2e3d4081 -[_PFManagedObjectReferenceQueue dealloc] + 80
6 CoreData 0x2e3655b7 -[NSManagedObject dealloc] + 166
7 CoreData 0x2e364501 -[_PFManagedObjectReferenceQueue _queueForDealloc:] + 244
8 CoreData 0x2e36437d -[NSManagedObject release] + 164
9 CoreData 0x2e35b867 -[_PFArray dealloc] + 94
10 libobjc.A.dylib 0x390e20d3 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 358
11 CoreFoundation 0x2e5294c1 _CFAutoreleasePoolPop + 16
12 Foundation 0x2ef29999 -[__NSOperationInternal _start:] + 1064
13 Foundation 0x2efcd745 __NSOQSchedule_f + 60
14 libdispatch.dylib 0x395c0cbd _dispatch_queue_drain + 488
15 libdispatch.dylib 0x395bdc6f _dispatch_queue_invoke + 42
16 libdispatch.dylib 0x395c15f1 _dispatch_root_queue_drain + 76
17 libdispatch.dylib 0x395c18dd _dispatch_worker_thread2 + 56
18 libsystem_pthread.dylib 0x396ecc17 _pthread_wqthread + 298
We reviewed the code multiple times and was not able to determine why it was crashing. We tried enabling NSZombies, but would run out of memory long before we could get a repro.
What we ended up doing is the following 2 things:
#autoreleasepool
Inside our [privateObjectContext performBlockAndWait:^{…}] which resides inside our NSOperationBlock, we wrapped all the code inside an #autoreleasepool{…}. That way all NSManagedObjects retrieved during that block of code will be mark for release before leaving the performBlockAndWait.
weakify/strongify
Any parameters that include NSManagedObjects were weakify before passing it into the block, and strongify once in the block. This way since we no longer have a strong reference to them, they can be released if they become out of date while we wait for the NSOperation to start. Here's a good article on how weakify/strongify works: http://blog.aceontech.com/post/111694918560/weakifyself-a-more-elegant-solution-to

Resources