Often bugs don't crash an application right away but merely lead to it becoming unresponsive or "hanging".

When I'm approached with such issues in my software, the first thing I ask for is a sample log obtained through Activity Monitor.

Because the public builds of my software don't contain any debug symbols, I only see ??? and a code offset for those spots that reference my code.

There are tools and services out there to symbolicate crash reports, but I'm not aware of anything such for sample logs, which have a different format.

So here's what I do to resolve symbols in sample logs that I receive.

Let's start with a sample log:

Sampling process 3812 for 3 seconds with 1 millisecond of run time between samples Sampling completed, processing symbols... Analysis of sampling Remote Buddy (pid 3812) every 1 millisecond Process: Remote Buddy [3812] Path: /Applications/Remote Buddy.app/Contents/MacOS/Remote Buddy Load Address: 0x1000 Identifier: com.iospirit.RemoteBuddy Version: 1.25 (1.25) Code Type: X86 [..] Call graph: 2568 Thread_3519212 DispatchQueue_1: com.apple.main-thread (serial) + 2568 ??? (in Remote Buddy) load address 0x1000 + 0x1315 [0x2315] + 2568 ??? (in Remote Buddy) load address 0x1000 + 0x13ee [0x23ee] + 2568 ??? (in Remote Buddy) load address 0x1000 + 0x1548 [0x2548] [..] Binary Images: 0x1000 - 0x1edfe7 +com.iospirit.RemoteBuddy (1.25 - 1.25) <B7BE5172-CEBA-3128-3805-4F81A1FCCA21> /Applications/Remote Buddy.app/Contents/MacOS/Remote Buddy

To resolve the symbols, I need the dSYM that was created alongside the build this sample was taken from. Each dSYM and app share a unique UUID. Here, it's B7BE5172-CEBA-3128-3805-4F81A1FCCA21.

To verify that you're using the correct dSYM, you can print the UUID of your dSYM using dwarfdump --uuid on the DWARF file in your dSYM:

xcrun dwarfdump --uuid "Remote Buddy.app.dSYM/Contents/Resources/DWARF/Remote Buddy"

If your dSYMs were indexed by Spotlight, you can also search for the UUID in Spotlight to find the dSYM corresponding to the sample log you received.

Using the Code Type, the Load Address and the code offsets in the Call graph, I can now take to the Terminal to resolve the numbers into symbols.

For a Code Type of x86, the Architecture is i386, for a Code Type of X86-64, the architecture is x86_64.

To open an interactive prompt, I type

atos -arch [Architecture] -o [DWARF file] -l [Load Address]

or

atos -arch i386 -o "Remote Buddy.app.dSYM/Contents/Resources/DWARF/Remote Buddy" -l 0x1000

in this example. I can then enter code offsets to resolve them into symbols:

felix $ atos -arch i386 -o "Remote Buddy.app.dSYM/Contents/Resources/DWARF/Remote Buddy" -l 0x1000 got symbolicator for Remote Buddy.app.dSYM/Contents/Resources/DWARF/Remote Buddy, base address 1000 0x2315 start (in Remote Buddy) + 41 0x23ee _start (in Remote Buddy) + 216 0x2548 main (in Remote Buddy) (main.m:79)

Press Ctrl+C to exit the interactive prompt.

And that's it!

 
Next post
Previous post