Symbolicating iOS Crash Logs

Crashes happen. So its important to be able to find the root of the problem and fix it. Often times, all we have to go on are iphone crash logs with stack traces. Here is a nice way to convert those ambiguous stacktraces into meaningful function names and line numbers.

To translate the symbols, we will be using the atos commandline utility. You will also need the dSYM file created when your app was built. It can be found in the build dir named something like ‘build/[yourappname].app.dSYM’

Now take a look at your crash log. It will look something like this:

I have pointed out the important bits to note. Number 1 indicates the stack symbol offset. Number 2 indicates the load address of my app’s main module (named Burst). Every time an iOS app starts up, it will load the main module in a different memory address. The dSYM file however, assumes that your main module is loaded at address 0x1000. Therefor, we cannot simply use the actual address of the symbol in the stacktrace. Instead, we have to compute it ourselves using the symbol offset.

To translate the symbol 60589 in the above crash log, I add 0x1000 + 60589 = 0xFCAD. (remember that 60589 is in decimal) Then I use atos:

[code]atos -arch armv7 -o ‘path/to/dsymb/file’ 0xFCAD[/code]

Paul Soucy

Read more posts by this author.