-
Notifications
You must be signed in to change notification settings - Fork 43
ndk stack工具使用
cheyiliu edited this page Dec 7, 2015
·
2 revisions
- jni开发过程中native崩溃log样式如下
F/libc (12115): Fatal signal 11 (SIGSEGV) at 0x37413144 (code=1), thread 12115 (om.example.test)
I/DEBUG ( 257): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 257): Build fingerprint: 'OPPO/R7007/R7007:4.3/JLS36C/1390465867:user/release-keys'
I/DEBUG ( 257): Revision: '0'
I/DEBUG ( 257): pid: 12115, tid: 12115, name: om.example.test >>> com.example.test <<<
I/DEBUG ( 257): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 37413144
I/DEBUG ( 257): Abort message: ''
I/DEBUG ( 257): r0 37413144 r1 00000000 r2 00000001 r3 8e4efac8
I/DEBUG ( 257): r4 5d9f5f30 r5 5d9f5f88 r6 35413246 r7 4011e20c
I/DEBUG ( 257): r8 be89a180 r9 57561c7c sl 415e9040 fp be89a194
I/DEBUG ( 257): ip 00000001 sp be899d20 lr 400e0ba9 pc 5d8c182e cpsr 20000030
I/DEBUG ( 257): d0 000000000000000f d1 6361436c6c417261
I/DEBUG ( 257): d2 6e69676562206568 d3 2d2d2d2d2d2d2d2d
I/DEBUG ( 257): d4 0000000000000000 d5 0000000000000000
I/DEBUG ( 257): d6 0000000000000000 d7 0000000080000000
I/DEBUG ( 257): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 257): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 257): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 257): d14 0000000000000000 d15 0000000000000000
-
如何分析crash log对应的调用栈?只需2步
C:\Users\zzz\Desktop>adb logcat -c && adb logcat > C:\Users\zzz\Desktop\log.txt
C:\Users\zzz\Desktop>ndk-stack -sym C:\androidStudio\android-libac\jni\obj\local\armeabi -dump log.txt
-
输出如下
********** Crash dump: **********
Build fingerprint: 'OPPO/R7007/R7007:4.3/JLS36C/1390465867:user/release-keys'
pid: 12115, tid: 12115, name: om.example.test >>> com.example.test <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 37413144
Stack frame I/DEBUG ( 257): #00 pc 0000682e /data/app-lib/com.example.test-2/libacd.so: Routine MapsManager::clearAllCache() at C:\androidStudio\android-libac\jni/jni/src/pmaps/MapsManager.cpp:169 (discriminator 1)
Stack frame I/DEBUG ( 257): #01 pc 00006d09 /data/app-lib/com.example.test-2/libacd.so: Routine MapsManager::startSecureCheck() at C:\androidStudio\android-libac\jni/jni/src/pmaps/MapsManager.cpp:98
Stack frame I/DEBUG ( 257): #02 pc 00006e47 /data/app-lib/com.example.test-2/libacd.so: Routine assertInvader(ErrorCode*, android::UParcel*) at C:\androidStudio\android-libac\jni/jni/src/pmaps/MapsManager.cpp:21
Stack frame I/DEBUG ( 257): #03 pc 000060d7 /data/app-lib/com.example.test-2/libacd.so: Routine nativeAssert at C:\androidStudio\android-libac\jni/jni/src/entrance.cpp:70
Stack frame I/DEBUG ( 257): #04 pc 000203cc /system/lib/libdvm.so (dvmPlatformInvoke+112)
Stack frame I/DEBUG ( 257): #05 pc 00050d97 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
Stack frame I/DEBUG ( 257): #06 pc 00029860 /system/lib/libdvm.so
Stack frame I/DEBUG ( 257): #07 pc 0002e218 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
Stack frame I/DEBUG ( 257): #08 pc 0000d0af /system/lib/libdvm.so
- android-ndk-r10e/docs/Programmers_Guide/html/md_3__key__topics__debugging__n_d_k-_s_t_a_c_k.html
Just build something.