Question

My app is written both in objective c and c++. I'm using xcode 4.5 and of course I have developer account, my device is not jailbroken and I've set up everything in my developer account ok. I do not use "Device Logs" from xcode, instead I've implemented signals/exceptions handlers to write stack traces to file and - when next time app launches - send it to my webserver.

To get stack trace on crash I use [NSException callStackSymbols]. It works. So when I do sample crash like:

NSArray *arr=[NSArray array];
[arr objectAtIndex:100];

while debugging in xcode and launching installed from xcode app on device I get:

0 CoreFoundation 0x36c738a7 __exceptionPreprocess + 186
  1 libobjc.A.dylib 0x3308a259 objc_exception_throw + 32
  2 CoreFoundation 0x36bcb23d -[__NSArrayI objectAtIndex:] + 164
  3 MyApp 0x001be505 _ZN8Menu6handleEN12GestureE + 912
  4 MyApp 0x000e6ce1 _ZN13BaseLevel10handleBaseEN12GestureE + 440
  5 MyApp 0x0011b747 _ZN12Manager6handleEN12GestureE + 742
  6 MyApp 0x00102731 _ZN13Processor9doProcessEd + 552
  7 GLKit 0x3723a0c5 -[GLKViewController _updateAndDraw] + 272
  8 CoreFoundation 0x36bd27d3 -[NSObject performSelector:] + 38
  9 QuartzCore 0x3233486f _ZN2CA7Display11DisplayLink8dispatchEyy + 166
  10 QuartzCore 0x323347c5 _ZN2CA7Display16IOMFBDisplayLink8callbackEP21__IOMobileFramebufferyyyPv + 60

MyApp c++ and objc classes and methods are symbolicated ok.

But when I make AdHoc ipa, and do the same crach in it I get:

0 CoreFoundation 0x36c738a7 __exceptionPreprocess + 186
  1 libobjc.A.dylib 0x3308a259 objc_exception_throw + 32
  2 CoreFoundation 0x36bcb23d -[__NSArrayI objectAtIndex:] + 164
  3 MyApp 0x001be505 _mh_execute_header + 894213
  4 MyApp 0x000e6ce1 _mh_execute_header + 11489
  5 MyApp 0x0011b747 _mh_execute_header + 227143
  6 MyApp 0x00102731 _mh_execute_header + 124721
  7 GLKit 0x3723a0c5 -[GLKViewController _updateAndDraw] + 272
  8 CoreFoundation 0x36bd27d3 -[NSObject performSelector:] + 38
  9 QuartzCore 0x3233486f _ZN2CA7Display11DisplayLink8dispatchEyy + 166
  10 QuartzCore 0x323347c5 _ZN2CA7Display16IOMFBDisplayLink8callbackEP21__IOMobileFramebufferyyyPv + 60]

i.e. names of my classes and methods are gone, replaced by symbol _mh_execute_header+<offset>.

I thought I've missed dSYM setting, but it is on for both release and debug, also "strip debug symbols" is off.

Have searched on SO, but no luck. Please tell me what's wrong?

Was it helpful?

Solution

My bad, I was not familar with symbolicate techs. In short - to symbolicate stack trace you need dSYM of package and xcode to symbolicate the crash log with its private api. Maybe next time I'll write more: still learning how to do it in the most convenient (for me) way.

Edit: a week has passed, and I've developed a solution. It's specific to my multiplatform ecosystem, but here how it works in short. App crashes and sends crash log with all needed data to my server. When I want to see crash logs, I launch utility on my desktop which downloads all the stacks (from release/arm binaries) from the server, which are not proccessed yet. Next it finds corresponding bundles in Xcode Archives folder (gets uuids/vmaddr for arch needed), then calculates real addresses of stack lines (using binary vmaddr and _mh_execute_header address from received log) and calls atos for every address. Then it parses output of atos, generate diff and sends it back to server. This way I can see symbolicated stacks in my php-based bugtracker. It was not so easy, as getting deobfuscated stacks in java, but still it's possible.

OTHER TIPS

You can use this Symbolication tool I wrote to quickly Symbolicate your app's addresses.

symbolication your.app.dSYM your.app.trace

The symbolicated version will be printed to STDOUT. For best results, keep your .app in the same folder as your .dSYM.

https://github.com/Imperiopolis/Symbolication

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top