GLKViewController hangs after a few hours - ios

My iOS app is using GLKViewController to display data received from an external camera streaming on a local network. However, after a few hours it hangs and the app becomes not responsive. If I pause the execution on the debugger, I can see that the app is actually running (network threads for instance are alive) but the Update and DrawInRect methods are not being fired and the main thread seems to be stuck.
In particular, backtracing threads produces this output as far as gpu related threads are concerned:
thread #1, queue = 'gputools.DYSharedMemoryTransport.0x102d00000.send', stop reason = instruction step over
* frame #0: 0x00000001f88c559c libsystem_c.dylib`nanosleep + 160
frame #1: 0x00000001f88c54a4 libsystem_c.dylib`usleep + 64
frame #2: 0x0000000102933780 GPUToolsCore`-[DYSharedMemoryTransport _waitEAGAIN] + 40
frame #3: 0x0000000102957510 GPUToolsCore`-[DYBaseStreamTransport _writeBuffers:] + 232
frame #4: 0x0000000102957b00 GPUToolsCore`-[DYBaseStreamTransport _sendMessage:error:] + 508
frame #5: 0x0000000102946064 GPUToolsCore`__63-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:]_block_invoke.223 + 116
frame #6: 0x0000000102314de4 libdispatch.dylib`_dispatch_client_callout + 16
frame #7: 0x0000000102323d18 libdispatch.dylib`_dispatch_sync_invoke_and_complete_recurse + 132
frame #8: 0x0000000102945e38 GPUToolsCore`-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 644
frame #9: 0x0000000102932530 GPUToolsCore`-[DYSharedMemoryTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 252
frame #10: 0x00000001024a5120 libglInterpose.dylib`handle_frame_boundary + 472
frame #11: 0x00000001026917a0 libglInterpose.dylib`_EAGLContext_PresentInterposeCommon(EAGLContext*, unsigned int, unsigned long, double, bool () block_pointer) + 988
frame #12: 0x000000010268f074 libglInterpose.dylib`EAGLContext_presentRenderbuffer(EAGLContext*, objc_selector*, unsigned long) + 80
frame #13: 0x0000000205f8192c GLKit`-[GLKView _display:] + 308
frame #14: 0x0000000205f82b08 GLKit`-[GLKViewController _updateAndDraw] + 520
frame #15: 0x000000010293d66c GPUToolsCore`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 176
frame #16: 0x00000001fd270574 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 828
frame #17: 0x00000001f901a58c IOKit`IODispatchCalloutFromCFMessage + 488
frame #18: 0x00000001f8d223e4 CoreFoundation`__CFMachPortPerform + 188
frame #19: 0x00000001f8d49c30 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
frame #20: 0x00000001f8d4937c CoreFoundation`__CFRunLoopDoSource1 + 440
frame #21: 0x00000001f8d44134 CoreFoundation`__CFRunLoopRun + 2140
frame #22: 0x00000001f8d435b8 CoreFoundation`CFRunLoopRunSpecific + 436
frame #23: 0x00000001fafb7584 GraphicsServices`GSEventRunModal + 100
frame #24: 0x0000000225383558 UIKitCore`UIApplicationMain + 212
frame #25: 0x0000000100471798 KiberField`main(argc=1, argv=0x000000016f9f7780) at main.m:14:16
frame #26: 0x00000001f8803b94 libdyld.dylib`start + 4
thread #2, name = 'gputools.smt_poll.0x281b4a8a0'
frame #0: 0x00000001f8950428 libsystem_kernel.dylib`__semwait_signal + 8
frame #1: 0x00000001f88c55d0 libsystem_c.dylib`nanosleep + 212
frame #2: 0x00000001f88c54a4 libsystem_c.dylib`usleep + 64
frame #3: 0x0000000102932df4 GPUToolsCore`smt_poll_thread_entry(void*) + 136
frame #4: 0x00000001f89d42fc libsystem_pthread.dylib`_pthread_body + 128
frame #5: 0x00000001f89d425c libsystem_pthread.dylib`_pthread_start + 48
frame #6: 0x00000001f89d7d08 libsystem_pthread.dylib`thread_start + 4
thread #3, name = 'gputools.smt_poll.0x281b58ce0'
frame #0: 0x00000001f8950428 libsystem_kernel.dylib`__semwait_signal + 8
frame #1: 0x00000001f88c55d0 libsystem_c.dylib`nanosleep + 212
frame #2: 0x00000001f88c54a4 libsystem_c.dylib`usleep + 64
frame #3: 0x0000000102932df4 GPUToolsCore`smt_poll_thread_entry(void*) + 136
frame #4: 0x00000001f89d42fc libsystem_pthread.dylib`_pthread_body + 128
frame #5: 0x00000001f89d425c libsystem_pthread.dylib`_pthread_start + 48
frame #6: 0x00000001f89d7d08 libsystem_pthread.dylib`thread_start + 4
My question is: what could be possibly blocking the thread?
Alternatively, I can detect this deadlock with a timeout timer checked in another thread: is there a way to unblock the graphical thread (for instance manually calling Update or whatever else) ?

