Symbolicate crash report without the app binary - ios

I'm investigating how to create a server side iOS crash report symbolication server like Crashlitics or Crittercism or HokeyApp, from I can see, they only ask the user to upload the .dSYM file then they are able to symbolicate the crash report, I'm wondering how they archive it? Apple's standard symbolicatecrash command needs the app binary and the .dSYM file being provided together:
Symbolication - resolving stack trace addresses to source code methods and lines - requires the application binary that was uploaded to the App Store and the .dSYM file that was generated when that binary was built. This must be an exact match - otherwise, the report cannot be fully symbolicated. It is essential that you keep each build distributed to users (regardless of the details of that distribution) with its .dSYM file.
Any one knows the detail? Thanks.

Symbolication is the process of translating stack traces into a human-readable form by mapping hexadecimal addresses to function names using symbol file. In other words, Symbolication can be defined as the process of de-obfuscating code symbols with debug symbols removed to both reduce package size and make it harder to reverse engineer. Apteligent automatically symbolicates crashes once you have uploaded your app’s symbol file.
For Apple applications, stack traces are reported in hexidecimal characters. Symbolication allows developers to convert these hex strings into human-readable text.
For more information please refer to and http://support.crittercism.com/articles/knowledge_base/How-does-iOS-Symbolication-work and https://www.apteligent.com/developer-resources/symbolicating-an-ios-crash-report/

Related

Reducing size of dSYM files for symbolication

We are looking for ways to reduce the size of dSYM files from Apple platforms. We need dSYM files just for symbolicating stack traces of crashes and in Crashlytics blog I read this:
These mappings actually hold much more than needed just for
symbolication, presenting some opportunities for optimization. They
have everything required for a generalized symbolic debugger to step
through and inspect your program, which may be a huge amount of
information. On iOS, we have seen dSYMs greater than 1GB in size! This
is a real opportunity for optimization, and we take advantage of this
in two ways. First, we extract just the mapping info we need into a
lightweight, platform-agnostic format. This results in a typical
space-saving of 20x when compared to an iOS dSYM.
Reducing size by 20x sounds very good but I found little information on how this can be done. Do I need to learn details of Mach-O DWARF to achieve this or some of the command line tools can do this? I also wonder if the stripped version can be used direcly afterwards for symbolicating.
Thanks.
Crashlytics converts dSYMs to cSYMs and uses these cSYMs for symbolication. This conversion happens on client's Macs. You might want to look into the final size of this cSYM file that is actually uploaded to crashlytics.

Symbolicating iOS crash dump: symbols not found

I'm trying to symbolicate a crash dump for an iOS app buit using Xamarin.iOS. I am seeing a lot of warning about not being able to find symbols for system binary images such a Foundation, and the output from symbolicate is ultimately missing most of the information that I need.
I'm following the process described here. I have put MyApp.app, MyApp.app.dSYM, and the crash log into a directory and run symbolicate -o crash.txt "crashreport.crash" "MyApp.app". The output crash.txt contains no symbols, and I see a lot of errors in the symbolicate console output. For example:
Finding Symbols:
.fetching symbol file for Foundation--[undef]
Searching []...-- NO MATCH
Searching in Spotlight for dsym with UUID of e596bd80bcc83f15aca36a7ef014f457
Running mdfind "com_apple_xcode_dsym_uuids == E596BD80-BCC8-3F15-ACA3-6A7EF014F457"
#dsym_paths = ( )
#exec_names = ( )
Did not find executable for dsym
## Warning: Can't find any unstripped binary that matches version of /System/Library/Frameworks/Foundation.framework/Foundation
The full output is at http://pastebin.com/W1KP1iTR
I have used dwarfdump to verify that the UUID in MyApp.pSYM is the same as the one in the crash dump.
I'm using Xamarin studio 5.7.1 on with xcode 6.1.1.
Can anyone suggest what is going wrong here?
Apple's symbolicate tool requires that you add all executables and mach-o binaries to Spotlight database prior to querying for symbols.
This of course a tedious job that is required. I could never find how to remove it from the index, or to know what the queue has been completed and the binary with its UUIDs are indexed.
Plug: I wrote this symbolicate-pro tool.
Here's a program I wrote for TestFairy (the company). It's called symbolicate-pro and it has a few key differences that Apple's symbolicate:
It does not require any indexing.
You can specify directories where your iOS symbols are located.
It's 10x faster.
And if you get otool compiled for another OS, it can run on other platforms than Mac.
TestFairy uses it for its production and is updating when iOS changes the crash reports.
You can find it on github at: https://github.com/testfairy/symbolicatecrash-pro
Hope this helps ;)

