Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Crash without Error or Stack Trace

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?

like image 600
MarkPowell Avatar asked Jan 26 '11 21:01

MarkPowell


People also ask

Why does my iOS app keep crashing?

Most often, apps crash because they aren't updated and have unaddressed bugs. To fix this, go to the Updates section of the App Store and update the app if an update is available.

How do I view iOS crash logs?

You can use the Mac Console app to view any crash logs from your Mac or from the Simulator. And on the device under Settings, Privacy, Analytics, Analytics Data you can see all of the logs that are saved to disk and your users can share a log directly from this screen.


1 Answers

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.

like image 79
shrishaster Avatar answered Sep 20 '22 03:09

shrishaster