I met this problem also.I use the 'RTCEAGLVideoView' in webrtc to display video images.The main thread seems won't get cpu time anymore!Could this is a bug in iPadOS 13?

Related

iOS Application keeps deadlocks in the field out of no where

I have a native B2B application distributed via an MDM to several locations across the US, the units are on 24/7 and are public terminals for people to use. The application is also locked into place with Guided Access.
In the past few weeks we have been having issues where the application will freeze, and I've been banging my head against the wall trying to figure out why. It is mostly happening on Cellular iPads, but not exclusively. There's no specific place in the application where it freezes either, so I'm unsure if there could be anything in particular blocking the main thread.
I have been unable to make it freeze in house, it's only happening in the field. And have tried everything to get it to freeze, by automating hundreds of actions, changing the network limiter to see if there's a call in the background thats not handled correctly. I have run through instruments to see if the iPad is running out of memory, but I'd assume that would cause the application to crash instead of freeze.
I have added more logging, as well as the New Relic mobile SDK to try and catch something, but I don't see anything out of the ordinary.
It was working just fine and then these iPads auto updated to 14.4-14.6.
Does anyone have any ideas on what the cause could be or if those iPadOS versions are buggy? Any suggestions would be super helpful, this is driving me insane.
UPDATE:
I've gotten it to freeze, here is where it goes when I pause
Backtrace:
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x00000001c87e6908 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x00000001c87e5d0c libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x000000019d05be00 CoreFoundation`__CFRunLoopServiceMachPort + 368
frame #3: 0x000000019d056200 CoreFoundation`__CFRunLoopRun + 1184
frame #4: 0x000000019d055818 CoreFoundation`CFRunLoopRunSpecific + 572
frame #5: 0x00000001b375b570 GraphicsServices`GSEventRunModal + 160
frame #6: 0x000000019f9810e8 UIKitCore`-[UIApplication _run] + 1052
frame #7: 0x000000019f986664 UIKitCore`UIApplicationMain + 164
frame #8: 0x0000000102b8e538 Application`main(argc=<unavailable>, argv=<unavailable>) at main.m:14:16 [opt]
frame #9: 0x000000019cd34140 libdyld.dylib`start + 4
* thread #3, name = 'gputools.smt_poll.0x2838a1e20'
* frame #0: 0x00000001c880ab54 libsystem_kernel.dylib`__semwait_signal + 8
frame #1: 0x00000001a5cfead4 libsystem_c.dylib`nanosleep + 212
frame #2: 0x00000001a5cfe9ac libsystem_c.dylib`usleep + 64
frame #3: 0x000000010993e5cc GPUToolsCore`smt_poll_thread_entry(void*) + 144
frame #4: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #4, name = 'gputools.smt_poll.0x28389eec0'
* frame #0: 0x00000001c880ab54 libsystem_kernel.dylib`__semwait_signal + 8
frame #1: 0x00000001a5cfead4 libsystem_c.dylib`nanosleep + 212
frame #2: 0x00000001a5cfe9ac libsystem_c.dylib`usleep + 64
frame #3: 0x0000000103c36fe8 libMTLCapture.dylib`___lldb_unnamed_symbol2228$$libMTLCapture.dylib + 104
frame #4: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #9, name = 'com.apple.uikit.eventfetch-thread'
* frame #0: 0x00000001c87e6908 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x00000001c87e5d0c libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x000000019d05be00 CoreFoundation`__CFRunLoopServiceMachPort + 368
frame #3: 0x000000019d056200 CoreFoundation`__CFRunLoopRun + 1184
frame #4: 0x000000019d055818 CoreFoundation`CFRunLoopRunSpecific + 572
frame #5: 0x000000019e2b2094 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
frame #6: 0x000000019e2b1f74 Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 88
frame #7: 0x000000019fa2dc28 UIKitCore`-[UIEventFetcher threadMain] + 504
frame #8: 0x000000019e40edb0 Foundation`__NSThread__start__ + 848
frame #9: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #11
* frame #0: 0x00000001c880a580 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x00000001e4a31308 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$mp + 1236
frame #2: 0x00000001b0eb1a20 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x00000001054ec4d0 NewRelic`___lldb_unnamed_symbol3677$$NewRelic + 240
frame #4: 0x00000001054eca60 NewRelic`___lldb_unnamed_symbol3699$$NewRelic + 28
frame #5: 0x00000001054ecc08 NewRelic`___lldb_unnamed_symbol3702$$NewRelic + 72
frame #6: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #12
* frame #0: 0x00000001c880a580 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x00000001e4a31308 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$mp + 1236
frame #2: 0x00000001b0eb1a20 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x00000001054ec4d0 NewRelic`___lldb_unnamed_symbol3677$$NewRelic + 240
frame #4: 0x00000001054eca60 NewRelic`___lldb_unnamed_symbol3699$$NewRelic + 28
frame #5: 0x00000001054ecc08 NewRelic`___lldb_unnamed_symbol3702$$NewRelic + 72
frame #6: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #13
* frame #0: 0x00000001c880a580 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x00000001e4a31308 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$mp + 1236
frame #2: 0x00000001b0eb1a20 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 24
frame #3: 0x00000001054ec4d0 NewRelic`___lldb_unnamed_symbol3677$$NewRelic + 240
frame #4: 0x00000001054eca60 NewRelic`___lldb_unnamed_symbol3699$$NewRelic + 28
frame #5: 0x00000001054ecc08 NewRelic`___lldb_unnamed_symbol3702$$NewRelic + 72
frame #6: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #14, name = 'AVAudioSession Notify Thread'
* frame #0: 0x00000001c87e6908 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x00000001c87e5d0c libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x000000019d05be00 CoreFoundation`__CFRunLoopServiceMachPort + 368
frame #3: 0x000000019d056200 CoreFoundation`__CFRunLoopRun + 1184
frame #4: 0x000000019d055818 CoreFoundation`CFRunLoopRunSpecific + 572
frame #5: 0x00000001a44dff18 AudioSession`GenericRunLoopThread::Entry(void*) + 156
frame #6: 0x00000001a44e1e84 AudioSession`CAPThread::Entry(CAPThread*) + 88
frame #7: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #15
* frame #0: 0x00000001c87e6908 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x00000001c87e5d0c libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x000000019d05be00 CoreFoundation`__CFRunLoopServiceMachPort + 368
frame #3: 0x000000019d056200 CoreFoundation`__CFRunLoopRun + 1184
frame #4: 0x000000019d055818 CoreFoundation`CFRunLoopRunSpecific + 572
frame #5: 0x000000019e2b2094 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
frame #6: 0x0000000102f73758 Application`-[CH3_GenericChannelController keepThreadAlive](self=0x0000000280f89ad0, _cmd=<unavailable>) at CH3_GenericChannelController.mm:288:37 [opt]
frame #7: 0x000000019e40edb0 Foundation`__NSThread__start__ + 848
frame #8: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #16
* frame #0: 0x00000001c87e6908 libsystem_kernel.dylib`mach_msg_trap + 8
frame #1: 0x00000001c87e5d0c libsystem_kernel.dylib`mach_msg + 72
frame #2: 0x000000019d05be00 CoreFoundation`__CFRunLoopServiceMachPort + 368
frame #3: 0x000000019d056200 CoreFoundation`__CFRunLoopRun + 1184
frame #4: 0x000000019d055818 CoreFoundation`CFRunLoopRunSpecific + 572
frame #5: 0x000000019e2b2094 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
frame #6: 0x0000000102f73758 Application`-[CH3_GenericChannelController keepThreadAlive](self=0x0000000280f89ad0, _cmd=<unavailable>) at CH3_GenericChannelController.mm:288:37 [opt]
frame #7: 0x000000019e40edb0 Foundation`__NSThread__start__ + 848
frame #8: 0x00000001e4a37c74 libsystem_pthread.dylib`_pthread_start + 288
* thread #48
* frame #0: 0x00000001e4a3c864 libsystem_pthread.dylib`start_wqthread
* thread #77
* frame #0: 0x00000001e4a3c864 libsystem_pthread.dylib`start_wqthread
* thread #83
* frame #0: 0x00000001e4a3c864 libsystem_pthread.dylib`start_wqthread
* thread #84
* frame #0: 0x00000001e4a3c864 libsystem_pthread.dylib`start_wqthread
(lldb)

