一、环境:
windows
rk3399 android 7.1
二、奔溃信息
pid: 13544, tid: 13639, name: no.localmeeting >>> com.sino.localmeeting <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x21cd
x0 000000758a366560 x1 000000000000859c x2 00000075a2def4e4 x3 00000000000005d0
x4 65722073252d2920 x5 000000000000859b x6 00000075a8729000 x7 0000000000000000
x8 00000075883d32d8 x9 0000000000000202 x10 00000000000002da x11 00000075890a0300
x12 0000000000000291 x13 0000000000000028 x14 0000000000000000 x15 0000000000000028
x16 0000000000000280 x17 00000075a64863cc x18 0000000000000001 x19 000000758a366560
x20 000000758a366598 x21 000000758a366568 x22 000000000000859c x23 00000000000005d0
x24 00000075a2def4e4 x25 000000000000031d x26 00000000000021c1 x27 000000000000859c
x28 00000000000f4240 x29 00000075a2dff000 x30 00000075a2d82634
sp 00000075871fb040 pc 00000075a2d7fc94 pstate 0000000020000000
backtrace:
#00 pc 000000000001ec94 /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so
#01 pc 0000000000021630 /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so
#02 pc 0000000000013954 /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so
#03 pc 000000000005895c /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so
#04 pc 0000000000059cb0 /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so
#05 pc 0000000000053698 /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so (uv_run+376)
#06 pc 0000000000047178 /data/app/com.sino.localmeeting-2/lib/arm64/libnetrtc-jni.so
#07 pc 0000000000067f10 /system/lib64/libc.so (_ZL15__pthread_startPv+196)
#08 pc 000000000001d900 /system/lib64/libc.so (__start_thread+16)
如上的奔溃信息可以看到 奔溃状态和堆栈信息
三、使用addr2line命令根据堆栈信息上的地址查找对应函数
C:\Users\owner> D:\Project\android\android-ndk-r14b\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-addr2line.exe -e D:\Project\sino\src\LCM\src\cpp
\android\obj\local\arm64-v8a\libnetrtc-jni.so 000000000001ec94 0000000000021630 0000000000013954 000000000005895c
D:/Project/sino/src/LCM/src/cpp/android/jni/../cpp/fcp/FCache.cpp:44
D:/Project/sino/src/LCM/src/cpp/android/jni/../cpp/fcp/FChannel.cpp:231
D:/Project/sino/src/LCM/src/cpp/android/jni/../../udp_module.h:71
D:/Project/sino/src/LCM/src/cpp/android/jni/../../libuv-1.19.2/src/unix/udp.c:205
PS C:\Users\owner>
解说:
上面的 aarch64-linux-android-addr2line 可以放到path环境变量里,就不用带长路径了,格式为
aarch64-linux-android-addr2line -e so文件 要查找的函数地址(多个地址使用空格隔开)