iOS解析Crash

  • 解析Crash:

Incident Identifier: C37EBDAB-FEB9-4AA9-8314-EEFC7B709CAE //事件报告ID
Hardware Model: iPhone13,4 //硬件型号
Process: AppName [12849] //程序进程
Path: /private/var/containers/Bundle/Application/1BB9C4C0-763D-4FEF-BE25/AppName.app/AppName //崩溃文件路径
Identifier: com.xxx.xxx.xxx //bundle ID
Version: 8.36.0 (3.2.282) //版本号
AppStoreTools: 13A1030d //
AppVariant: 1:iPhone13,4:14 //
Code Type: ARM-64 (Native) //指令集
Role: Foreground / Background / unknown / Non UI
Parent Process: launchd [1]
Coalition: com.xxx.xxx.xxx [2383] //

Date/Time: 2021-11-15 20:10:40.6139 +0800 //事件报告时间
Launch Time: 2021-11-15 16:28:53.3235 +0800 //启动时间
OS Version: iPhone OS 15.1 (19B74) //系统版本
Release Type: User
Baseband Version: 2.11.02
Report Version: 104

Exception Type: EXC_BREAKPOINT (SIGKILL) / EXC_CRASH (SIGKILL) //异常类型
Exception Codes: 0x0000000000000001, 0x00000001f29030b8
Exception Note: EXC_CORPSE_NOTIFY /
Triggered by Thread: 0 //触发线程

Kernel Triage:
VM - Compressor failed a blocking pager_get

Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x00000001b8d1c504 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001b8d1cb9c mach_msg + 76 (mach_msg.c:119)
2 CoreFoundation 0x0000000181ceb688 __CFRunLoopServiceMachPort + 372 (CFRunLoop.c:2646)
3 CoreFoundation 0x0000000181cef97c __CFRunLoopRun + 1212 (CFRunLoop.c:3000)
4 CoreFoundation 0x0000000181d033b8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
5 AudioSession 0x000000018b097308 CADeprecated::GenericRunLoopThread::Entry(void) + 164 (GenericRunLoopThread.h:95)
6 AudioSession 0x000000018b0a0d64 CADeprecated::CAPThread::Entry(CADeprecated::CAPThread
) + 92 (CAPThread.cpp:324)
7 libsystem_pthread.dylib 0x00000001f29069a4 _pthread_start + 148 (pthread.c:891)
8 libsystem_pthread.dylib 0x00000001f2905ea0 thread_start + 8

Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000103 x1: 0x0000000000050000 x2: 0x0000000000000103 x3: 0x0000000000000003
x4: 0x000000018cc14b5f x5: 0x00000001599d8c40 x6: 0x0000000000000035 x7: 0xffffffff0043b700
x8: 0x0000000000000103 x9: 0x0000000000000103 x10: 0x0000000000000001 x11: 0x000100019a408150
x12: 0x0000000000000001 x13: 0x000000019a408150 x14: 0x0000000088602800 x15: 0x0000000107b30220
x16: 0x00000001f28ff670 x17: 0x0000000000000000 x18: 0x000000010f86aabc x19: 0x0000000000000103
x20: 0x0000000000050000 x21: 0x00000001dbbfe93c x22: 0x0000000001050002 x23: 0x0000000000000103
x24: 0x0000000000000000 x25: 0x0000000000000103 x26: 0x00000001083e0660 x27: 0x0000000000000004
x28: 0x00000000ffe00321 fp: 0x00000001599d6760 lr: 0x00000001f28fda10
sp: 0x00000001599d6720 pc: 0x00000001f29030b8 cpsr: 0x20000000
esr: 0xf2000001 (Breakpoint) brk 1

Binary Images:
0x100d30000 - 0x10641bfff AppName arm64 /private/var/containers/Bundle/Application/1BB9C4C0-763D-4FEF-BE25-35494CC86E3C/AppName.app/AppName
0x10837c000 - 0x1083d3fff dyld arm64e /usr/lib/dyld
0x10a620000 - 0x10ac0ffff NvStreamingSdkCore arm64 <224159b3aa203718a0fd1a8df82c36d1> /private/var/containers/Bundle/Application/1BB9C4C0-763D-4FEF-BE25-35494CC86E3C/AppName.app/Frameworks/NvStreamingSdkCore.framework/NvStreamingSdkCore

EOF

EXC_BAD_ACCESS
(待完善)

  • 符号化方法:

    1.symbolicatecrash符号化:
    $ ./symbolicatecrash xxx.crash xxx.dSYM > symb_xxx.crash
    
    2.atos符号化:

    使用 ATOS 命令来对单行或多行的堆栈进行符号化操作,完整语法atos -arch \ -o -l
    输入单行:

    $ atos -arch arm64 -o ./xxx.app.dSYM -l 0x00000001027ec000 0x0000000102809474
    

    输入多行:

    $ atos -arch arm64 -o ./xxx.app.dSYM -l 0x00000001027ec000 0x0000000102809474 0x0000000102809474
    
    3. dwarfdump进行符号化

    (待完善)

    4.lldb进行符号化

    (待完善)

    5.可视化工具dSYMTools

    image.png

    https://github.com/answer-huang/dSYMTools

  • 符号化前置工作:

    堆栈说明:
    image.png

    load address: 运行时起始地址(图:2)
    address: 运行时堆栈地址(图:1) = 运行时起始地址(图:2) + 偏移量(图:3)

    获取symbolicatecrash:
    $ find /Applications/Xcode.app -name symbolicatecrash -type f
    
    获取.app的UUID:
    $ dwarfdump --uuid xx.app/xx //(xx代表你的项目名)
    
    获取.dSYM的UUID:
    $ dwarfdump -u xxx.dSYM
    或者
    $ dwarfdump --uuid xxx.dSYM
    
    获取.crash的UUID:
    $ grep "AppName arm64" xxx.crash 
    
    设置环境变量:

    如报错:Error: "DEVELOPER_DIR" is not defined at ./symbolicatecrash line 69.

    $ export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"
    
  • 参考:

    崩溃大解析:https://new.qq.com/omn/20200904/20200904A02C4T00.html?pc
    日志说明:https://developer.apple.com/documentation/xcode/examining-the- fields-in-a-crash-report
    多种符号化方法:https://www.bugsnag.com/blog/symbolicating-ios-crashes
    字节在线crash解析:https://cdmana.com/2021/09/20210903152029633f.html#

你可能感兴趣的:(iOS解析Crash)