EAGLContext presentRenderbuffer cause deadlock

I use openGLES in my IOS app. The deadlock occurs in some case. The deadlocked Threads are as following. It seem The EAGLContext presentRenderbuffer cause semaphore::wait() in the sync queue 'gputools.DYSharedMemoryTransport.0x109700000.send', then the main thread reach to wait the same queue, this is deadlock. My question is how EAGLContext presentRenderbuffer cause that wait semaphore::wait()?
thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00000001a6c788b0 libsystem_kernel.dylib`__ulock_wait + 8
frame #1: 0x000000010915b720 libdispatch.dylib`_dlock_wait + 52
frame #2: 0x000000010915b504 libdispatch.dylib`_dispatch_thread_event_wait_slow + 48
frame #3: 0x0000000109169c60 libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 340
frame #4: 0x0000000109169694 libdispatch.dylib`_dispatch_sync_f_slow + 176
frame #5: 0x0000000109389284 GPUToolsCore`-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 556
frame #6: 0x00000001093759e0 GPUToolsCore`-[DYSharedMemoryTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 232
frame #7: 0x00000001a6e52094 CoreFoundation`__NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
frame #8: 0x00000001a6d5566c CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 192
frame #9: 0x0000000109381a60 GPUToolsCore`CADisplayLink_initWithDisplayLink(CADisplayLink*, objc_selector*, void*) + 240
frame #10: 0x00000001ad6a7fdc QuartzCore`+[CADisplayLink(CADisplayLinkPrivate) displayLinkWithDisplay:target:selector:] + 276
frame #11: 0x0000000109381fd4 GPUToolsCore`CADisplayLink_displayLinkWithDisplay_target_selector(objc_class*, objc_selector*, CADisplay*, objc_object*, objc_selector*) + 112
frame #12: 0x00000001aae4b8ec UIKitCore`-[_UITouchForceObservable receiveObservedValue:] + 164
frame #13: 0x00000001aaa65444 UIKitCore`-[UIGestureRecognizer _updateForceClassifierWithEvent:] + 72
frame #14: 0x00000001aaa655a0 UIKitCore`-[UIGestureRecognizer _touchesBegan:withEvent:] + 232
frame #15: 0x00000001aaeddda8 UIKitCore`-[UITouchesEvent _sendEventToGestureRecognizer:] + 360
frame #16: 0x00000001aaa5b7f8 UIKitCore`__47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke + 68
frame #17: 0x00000001aaa5b8f4 UIKitCore`-[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 216
frame #18: 0x00000001aaa5b77c UIKitCore`-[UIGestureEnvironment _updateForEvent:window:] + 204
frame #19: 0x00000001aae9d238 UIKitCore`-[UIWindow sendEvent:] + 3324
frame #20: 0x00000001aae79f64 UIKitCore`-[UIApplication sendEvent:] + 336
frame #21: 0x00000001aaef0868 UIKitCore`__dispatchPreprocessedEventFromEventQueue + 5880
frame #22: 0x00000001aaef2dc4 UIKitCore`__handleEventQueueInternal + 4924
frame #23: 0x00000001aaeebc38 UIKitCore`__handleHIDEventFetcherDrain + 108
frame #24: 0x00000001a6dfd090 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #25: 0x00000001a6dfcfe8 CoreFoundation`__CFRunLoopDoSource0 + 80
frame #26: 0x00000001a6dfc780 CoreFoundation`__CFRunLoopDoSources0 + 180
frame #27: 0x00000001a6df78cc CoreFoundation`__CFRunLoopRun + 1080
frame #28: 0x00000001a6df716c CoreFoundation`CFRunLoopRunSpecific + 464
frame #29: 0x00000001b0c2f328 GraphicsServices`GSEventRunModal + 104
frame #30: 0x00000001aae61d0c UIKitCore`UIApplicationMain + 1936
frame #31: 0x00000001046d4e00 BAvatar`main(argc=1, argv=0x000000016bc0f7b0) at main.m:14:16
frame #32: 0x00000001a6c82424 libdyld.dylib`start + 4
thread #91
frame #0: 0x00000001a6c56630 libsystem_kernel.dylib`semaphore_wait_trap + 8
frame #1: 0x00000001c9d68864 caulk`caulk::mach::semaphore::wait() + 24
frame #2: 0x00000001c9d63538 caulk`caulk::semaphore::timed_wait(double) + 140
frame #3: 0x00000001c9d67220 caulk`caulk::concurrent::details::worker_thread::run() + 40
frame #4: 0x00000001c9d673b0 caulk`void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 56
frame #5: 0x00000001a6b9c1f0 libsystem_pthread.dylib`_pthread_start + 124
* thread #187, queue = 'gputools.DYSharedMemoryTransport.0x109700000.send'
frame #0: 0x00000001a6c78238 libsystem_kernel.dylib`__semwait_signal + 8
frame #1: 0x00000001a6ae5664 libsystem_c.dylib`nanosleep + 212
frame #2: 0x00000001a6ae553c libsystem_c.dylib`usleep + 64
frame #3: 0x0000000109376bac GPUToolsCore`-[DYSharedMemoryTransport _waitEAGAIN] + 40
frame #4: 0x0000000109398940 GPUToolsCore`-[DYBaseStreamTransport _writeBuffers:] + 232
frame #5: 0x0000000109398ed4 GPUToolsCore`-[DYBaseStreamTransport _sendMessage:error:] + 476
frame #6: 0x0000000109389408 GPUToolsCore`__63-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:]_block_invoke.153 + 100
frame #7: 0x000000010915ac88 libdispatch.dylib`_dispatch_client_callout + 16
frame #8: 0x0000000109169dcc libdispatch.dylib`_dispatch_sync_invoke_and_complete_recurse + 132
frame #9: 0x0000000109389284 GPUToolsCore`-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 556
frame #10: 0x00000001093759e0 GPUToolsCore`-[DYSharedMemoryTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 232
frame #11: 0x0000000106710470 libglInterpose.dylib`handle_frame_boundary + 456
frame #12: 0x00000001068ca0d8 libglInterpose.dylib`_EAGLContext_PresentInterposeCommon(EAGLContext*, unsigned int, unsigned long, double, bool () block_pointer) + 1012
frame #13: 0x00000001068c7ee4 libglInterpose.dylib`EAGLContext_presentRenderbuffer(EAGLContext*, objc_selector*, unsigned long) + 80```
EAGLContext is part of OpenGL, which is deprecated. You should switch to Metal on this link: https://developer.apple.com/documentation/coreimage/cicontext/1437609-init

