iOS Crash without Error or Stack Trace

MarkPowell picture MarkPowell · Jan 26, 2011 · Viewed 22.7k times · Source

Having a hard time tracking down a crash in an iPad application. The difficulty really stems from the fact that there is no errors or stack trace present when the application fails. It simply goes away like Keiser Soze, "And like that, poof. He's gone.".

I've replicated the crash on both the simulator and the device. There are zero device logs, nothing in the console, etc.

I know that during the crash some CoreGraphics operations are occurring in a background thread. Typically, three or so NSOperations are kicking of some image blends.

The blending consists of CGContext* calls (DrawImage, SetBlendMode, SetAlpha, etc). The NSOperation calls back to a delegate in the main thread to handle the image and set it to UIImage, so it shouldn't be a UI main thread conflict, but I'm not discounting anything at this point.

Are there some Xcode tricks I'm missing to track down exactly what is happening? Or at least get a better hint of where the problem lies?

EDIT I have run the app in Instruments tracking memory usage and see that it is pretty rock steady around 2MB. So, don't think it's a memory issue. But after consideration, this rock steady 2MB seems abnormally low. Is there a chance Instruments is not picking up the CoreGraphics allocations?

Answer

shrishaster picture shrishaster · May 8, 2014

Try reading the registers.

Whenever my app crashes without error, in most cases I have found the exception in the registers.

First go to Exceptions tab and 'Add Exception Breakpoint' using the + at the bottom left corner. enter image description here

Then when the app crashes click on "0 objc_exception_throw" under Thread 1 enter image description here

Finally in the console enter:

  • register read (you should get a list of registers)

  • po $rax (normally the exception is in 'rax')

    (you should see the exception output on the console)

Hope this helps.