Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OS X Crash Log Symbolication

I cannot symbolicate OS X (not iOS) crash logs from testers and users using XCode 4.6 . The crash logs cannot be dragged into the organizer, and the organizer does not show any crash logs from ~/Library/Logs/DiagnosticReports/, though some logs are in that directory.

Didier Malenfant commented on a previous thread XCode not importing OS X crash log that

The bottom line is quite simple. As of now (Xcode 4.6), OS X crash logs cannot be imported into Xcode. Only iOS ones.

Is this the current state of affairs? It’s hard to imagine that organizations are able to support new OS X software without effective ways to intepret crash reports.

like image 433
Mark Bernstein Avatar asked Jul 05 '13 18:07

Mark Bernstein


People also ask

How do you Symbolicate a crash log?

To symbolicate in Xcode, click the Device Logs button in the Devices and Simulators window, then drag and drop the crash report file into the list of device logs. Crash reports must have the . crash file extension. If a crash report doesn't have a file extension, or has a different file extension like .

Where are crash logs stored macOS?

However, the crash log files are stored in the user's ~/Library/Logs/DiagnosticReports/ folder. Mac OS X 10.5 (Leopard): Crash logs are stored in the same location, but multiple crashes are no longer written to a single file. Each crash is written to a uniquely named crash log file.

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.


3 Answers

If you have a stack trace; for example:

0   com.your_app        0x00000001016191e0 0x1015fb000 + 123360
1   com.your_app        0x000000010161509d 0x1015fb000 + 106653
2   com.your_app        0x00000001016147b9 0x1015fb000 + 104377
3   com.your_app        0x000000010161df81 0x1015fb000 + 143233`

Try the following:

atos -o YOUR_APP.app.dSYM/Contents/Resources/DWARF/YOUR_APP -l 0x1015fb000 0x00000001016191e0 0x000000010161509d 0x00000001016147b9 0x000000010161df81`
like image 131
w00t Avatar answered Oct 12 '22 11:10

w00t


You can use GDB for Symbolication, Put your release build and your .dSYM file in the same directory open terminal

$ cd directory
$ gdb MyApp.app
(gdb) info line *0x00085f3c  

or you can use atos as suggested by trojanfoe

$cd directory
$atos -o MyApp.app/Contents/MacOS/MyApp
info 0x00085f3c

or

$ cd directory
$ lldb MyApp.app
(lldb) image lookup -v --address 0x1ec4
like image 3
Parag Bafna Avatar answered Oct 12 '22 13:10

Parag Bafna


We had the same problem with our app and I was symbolicating the crash reports manually line by line with atos.

I now tweaked Apple's symbolicate script such that it works with Mac apps and crash reports from PLCrashReporter.

https://github.com/lksnmnn/Symbolicate-CrashReports

How to use it:

Make sure you have all of the following files on your computer:

  1. The crash report: report.crash
  2. The dSYM file of your app: MyApp.dSYM
  3. The executable / app folder of your app: MyApp.app
  4. The improved symbolicate script: symbolicatecrash

Now go in the command line (Terminal) and do the following:

# set the developer directory
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

# Now run the script
/Path/To/symbolicatecrash /Path/To/report.crash > /Path/To/readable_report.crash

# Use -v for verbose logging.

The script will find your dSYM and your executable and symbolicates as much as it cans. You will now find your symbolicated report in the stated output file readable_report.crash

Build settings:

For proper reports and symbols, set your build settings to this:

Strip Debug Symbols During Copy: Yes
Strip Style: All Symbols
Strip Linked Product: Yes
like image 2
Lukas Neumann Avatar answered Oct 12 '22 11:10

Lukas Neumann