iOS App crashes only when attached to the debugger

i have an issue where my app crashes when attached to the debugger in just one case. My App downloads json data and transform it into core data objects. For this purpose i start a background thread to load it and have a successHandler handling the import:
RemoteConnectionService.sharedInstance.sendRequest(UserRequest(userID: user!.webID.integerValue), successHandler: { requestHandler, result in
var userData = result["user"] as! [String: AnyObject]
self.user?.update(userData)
self.tableView.reloadData()
}, errorHandler: nil)
this works everywhere as expected. the successHandler is called on the main thread, core data gets updated and all. but when doing this special request (it happens always and only with this request) Xcode stop pointing to
class AppDelegate: UIResponder, UIApplicationDelegate
with no specific failure reason. here's the backtrace (via bt):
* thread #1: tid = 0x6ab4b, 0x00000001051b19c0 libobjc.A.dylib`objc_release + 16, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00000001051b19c0 libobjc.A.dylib`objc_release + 16
frame #1: 0x00000001051b28cd libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 591
frame #2: 0x00000001082348d8 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 207
frame #3: 0x0000000108234a37 CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
frame #4: 0x00000001081043a7 CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 107
frame #5: 0x00000001081d1891 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 273
frame #6: 0x00000001080ef6e6 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 72
frame #7: 0x00000001057c13d4 CoreFoundation`CFArrayApplyFunction + 68
frame #8: 0x00000001080ef5a7 CFNetwork`RunloopBlockContext::perform() + 133
frame #9: 0x00000001080ef3e6 CFNetwork`MultiplexerSource::perform() + 256
frame #10: 0x00000001080ef1fc CFNetwork`MultiplexerSource::_perform(void*) + 72
frame #11: 0x00000001057ee4b1 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #12: 0x00000001057e437d CoreFoundation`__CFRunLoopDoSources0 + 269
frame #13: 0x00000001057e39b4 CoreFoundation`__CFRunLoopRun + 868
frame #14: 0x00000001057e33e6 CoreFoundation`CFRunLoopRunSpecific + 470
frame #15: 0x000000010abdba3e GraphicsServices`GSEventRunModal + 161
frame #16: 0x00000001063cab60 UIKit`UIApplicationMain + 1282
* frame #17: 0x00000001049556b7 App`main + 135 at AppDelegate.swift:13
frame #18: 0x00000001088fd145 libdyld.dylib`start + 1
What i don't get here is that when trying to profile it in instruments or just running it in the simulator without Xcode it works just fine. On the device it crashes on that particular request no matter what.
device backtrace looks a bit different:
* thread #1: tid = 0x19e6ab, 0x0000000192490174 libobjc.A.dylib`objc_release + 20, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x13723bec8)
frame #0: 0x0000000192490174 libobjc.A.dylib`objc_release + 20
frame #1: 0x0000000192491724 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
frame #2: 0x00000001817d2e08 CFNetwork`-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 216
frame #3: 0x00000001817d2f7c CFNetwork`-[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 60
frame #4: 0x00000001816a78e4 CFNetwork`___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 104
frame #5: 0x0000000181770540 CFNetwork`___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 104
frame #6: 0x0000000181693b54 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 76
frame #7: 0x0000000181c10aac CoreFoundation`CFArrayApplyFunction + 68
frame #8: 0x0000000181693a00 CFNetwork`RunloopBlockContext::perform() + 136
frame #9: 0x00000001816938b4 CFNetwork`MultiplexerSource::perform() + 312
frame #10: 0x00000001816936e0 CFNetwork`MultiplexerSource::_perform(void*) + 68
frame #11: 0x0000000181ce69ec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #12: 0x0000000181ce5c90 CoreFoundation`__CFRunLoopDoSources0 + 264
frame #13: 0x0000000181ce3d40 CoreFoundation`__CFRunLoopRun + 712
frame #14: 0x0000000181c110a4 CoreFoundation`CFRunLoopRunSpecific + 396
frame #15: 0x000000018adab5a4 GraphicsServices`GSEventRunModal + 168
frame #16: 0x0000000186542aa4 UIKit`UIApplicationMain + 1488
* frame #17: 0x0000000100069c8c App`main + 164 at AppDelegate.swift:13
frame #18: 0x0000000192ae6a08 libdyld.dylib`start + 4
Any suggestions on how to debug this? Very much appreciated :)

