android ndk-stack調試

來源:互聯網
上載者:User

android native開發偶爾會遭遇native庫異常導致程式崩潰,打入來的log如下:

06-05 18:52:57.566: I/DEBUG(8139): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***06-05 18:52:57.566: I/DEBUG(8139): Build fingerprint: 'htc_asia_wwe/htc_saga/saga:2.3.3/GRI40/27073:user/release-keys'06-05 18:52:57.566: I/DEBUG(8139): pid: 8246, tid: 8258  >>> com.teon <<<06-05 18:52:57.566: I/DEBUG(8139): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0088300006-05 18:52:57.566: I/DEBUG(8139):  r0 4c8869c0  r1 00882fe8  r2 00000600  r3 0000000006-05 18:52:57.576: I/DEBUG(8139):  r4 00000001  r5 00882628  r6 45882920  r7 0000001006-05 18:52:57.576: I/DEBUG(8139):  r8 00000000  r9 00882628  10 00001401  fp 0000000006-05 18:52:57.576: I/DEBUG(8139):  ip 80b091c8  sp 458828a8  lr 80e8cc7d  pc afd0ceb8  cpsr 2000001006-05 18:52:57.576: I/DEBUG(8139):  d0  0000000000000000  d1  000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d2  0000000000000000  d3  000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d4  0000000000000000  d5  000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d6  0000002800000000  d7  000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d8  0000000000000000  d9  000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d10 0000000000000000  d11 000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d12 0000000000000000  d13 000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d14 0000000000000000  d15 000000000000000006-05 18:52:57.576: I/DEBUG(8139):  d16 401000004051c7e0  d17 7e37e43c8800759c06-05 18:52:57.586: I/DEBUG(8139):  d18 bf29d485528174dc  d19 3ec6cd878c3b46a706-05 18:52:57.586: I/DEBUG(8139):  d20 3fd5c6d5a10f7452  d21 3fce67efe86ccc1506-05 18:52:57.586: I/DEBUG(8139):  d22 3ff0000000000000  d23 000000000000000006-05 18:52:57.586: I/DEBUG(8139):  d24 3ff0000000000000  d25 000000000000000006-05 18:52:57.586: I/DEBUG(8139):  d26 0000000000000000  d27 000000000000000006-05 18:52:57.586: I/DEBUG(8139):  d28 0000000000000000  d29 000000000000000006-05 18:52:57.596: I/DEBUG(8139):  d30 0000000000000000  d31 000000000000000006-05 18:52:57.606: I/DEBUG(8139):  scr 6000001206-05 18:52:57.656: I/DEBUG(8139):          #00  pc 0000ceb8  /system/lib/libc.so06-05 18:52:57.656: I/DEBUG(8139):          #01  pc 0008cc7a  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #02  pc 0008ce0c  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #03  pc 0008d626  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #04  pc 0008eaf6  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #05  pc 0008ec04  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #06  pc 0008f7b2  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #07  pc 0006c080  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #08  pc 0006c2f4  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #09  pc 00083bec  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #10  pc 00014842  /system/lib/egl/libGLESv1_CM_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #11  pc 0001d6fc  /system/lib/egl/libGLESv1_CM_adreno200.so06-05 18:52:57.656: I/DEBUG(8139):          #12  pc 0001dc88  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139):          #13  pc 00063ec6  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139):          #14  pc 00064ef6  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139):          #15  pc 00015dfa  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139):          #16  pc 0001f898  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139):          #17  pc 0001dbae  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139):          #18  pc 00020794  /data/data/com.teon/lib/libteon.so06-05 18:52:57.656: I/DEBUG(8139): code around pc:06-05 18:52:57.656: I/DEBUG(8139): afd0ce98 f400071d f5d1f000 f5d1f040 e2522040 06-05 18:52:57.656: I/DEBUG(8139): afd0cea8 3a000009 f5d1f080 f5d1f0c0 f5d1f100 06-05 18:52:57.656: I/DEBUG(8139): afd0ceb8 f421020d f421420d f5d1f100 e2522040 06-05 18:52:57.656: I/DEBUG(8139): afd0cec8 f400022d f400422d 2afffff8 e2822040 06-05 18:52:57.656: I/DEBUG(8139): afd0ced8 e2522020 3a000003 f421020d e2522020 06-05 18:52:57.656: I/DEBUG(8139): code around lr:06-05 18:52:57.656: I/DEBUG(8139): 80e8cc5c 000cf8dc b1c99007 2030f8dc 6970087f 06-05 18:52:57.656: I/DEBUG(8139): 80e8cc6c bf382f01 93012701 c008f8cd e9d0f7cf 06-05 18:52:57.656: I/DEBUG(8139): 80e8cc7c 9b019903 c008f8dd 085b084d bf382d01 06-05 18:52:57.656: I/DEBUG(8139): 80e8cc8c 2b012501 2301bf38 25019503 21301c6a 06-05 18:52:57.656: I/DEBUG(8139): 80e8cc9c fb01980a 2218c402 0105fb02 34084630 06-05 18:52:57.656: I/DEBUG(8139): stack:06-05 18:52:57.656: I/DEBUG(8139):     45882868  80b03f50  /system/lib/libgsl.so06-05 18:52:57.656: I/DEBUG(8139):     4588286c  c00c0923  06-05 18:52:57.656: I/DEBUG(8139):     45882870  4588288c  06-05 18:52:57.656: I/DEBUG(8139):     45882874  0000000c  06-05 18:52:57.666: I/DEBUG(8139):     45882878  ffffffff  06-05 18:52:57.666: I/DEBUG(8139):     4588287c  00000000  06-05 18:52:57.666: I/DEBUG(8139):     45882880  00000001  06-05 18:52:57.666: I/DEBUG(8139):     45882884  80e9bcc5  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.666: I/DEBUG(8139):     45882888  0087ed90  06-05 18:52:57.666: I/DEBUG(8139):     4588288c  66688000  06-05 18:52:57.666: I/DEBUG(8139):     45882890  4c886000  06-05 18:52:57.666: I/DEBUG(8139):     45882894  00000001  06-05 18:52:57.666: I/DEBUG(8139):     45882898  00000020  06-05 18:52:57.666: I/DEBUG(8139):     4588289c  00000001  06-05 18:52:57.666: I/DEBUG(8139):     458828a0  df002777  06-05 18:52:57.666: I/DEBUG(8139):     458828a4  e3a070ad  06-05 18:52:57.666: I/DEBUG(8139): #00 458828a8  4c886000  06-05 18:52:57.666: I/DEBUG(8139):     458828ac  80e8cc7d  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.666: I/DEBUG(8139): #01 458828b0  0087ec30  06-05 18:52:57.666: I/DEBUG(8139):     458828b4  00000040  06-05 18:52:57.666: I/DEBUG(8139):     458828b8  0087ec30  06-05 18:52:57.666: I/DEBUG(8139):     458828bc  00000001  06-05 18:52:57.666: I/DEBUG(8139):     458828c0  00000000  06-05 18:52:57.666: I/DEBUG(8139):     458828c4  80e89aa9  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.666: I/DEBUG(8139):     458828c8  00001000  06-05 18:52:57.666: I/DEBUG(8139):     458828cc  00000001  06-05 18:52:57.666: I/DEBUG(8139):     458828d0  fffff050  06-05 18:52:57.666: I/DEBUG(8139):     458828d4  fffff37c  06-05 18:52:57.666: I/DEBUG(8139):     458828d8  00605124  06-05 18:52:57.666: I/DEBUG(8139):     458828dc  00000001  06-05 18:52:57.666: I/DEBUG(8139):     458828e0  0087eec8  06-05 18:52:57.666: I/DEBUG(8139):     458828e4  80fc6e54  06-05 18:52:57.666: I/DEBUG(8139):     458828e8  00000000  06-05 18:52:57.676: I/DEBUG(8139):     458828ec  80e9b9e5  /system/lib/egl/libGLESv2_adreno200.so06-05 18:52:57.676: I/DEBUG(8139):     458828f0  45882920  06-05 18:52:57.676: I/DEBUG(8139):     458828f4  0087ec30  06-05 18:52:57.676: I/DEBUG(8139):     458828f8  45882920  06-05 18:52:57.676: I/DEBUG(8139):     458828fc  00605120  06-05 18:52:57.676: I/DEBUG(8139):     45882900  0087ec30  06-05 18:52:57.676: I/DEBUG(8139):     45882904  00000000  06-05 18:52:57.676: I/DEBUG(8139):     45882908  45882920  06-05 18:52:57.676: I/DEBUG(8139):     4588290c  00605120  06-05 18:52:57.676: I/DEBUG(8139):     45882910  0087ec30  06-05 18:52:57.676: I/DEBUG(8139):     45882914  80e8ce11  /system/lib/egl/libGLESv2_adreno200.so

一堆記憶體位址,很難看得懂,所以需要使用ndk提供的ndk-stack命令進行調試

1.把上面的異常log儲存為 log.txt 檔案

2.cmd 進入 cd <ndk路徑>

3.調試命令:ndk路徑>ndk-stack -sym <工程路徑\obj\local\armeabi> -dump <log.txt路徑>

    enter:出異常的代碼檔案資訊出來了

    (註:調用順序為自下而上)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.