How do I symbolicate a crash report of a Mac OS X app that a user emailed to me?
Asked Answered
P

3

10

I am working on an app that I have sent to a few beta testers. Within just a few minutes of launching the app a user got a crash. When the window poped up saying the app had crashed he copied all of the text in the details section and emailed it to me. I have saved the text into a plain text file and given it the .crash extension which causes it to be opened by console like a regular crash report so I think I have the extension right (but maybe not). The version I sent out was built by Xcode with the Archive option so Xcode knows where the app and .dSYM are. I know that with iPhone apps you can drag a crash report to the organizer and Xcode will symbolicate it for you. I can not find anywhere that will take a Mac crash report. I have looked at atos but it talks about memory locations including the location the app was running at and I don't see that information listed in the report I have. Looking at the raw crash report it looks like a view controller was released early but I can't really tell if that was the cause or a symptom. My real question is; is there a way to have Xcode symbolicate the report or a tool that I can just hand over the .dSYM file, app, and report and get back a symbolicated report? I've looked all over Google but everything I find (other than the previously mentioned man pages for atos) is about symbolicating iPhone reports, not Mac OS X ones.

Plio answered 22/5, 2011 at 2:49 Comment(2)
What is "symbolicate"? Or should I ask that on english.stackexchange.com ??Epideictic
"Symbolicate" is when you add the debugger symbols that you stripped out for a release build back in. You have to have the .dSYM file for the exact build the crash came from to do it.Plio
M
3

Or as in answer https://mcmap.net/q/1168345/-os-x-crash-log-symbolication

Put your release build and your .dSYM file in the same directory and open terminal

$cd directory
$lldb MyApp.app
(lldb) image lookup -v --address 0x00085f3c
Milord answered 28/8, 2013 at 10:45 Comment(1)
I was looking so long for a good answer on this question. Now just submitted two bugreports to Apple: 1) Add a .crash file to Xcode > Devices > Library > Device Logs > Import as it's possible for iOS 2) make atos run for .app with space in the nameMilord
V
1

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

Edit: Improved the answer such that it aligns with the Stack Overflow answer policy.

Viens answered 26/2, 2016 at 12:14 Comment(5)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewRevanche
@Revanche The link doesn't answer the question. It's a link to a library that the answerer used to solve the problem. This provides a solution to the question is there a way to have Xcode symbolicate the report or a tool that I can just hand over the .dSYM file, app, and report and get back a symbolicated report? and this provides a way.Dolomite
If it doesn't answer the question it shouldn't be an answer. If it does answer the question but doesn't include the relevant parts directly in the answer it shouldn't be an answer.Revanche
Thank you @Revanche for clarifying the StackOverflow policy. I will edit my answer accordingly.Viens
@Dolomite Should I add the complete script to my answer?Viens
A
0

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  
Andersen answered 21/8, 2013 at 7:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.