How to fix MP3AudioStream error?

I'm getting the following error randomly (and sometimes consistently on launch). It can happen when there are background threads and when there aren't and it seems to be a problem with the library so I'm having trouble tracking down the problem in my code. The breakpoint triggers on:
#0 0x07bb489b in MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) ()
and the backtrace is as follows:
* thread #1: tid = 0x1c03, 0x07bb489b AudioToolbox`MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) + 2843, stop reason = EXC_BAD_ACCESS (code=2, address=0x4)
frame #0: 0x07bb489b AudioToolbox`MP3AudioStream::GeneratePackets(AudioFileStreamContinuation&) + 2843
frame #1: 0x07b92535 AudioToolbox`AudioFileStreamWrapper::ParseBytes(unsigned long, void const*, unsigned long) + 181
frame #2: 0x07b8f41d AudioToolbox`AudioFileStreamParseBytes + 93
frame #3: 0x07f7a1be MediaToolbox`PushBytesThroughParser + 484
frame #4: 0x07f7a69a MediaToolbox`GetAudioFileStreamPacketAndFrameCount + 221
frame #5: 0x07f7c57e MediaToolbox`FigAudioFileStreamFormatReaderCopyProperty + 225
frame #6: 0x07f9bd1d MediaToolbox`FigPlaybackBossGetDuration + 165
frame #7: 0x07f9f75a MediaToolbox`FigPlaybackBossSetTimeWithRange + 192
frame #8: 0x07f66bef MediaToolbox`itemfig_rebuildRenderPipelinesAndBoss + 10196
frame #9: 0x07f63f01 MediaToolbox`playerfig_prepareWorkingItem2 + 117
frame #10: 0x07f5bdb9 MediaToolbox`playerfig_prepareWorkingItem + 88
frame #11: 0x07f6c536 MediaToolbox`itemfig_assetPropertyBatchLoaded_prepareWorkingItem + 125
frame #12: 0x01bc8758 CoreMedia`figDeferredNotificationRun + 69
frame #13: 0x01de4376 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
frame #14: 0x01de3e06 CoreFoundation`__CFRunLoopDoTimer + 534
frame #15: 0x01dcba82 CoreFoundation`__CFRunLoopRun + 1810
frame #16: 0x01dcaf44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #17: 0x01dcae1b CoreFoundation`CFRunLoopRunInMode + 123
frame #18: 0x02afb7e3 GraphicsServices`GSEventRunModal + 88
frame #19: 0x02afb668 GraphicsServices`GSEventRun + 104
frame #20: 0x00330ffc UIKit`UIApplicationMain + 1211
frame #21: 0x00002a7d FMA`main(argc=1, argv=0xbffff3f0) + 141 at main.m:16
Has anyone had this error and does anyone know how I might go about fixing it?

