When symbolicating crash reports, I noticed that line numbers are off. I tested this with a project in which I deliberately cause a crash. It seems the generated line number do not include certain lines, e.g. comment lines or compiler preprocessor statements (not sure what it does and does not include)...
Is there an easy way to get from the "off" line number in the symbolicated crash report to the actual line of code in the source?
Edit: An example of a line in a symbolicated crash report:
7 Luisterpaal 0x00005de2 -[SWFMP3 connection:didReceiveData:] (SWFMP3.m:320)
So, the line number 320 is almost correct, but not exactly. It's a few lines off...
You can access the crash log in macOS in two ways: Launch Finder, press Command + Shift + G, and type ~/Library/Logs/DiagnosticReports/ in the Go to Folder dialog box. Launch Console, and look for Diagnostic Reports located under ~/Library/Logs/.
To find the crash files, you can run Console app which will display all the system messages. If any specific application crashed, look in User Reports. If it's system crash, check in System Reports. Once you have found the crash file, you can Reveal in Finder (usually located in ~/Library/Logs/DiagnosticReports ).
In a word… no. If you're looking at a line like this in a crash report:
0 com.apple.CoreFoundation 0x95cb046b CFArrayAppendValue + 43
The "+43" isn't a line number, but a memory location from the beginning of the function. The code as you wrote it simply doesn't exist in the compiled binary - the compiler optimises and changes the code (in a Release build, at least) around so it most often doesn't match what you wrote.
Unfortunately, the solution is to provide the person experiencing the crash with a debug version that you can remote debug or at least throw out NSLog() statements to help track it down, and/or write smaller methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With