Programatically generate stack trace in Objective C

I am interested in getting a readable stack-trace when my iPhone/iPad crashes. I would like to send this information to our server once it is trapped. I know there are tools like Crashlytics that do this very well, but we would like to stay away from any 3rd party tools if at all possible. The only way I know to get this info is to manually do it by retrieving the and then have that file symbolicated on a Mac before it can be analyzed. Even doing this can be troublesome if you don't have a copy of the original application binary and the .dSYM file that was generated when that binary was built. I believe Crashlytics does this somehow without the actual binary or the .dSYM file which leads me to believe that a simple stack trace can be generate programmatically. Has anyone done this or have any pointers as to how I could do this within Objective C so that I could send that information to our servers for Error reporting?
Is it at all possible to get a create a readable stack-trace within Objective C on my iOS device without having to first send that file to a Mac with both the actual binary or the .dSYM file?
Just use
[NSThread callStackSymbols]

NSThread callStackSymbols logs <redacted> symbols

I am trying to debug some concurrency code and when I log [NSThread callStackSymbols]; the console shows most of the symbols I am interested in as <redacted>.
Is there a way to get around this during runtime? I have deleted the device symbols folder but Xcode re-symbolication didn't seem to fix the issue.
There are a few other questions on here but they all seem to be trying to solve this on crash files.
How can I see the method names for framework symbols in the debug console?
I am running Xcode 5.
You get all symbols showing up only:
while debugging
when generating a full crash report and symbolicate that.
symbolicating the addresses manually using atos with the corresponding dSYM or system symbols on disk (you need to load address for each framework and binary to do that, also due to Address space layout randomization. Only having callStackSymbols doesn't reveal those). See iOS crash reports: atos not working as expected
The <redacted> symbols are a
Memory optimization. The <redacted> symbol names are stored on disk only, which saves some physical memory and lots of virtual address space in every process.
See https://devforums.apple.com/thread/171264
To sum up: you can NOT get all system symbols showing up using any calls during runtime. Instead you need to create a full crash report by letting the app crash and analyse the stack traces from those.

Symbolicate Crash Log when App Name Contains Apostrophe and Space (Deployed App)

I have an app on the App Store that is crashing. I have tried several of the solutions on SO to symbolicate my app, using at different times the Organizer, the Terminal, and Instruments. Nothing has worked so far - the lines in the reports from the methods in my app are never symbolicated, even when the lines for Apple methods are. After looking around for a while, it seems as though this might have something to do with the app name, which is along the lines of "Angie's List" - with both an apostrophe and a space. It is too late to change the app name now as it is live on the store. I haven't seen a solution to this anywhere and would appreciate a shove in the right direction.
Usually the app name doesn't matter, unless there is a bug in the symbolication script which I doubt. Did you check if you have the correct dSYM available?
If you scroll down your latest crash log, check the 1st line below Binary Images, it will look like this
0x1000 - 0x24cfff +YourApp armv7 <f6012c517d783486ab53e45d948b92a2> /var/mobile/Applications/A8EC3C1F-44AF-169A-BC0E-FBBC0F04CDF5/YourApp.app/YourApp
f6012c517d783486ab53e45d948b92a2 is the UUID of the executable the caused the crash.
You can find the correct dSYM using the terminal as follows:
mdfind "com_apple_xcode_dsym_uuids == F6012C51-7D78-3486-AB53-E45D948B92A2"
The string F6012C51-7D78-3486-AB53-E45D948B92A2 is the above string reformatted to uppercase and 8-4-4-4-12 groups. I guess this command will not return anything.
If you have a dSYM (e.g. in an .xcarchive), you can check its UUID in the terminal as follows:
dwarfdump --uuid YourApp.app.dSYM
If symbolication doesn't work automatically, you can try to do it manually by following the instructions posted here: iOS crash reports: atos not working as expected
If the application has special characters like spaces or apostrophe's in it, the default Apple toolchain will not be able to symbolicate it. The reason is that the tool otool, which being used in the toolchain, can't handle that. No matter how you pass the filename. So to fix this, you have to do the following:
Rename the dSYM package and remove all special chars, e.g. from My App's.app.dSYM to MyApps.app.dSYM
Open the content inside the package and navigate down to Contents/Resources/DWARF
Rename the file in there as you did above
Now try again. Best way to avoid all this: NEVER use special chars in your apps name. If you want the adjust the name that appears on the screen, use CFBundleDisplayName or the corresponding plist entries.

Resources