Mysterious SIGKILL in iPad application running in the simulator

My iPad application has recently been receiving mysterious SIGKILL signals while running in the iOS Simulator. It seems to happen within 2 minutes of application launch, but not every time.
Does this backtrace indicate anything, or should I try removing things until I find the culprit?
There are some components that could be involved; one example is that I recently integrated Crashlytics. Another example is I'm using CLGeocoder to plot a location on an MKMapView, which could explain why the problem happens at some undetermined point after the launch (and why MapKit appears in one of the threads). But without clearer indication from a backtrace or a log, I'm shooting in the dark.
Xcode 4.3.2; targeting iOS 5.
* thread #1: tid = 0x1f03, 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10, stop reason = signal SIGKILL
frame #0: 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x9c2c41f6 libsystem_kernel.dylib`mach_msg + 70
frame #2: 0x0178110a CoreFoundation`__CFRunLoopServiceMachPort + 186
frame #3: 0x016e4550 CoreFoundation`__CFRunLoopRun + 1312
frame #4: 0x016e3d84 CoreFoundation`CFRunLoopRunSpecific + 212
frame #5: 0x016e3c9b CoreFoundation`CFRunLoopRunInMode + 123
frame #6: 0x015af7d8 GraphicsServices`GSEventRunModal + 190
frame #7: 0x015af88a GraphicsServices`GSEventRun + 103
frame #8: 0x00394626 UIKit`UIApplicationMain + 1163
frame #9: 0x00001d4d Tablecloth`main + 141 at main.m:16
frame #10: 0x00001cb5 Tablecloth`start + 53
thread #3: tid = 0x2403, 0x9c2c790a libsystem_kernel.dylib`kevent + 10
frame #0: 0x9c2c790a libsystem_kernel.dylib`kevent + 10
frame #1: 0x020b9372 libdispatch.dylib`_dispatch_mgr_invoke + 918
frame #2: 0x020b7be1 libdispatch.dylib`_dispatch_mgr_thread + 53
thread #5: tid = 0x2603, 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #0: 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x9c2c41f6 libsystem_kernel.dylib`mach_msg + 70
frame #2: 0x0178110a CoreFoundation`__CFRunLoopServiceMachPort + 186
frame #3: 0x016e45d5 CoreFoundation`__CFRunLoopRun + 1445
frame #4: 0x016e3d84 CoreFoundation`CFRunLoopRunSpecific + 212
frame #5: 0x016e3c9b CoreFoundation`CFRunLoopRunInMode + 123
frame #6: 0x03ede420 WebCore`_ZL12RunWebThreadPv + 560
frame #7: 0x93ebced9 libsystem_c.dylib`_pthread_start + 335
thread #6: tid = 0x2703, 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #0: 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x9c2c41f6 libsystem_kernel.dylib`mach_msg + 70
frame #2: 0x0178110a CoreFoundation`__CFRunLoopServiceMachPort + 186
frame #3: 0x016e45d5 CoreFoundation`__CFRunLoopRun + 1445
frame #4: 0x016e3d84 CoreFoundation`CFRunLoopRunSpecific + 212
frame #5: 0x016e3c9b CoreFoundation`CFRunLoopRunInMode + 123
frame #6: 0x00d94e30 Foundation`+[NSURLConnection(Loader) _resourceLoadLoop:] + 398
frame #7: 0x00ca64d6 Foundation`-[NSThread main] + 76
frame #8: 0x00ca6447 Foundation`__NSThread__main__ + 1258
frame #9: 0x93ebced9 libsystem_c.dylib`_pthread_start + 335
thread #7: tid = 0x2803, 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #0: 0x9c2c4c22 libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x9c2c41f6 libsystem_kernel.dylib`mach_msg + 70
frame #2: 0x0178110a CoreFoundation`__CFRunLoopServiceMachPort + 186
frame #3: 0x016e45d5 CoreFoundation`__CFRunLoopRun + 1445
frame #4: 0x016e3d84 CoreFoundation`CFRunLoopRunSpecific + 212
frame #5: 0x016e3c9b CoreFoundation`CFRunLoopRunInMode + 123
frame #6: 0x0012286b MapKit`MKNormalizedPointForLayer + 30057
frame #7: 0x00ca64d6 Foundation`-[NSThread main] + 76
frame #8: 0x00ca6447 Foundation`__NSThread__main__ + 1258
frame #9: 0x93ebced9 libsystem_c.dylib`_pthread_start + 335
thread #8: tid = 0x2903, 0x9c2c6b42 libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
frame #0: 0x9c2c6b42 libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
frame #1: 0x017157cb CoreFoundation`__CFSocketManager + 939
frame #2: 0x93ebced9 libsystem_c.dylib`_pthread_start + 335
thread #9: tid = 0x2a03, 0x9c2c702e libsystem_kernel.dylib`__workq_kernreturn + 10
frame #0: 0x9c2c702e libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x93ebeccf libsystem_c.dylib`_pthread_wqthread + 773
EDIT: The Crashlytics support team helped me debug this, and the thing that seemed to fix it was to use the "Reset Content and Settingsā€¦" menu item in the Simulator app. It's not clear why exactly this happened, but I'm not getting the debugging interruptions anymore.
SIGKILL generally suggests that you were killed by the OS. Your console logs are going to be more useful than the stack traces. If it were on device, I would suspect using too much memory, but that's very unlikely in the simulator. The other common SIGKILL is if you block your main thread too long, so I'd look for that (though I didn't think the simulator provided that one).
But your best place to look is in the run log.

Resources