Bugly分析Unity崩溃日志,解析符号表

这里的unity版本是 Unity 2020.3.33 版本 , 其他版本可能不一样

说明: bugly不支持unity的符号表上传, 不要做无谓的尝试了

常见的报错信息

Version '2020.3.33f1 (915a7af8b0d5)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'samsung/SCV49_jp_kdi/SCV49:11/RP1A.200720.012/SCV49KDU1BVE2:user/release-keys'
Revision: '2'
ABI: 'arm64'
Timestamp: 2022-10-14 18:31:55+0900
pid: 7279, tid: 9541, name: UnityMain >>> com.xxx.android <<<
uid: 10343
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
x0 0000000000000000 x1 000000773742c81e x2 000000785d10c627 x3 0000000000000005
x4 0000000000000068 x5 0000aa0000101000 x6 0000000000000000 x7 ff7fff7f7fffff7f
x8 0000000000000041 x9 c471b63642fda943 x10 0000000000000000 x11 000000775d0ca151
x12 0000000000000000 x13 0000000000000047 x14 0000000000000007 x15 ffffffffffffffff
x16 000000785d13e9b0 x17 000000785d117508 x18 000000007c5ec72c x19 000000775d0ca260
x20 00000076a04bbdd8 x21 00000076a01c
[Message over limit size:1000, has been cutted!]
libil2cpp.0xa8b634(Native Method)
libil2cpp.0xa87fd4(Native Method)
libil2cpp.0xa87de0(Native Method)
libil2cpp.0xa8bd0c(Native Method)
libil2cpp.0xa89c3c(Native Method)
libil2cpp.0xa8c0b4(Native Method)
libil2cpp.0xa3d720(Native Method)
libil2cpp.0x2184f9c(Native Method)
libil2cpp.0x2183430(Native Method)
libil2cpp.0xe5bc18(Native Method)
libil2cpp.0x8c18b4(Native Method)
libil2cpp.0xa520cc(Native Method)
libunity.0x3378c4(Native Method)
libunity.0x33b27c(Native Method)
libunity.0x33b164(Native Method)
libunity.0x3842bc(Native Method)
libunity.0x352058(Native Method)
libunity.0x352474(Native Method)
libunity.0x285eb8(Native Method)
libunity.0x285c48(Native Method)

注意关键信息'arm64-v8a' ABI: 'arm64' 这里指arm64的崩溃,找对应的arm64-v8a的符号表,其他符号表依这个逻辑查找;libil2cpp指libil2cpp.sym.so文件,libunity指libunity.sym.so
so 文件位置:项目导出cache路径下

{项目编译后路径}\Temp\StagingArea\symbols

在unity的安装目录下找到addr2line

D:\Program Files\Unity\2020.3.33f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin
aarch64-linux-android-addr2line.exe 这个是arm64的
arm-linux-androideabi-addr2line.exe 这个是arm32的
cd 到addr2line.exe目录

.\aarch64-linux-android-addr2line.exe -f -C -e C:\Users\xxx\Downloads\arm64-v8a\libunity.sym.so 0x2fa89c 0x418288 0x417f38 0x407010 0x406660 0x874aac 0x577224 0x57748c 0x3c92f0 0x3b4190 0x3b4d40 0x3cb078