4

this is my first question on StackOverflow, hopefully it is a pertinent one! To try to put you in context, I have an odd crash in my application when I try to open the camera with the PresentViewController method. I tried looking into the crash reports, but I do not have any call details, only hexadecimal as following:

 Thread 0 Crashed: 
 0   libsystem_kernel.dylib         0x38a97350 0x38a86000 + 70480
 1   libsystem_c.dylib              0x35d3a11e 0x35d0b000 + 192798
 2   libsystem_c.dylib              0x35d7696e 0x35d0b000 + 440686
 3   (project_name)                 0x00882968 0x1000     + 8919400
 4   (project_name)                 0x0083db7c 0x1000     + 8637308
 5   libsystem_c.dylib              0x35d43e90 0x35d0b000 + 233104
 6   UIKit                          0x39d40b00 0x39d3b000 + 23296
 7   QuartzCore                     0x34c52ff2 0x34c4c000 + 28658
 8   QuartzCore                     0x34c52fa2 0x34c4c000 + 28578
 9   QuartzCore                     0x34c52e8e 0x34c4c000 + 28302
 10  QuartzCore                     0x34c4e9ba 0x34c4c000 + 10682
 11  QuartzCore                     0x34c4e876 0x34c4c000 + 10358
 12  QuartzCore                     0x34c4e806 0x34c4c000 + 10246
 13  UIKit                          0x39d3fae8 0x39d3b000 + 19176
 14  UIKit                          0x39d4271e 0x39d3b000 + 30494
 15  UIKit                          0x39d84a6c 0x39d3b000 + 301676
 16  PhotoLibrary                   0x381c39ca 0x38157000 + 444874
 17  UIKit                          0x39d417fe 0x39d3b000 + 26622
 18  QuartzCore                     0x34c4fd5e 0x34c4c000 + 15710
 19  QuartzCore                     0x34c4f8fc 0x34c4c000 + 14588

Anyways, since my crash report is inconclusive (in my opinion), I googled how to usually handle memory issues for iOS and NSZombieEnabled and Enabling Guard Malloc have ben mentioned. NSZombieEnabled is enabled by default in Monotouch, but I didn't find anywhere how to Enable Guard Malloc. Is it even possible for Monotouch? Thank you!

airpaulg
  • 565
  • 3
  • 13

1 Answers1

3

Without proper stack traces any other debugging tool will be pretty much useless.

You need to symbolicate the crash report - or figure out why yours doesn't symbolicate properly. Usually Xcode does it automatically (it takes a few seconds after you've opened the crash report though), but it requires Spotlight to find the debugging information, so if Spotlight isn't indexing your project directory this is one of the consequences. Another thing that trips up symbolication sometimes is if the solution/project/executable name aren't identical.

You should also look in the device log, many times the exact reason for the crash is printed out there (even with instructions on how to fix it). Here is a guide on how to find the device logs if haven't seen them before.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86
  • Hello Rolf, first of all thank you for your time! I had another native crash (unrelated bug) on the simulator, but this one was well symbolicated. I do not understand why the bug posted here (that occurred on the device) wasn't. At first glance, I already tried what you've written in your guide. I found an answer in this [thread](http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports) that could be helpful. Even if it doesn't solve the problem, your answer pretty much answers my question and made me realize I might not be following the right path, thanks you! – airpaulg Nov 28 '12 at 14:46
  • If it is any insightful, I am pretty sure it's an out of memory type of error since I generate a lot of UIImages using the camera and I receive memory warnings. IMO I was not disposing UIImages properly and it ended up crashing. It always crashes when I open the camera again, so I'd figure it's a memory consuming operation. Is it typical for out of memory crashes to give obscure crash logs? – airpaulg Nov 28 '12 at 14:51
  • It's not the type of crash that makes the crash log not symbolicate, it's something else on your system. What happens if you try to create a new project from a template - does a crash symbolicate then? (You can easily crash an app by provoking a stack overflow). That said, you usually don't crash due to out of memory conditions on iOS, you're killed by the OS when you use too much memory. – Rolf Bjarne Kvinge Nov 28 '12 at 17:32
  • I have a created a new project on another location on my disk and provoked a stack overflow as recommended. Now my log is even less comprehensible (this line multiple times 0 ??? 0x0cff9c69 0 + 218078313) I guess something else must be preventing the crash from symbolicating. When I follow your guide though, I do not get the crash pop-up that you mention when my app closes. – airpaulg Nov 28 '12 at 18:33
  • I'll be using the atos -arch approach for now, but if I could figure out why my crash reports are not symbolicating it would be great! – airpaulg Nov 28 '12 at 18:42
  • symbolicatecrash -v ... will usually give some diagnostics. – Rolf Bjarne Kvinge Nov 28 '12 at 21:36