Skip to content

Instantly share code, notes, and snippets.

@0xch4z
Last active April 14, 2020 16:36
symbolication instructions

Table of Contents

  1. Obtaining a .dSYM for a build
  2. Enabling crash logging
  3. Diagnosing a crash

Obtaining a dSYM

  1. Login to iTunes Connect
  2. Go to the Scry app.
  3. Navigate to the "Activity" section.
  4. Find the corresponding build.
  5. Downloaf the dSYM.

Enabling crash logging

  1. On your iPhone, open the settings App.
  2. Go to the privacy section.
  3. Select "Analytics".
  4. Switch "Share iPhone & Watch Analytics" on.
  5. Switch "Share with App Developers" on.

Diagnosing a crash

  1. Make your iPhone crash on a release build & obtain the .dSym
  2. Sync your phone with iTunes. Recent crashes should be transfeered to itunes.
  3. Upon completion, open terminal and cd ~/Library/Logs/CrashReporter/MobileDevice/*
  • If the one of the above directories could not be resolved or the directory is empty (known bug with iTunes 12.7|Sierra):
    1. On your iPhone, open the settings App.
    2. Go to the privacy section.
    3. Select "Analytics"
    4. Select "Analytics Data"
    5. Scroll down to find the crash log prefixed with "Scry" from the date/time your are trying to find.
    6. Click the share navigation bar item.
    7. Email the log to yourself.
  • If the directory has logs
    1. Open the directory in the text editor of your choosing.
    2. Traverse the file tree the crash log prefixed with "Scry" from the date/time you are tying to find.
  1. Open the log file.
  • If the file does not have the extension .crash (eg: .ips): rename it to use.ips
  • Should look similar to the following:
  {"app_name":"Scry","timestamp":"2017-11-19 03:18:13.49 -0500","app_version":"1.0.7","slice_uuid":"0f63f51e-c1cf-39a1-9616-bb72b32d1431","adam_id":1260397992,"build_version":"2","bundleID":"com.scry.Scry3","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.0.3 (15A432)","incident_id":"FD89E293-0850-43BE-9A87-654F9DEFE299","name":"Scry"}
  Incident Identifier: FD89E293-0850-43BE-9A87-654F9DEFE299
  CrashReporter Key:   9ab37eaecfcae77047e19ab0201e130b0253a649
  Hardware Model:      iPhone9,2
  Process:             Scry [5477]
  Path:                /private/var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Scry
  Identifier:          com.scry.Scry3
  Version:             2 (1.0.7)
  Code Type:           ARM-64 (Native)
  Role:                Foreground
  Parent Process:      launchd [1]
  Coalition:           com.scry.Scry3 [2367]


  Date/Time:           2017-11-19 03:18:12.8811 -0500
  Launch Time:         2017-11-19 01:56:36.1410 -0500
  OS Version:          iPhone OS 11.0.3 (15A432)
  Baseband Version:    3.00.00
  Report Version:      104

  Exception Type:  EXC_CRASH (SIGKILL)
  Exception Codes: 0x0000000000000000, 0x0000000000000000
  Exception Note:  EXC_CORPSE_NOTIFY
  Termination Reason: Namespace <0xF>, Code 0x8badf00d
  Triggered by Thread:  0

  Filtered syslog:
  None found

  Thread 0 name:  Dispatch queue: com.apple.main-thread
  Thread 0 Crashed:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   GraphicsServices              	0x00000001837fbf84 0x1837f1000 + 44932
  6   UIKit                         	0x000000018af17880 0x18aea4000 + 473216
  7   Scry                          	0x000000010093d62c 0x100938000 + 22060
  8   libdyld.dylib                 	0x000000018148e56c 0x18148d000 + 5484

  Thread 1 name:  com.apple.uikit.eventfetch-thread
  Thread 1:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   Foundation                    	0x00000001823926e4 0x182386000 + 50916
  6   Foundation                    	0x00000001823b1afc 0x182386000 + 178940
  7   UIKit                         	0x000000018ba6302c 0x18aea4000 + 12316716
  8   Foundation                    	0x0000000182493860 0x182386000 + 1103968
  9   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  10  libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  11  libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 2 name:  com.twitter.crashlytics.ios.MachExceptionServer
  Thread 2:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   Scry                          	0x0000000100a29708 0x100938000 + 988936
  3   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  4   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  5   libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 3 name:  com.apple.NSURLConnectionLoader
  Thread 3:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   CFNetwork                     	0x00000001820d3b40 0x182025000 + 715584
  6   Foundation                    	0x0000000182493860 0x182386000 + 1103968
  7   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  8   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  9   libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 4:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   Foundation                    	0x00000001823926e4 0x182386000 + 50916
  6   Rollbar                       	0x0000000101293838 0x101288000 + 47160
  7   Foundation                    	0x0000000182493860 0x182386000 + 1103968
  8   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  9   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  10  libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 5:
  0   libsystem_kernel.dylib        	0x00000001815bd150 0x18159c000 + 135504
  1   libsystem_pthread.dylib       	0x00000001816d2d40 0x1816ce000 + 19776
  2   libc++.1.dylib                	0x0000000180f3bea4 0x180f34000 + 32420
  3   JavaScriptCore                	0x0000000188ce8b30 0x1883a3000 + 9722672
  4   JavaScriptCore                	0x0000000188ce8a58 0x1883a3000 + 9722456
  5   JavaScriptCore                	0x0000000188ce8dbc 0x1883a3000 + 9723324
  6   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  7   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  8   libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 6 name:  com.apple.CFNetwork.CustomProtocols
  Thread 6:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   CFNetwork                     	0x0000000182252928 0x182025000 + 2283816
  6   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  7   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  8   libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 7 name:  com.apple.CFSocket.private
  Thread 7:
  0   libsystem_kernel.dylib        	0x00000001815bd570 0x18159c000 + 136560
  1   CoreFoundation                	0x0000000181a5421c 0x181962000 + 991772
  2   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  3   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  4   libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 8 name:  AVAudioSession Notify Thread
  Thread 8:
  0   libsystem_kernel.dylib        	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   AVFAudio                      	0x0000000187233774 0x1871af000 + 542580
  6   AVFAudio                      	0x000000018725e018 0x1871af000 + 716824
  7   libsystem_pthread.dylib       	0x00000001816d032c 0x1816ce000 + 9004
  8   libsystem_pthread.dylib       	0x00000001816d01f8 0x1816ce000 + 8696
  9   libsystem_pthread.dylib       	0x00000001816cec38 0x1816ce000 + 3128

  Thread 9:
  0   libsystem_pthread.dylib       	0x00000001816cec2c 0x1816ce000 + 3116

  Thread 10:
  0   libsystem_pthread.dylib       	0x00000001816cec2c 0x1816ce000 + 3116

  Thread 11:
  0   libsystem_pthread.dylib       	0x00000001816cec2c 0x1816ce000 + 3116

  Thread 12:
  0   libsystem_pthread.dylib       	0x00000001816cec2c 0x1816ce000 + 3116

  Thread 0 crashed with ARM Thread State (64-bit):
      x0: 0x0000000010004005   x1: 0x0000000007000806   x2: 0x0000000000000000   x3: 0x0000000000000c00
      x4: 0x0000000000002603   x5: 0x00000000ffffffff   x6: 0x0000000000000000   x7: 0x0000000000000001
      x8: 0x00000000fffffbbf   x9: 0x0000000007000000  x10: 0x0000000007000100  x11: 0x0000000000000040
    x12: 0xffffffffffffffff  x13: 0x0000000000000001  x14: 0x0215540002155400  x15: 0x0000000000000000
    x16: 0xffffffffffffffe1  x17: 0x00000000ffffffff  x18: 0x0000000000000000  x19: 0x0000000000000000
    x20: 0x00000000ffffffff  x21: 0x0000000000002603  x22: 0x0000000000000c00  x23: 0x000000016f4c6d68
    x24: 0x0000000007000806  x25: 0x0000000000000000  x26: 0x0000000007000806  x27: 0x0000000000000c00
    x28: 0x0000000000000001   fp: 0x000000016f4c6c60   lr: 0x000000018159ca3c
      sp: 0x000000016f4c6c10   pc: 0x000000018159cbc4 cpsr: 0x60000000

  Binary Images:
  0x100938000 - 0x100aa3fff Scry arm64  <0f63f51ec1cf39a19616bb72b32d1431> /var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Scry
  0x100b14000 - 0x100b2bfff Bolts arm64  <5e3164d5ab013efc91ec5cf562cc5746> /var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Frameworks/Bolts.framework/Bolts
  0x100b3c000 - 0x100b47fff DACircularProgress arm64  <6a01204b69303fcdba2ca648978e2852> /var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Frameworks/DACircularProgress.framework/DACircularProgress
  0x100b54000 - 0x100b6ffff FBSDKLoginKit arm64  <453adce91cf63f7f90989fc57c896196> /var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Frameworks/FBSDKLoginKit.framework/FBSDKLoginKit
  0x100b84000 - 0x100bc3fff dyld arm64  <113803ec7f6936e6b06abef57a8755fd> /usr/lib/dyld
  0x100c20000 - 0x100c9ffff Alamofire arm64  <dd0d93f398b63bfaae6d130d04d1476f> /var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Frameworks/Alamofire.framework/Alamofire   
  0x100cc8000 - 0x100d1ffff FBSDKCoreKit arm64  <ccea46b697ec354080720d9de111d00a> /var/containers/Bundle/Application/848A7FA5-   1251-4841-9196-
  1. Look up documentation for any Exception * or Termination * information if provided (toward the top).
  • If the problem is stemming from a system service, this could tell us a lot.
  1. Examine the stack frame for the corresponding thread that the crash occured on.
  • In the case of the above binary, the exception is rooted in a sys library. But say it was stemming from our code, we might see:
  Thread 0 name:  Dispatch queue: com.apple.main-thread
  Thread 0 Crashed:
  0   Scry                           	0x000000018159cbc4 0x18159c000 + 3012
  1   libsystem_kernel.dylib        	0x000000018159ca3c 0x18159c000 + 2620
  2   CoreFoundation                	0x0000000181a4bce4 0x181962000 + 957668
  3   CoreFoundation                	0x0000000181a498b0 0x181962000 + 948400
  4   CoreFoundation                	0x000000018196a2d8 0x181962000 + 33496
  5   GraphicsServices              	0x00000001837fbf84 0x1837f1000 + 44932
  6   UIKit                         	0x000000018af17880 0x18aea4000 + 473216
  7   Scry                          	0x000000010093d62c 0x100938000 + 22060
  8   libdyld.dylib  

format for the above log: PROCESS_INDEX BINARY_NAME MEMORY_ADDRESS

  • Take note of all suspicious indexes
  • For instance, if I wanted to symbolicate index 0. I'd need to know:
    • The BINARY_NAME: (Scry)
    • The MEMORY_ADRESS_TO_SYMBOLICATE: (0x000000018159cbc4)
  1. Get binary information for symbolication of the suspicious index.
  • Search the Binary Images section at the bottom of the log for the relevant binary.
  • For instance from the following:
0x100938000 - 0x100aa3fff Scry arm64  <0f63f51ec1cf39a19616bb72b32d1431> /var/containers/Bundle/Application/848A7FA5-1251-4841-9196-E1DA8F0F3720/Scry.app/Scry

where format is: LOAD_ADDRESS BINARY_NAME BINARY_ARCHITECTURE UUID

  • This tells us:
    • The BINARY_ARCHITECTURE: (arm64)
    • The LOAD_ADDRESS: (0x100938000)
  1. Symbolicate suspicous indexes in the stack using atos
  • For more information on atos, man atos
  • Using the previous information form a command with the following format: atos -arch BINARY_ARCHITECTURE PATH_TO_DSYM_FILE/Contents/Resources/DWARF/BINARY_NAME -l LOAD_ADDRESS MEMORY_ADDRESS_TO_SYMBOLICATE
  • In this case our command tring would read
atos -arch arm64 Scry.app.dSYM/Contents/Resources/Scry -l 0x100938000 0x000000018159cbc4
  1. Examine the output
  • The command will ouytput a string describing the root of the exception.
  • It may return a primary class and a method suych ad the following:
  - [TinderChatLogViewController loadConversation]
  1. Find the bug.
  • Now that you have a general idea of where the problem lies, you can try to look for your flawed logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment