一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

How to read Android crash log and stack trace

 champion_xu 2015-03-23

An Android crash in C/C++ code often generates some crash log which looks like the following. They can be seen either with "adb logcat" or found in one of the tombstones under /data/tombstones. This article briefly explains the structure of the log, how to read it, and how to translate the addresses into symbols with the stack tool.

The basic items in the log is explained below. The first is the build information in the system property "ro.build.fingerprint"

I/DEBUG   (  730): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  730): Build fingerprint: 'generic/generic/generic/:1.5/...'

Then, it shows the process ID number (pid) and the thread id (tid). Knowing the PID, one can find its information with /proc/<pid> (of course, before the crash happens). In this example, the PID and TID are the same. However, if the crash happens in a child thread, the thread ID tid will be different from pid. The child thread itself is also a process in Linux (having its task_struct). The difference from a child process created by fork is that it shares address space and other data with the parent process.

I/DEBUG   (  730): pid: 876, tid: 876  >>> /system/bin/mediaserver <<<

The following shows the signal which caused the process to abort, in this case, it's a segmentation fault. This is followed by the register values.

I/DEBUG   (  730): signal 11 (SIGSEGV), fault addr 00000010
I/DEBUG   (  730):  r0 00000000  r1 00016618  r2 80248f78  r3 00000000
I/DEBUG   (  730):  r4 80248f78  r5 0000d330  r6 80248f78  r7 beaf9974
I/DEBUG   (  730):  r8 00000000  r9 00000000  10 00000000  fp 00000000
I/DEBUG   (  730):  ip afd020c8  sp beaf98d8  lr 8021edcd  pc 8021c630  cpsr a0000030

This is the call stack trace. #00 is the depth of the stack pointer. The "pc <addr>" is the PC address in the stack. Sometimes, the "lr" link register containing the return address is shown instead of PC. It is followed by the file containing the code. Of course, the address doesn't make much sense without resolving it to a symbol. This can be done with the "stack" tool. Download stack here.

I/DEBUG   (  730):          #00  pc 0001c630  /system/lib/libhelixplayer.so
I/DEBUG   (  730):          #01  pc 0001edca  /system/lib/libhelixplayer.so
I/DEBUG   (  730):          #02  pc 0001ff0a  /system/lib/libhelixplayer.so
I/DEBUG   (  730):          #03  pc 000214e0  /system/lib/libutils.so
I/DEBUG   (  730):          #04  pc 0000e322  /system/lib/libmediaplayerservice.so
...
I/DEBUG   (  730):          #15  pc b0001516  /system/bin/linker

The following is actually the current stack with the stack pointer address and code dump. Each line contains 4 bytes (one machine word), and the address is in ascending order. The words in the stack are mapped onto the memory region it belongs to.

I/DEBUG   (  730): stack:
I/DEBUG   (  730):     beaf9898  00016618  [heap]
I/DEBUG   (  730):     beaf989c  beaf98d0  [stack]
I/DEBUG   (  730):     beaf98a0  0000db28  [heap]
I/DEBUG   (  730):     beaf98a4  beaf98f8  [stack]
I/DEBUG   (  730):     beaf98b8  8021cf4d  /system/lib/libhelixplayer.so
I/DEBUG   (  730):     beaf98bc  80248f78
I/DEBUG   (  730): #00 beaf98d8  0000d330  [heap]
I/DEBUG   (  730):     beaf98dc  00000000
I/DEBUG   (  730):     beaf98e0  0000d330  [heap]
I/DEBUG   (  730):     beaf98e4  8021edcd  /system/lib/libhelixplayer.so
I/DEBUG   (  730): #01 beaf98e8  80248f78
I/DEBUG   (  730):     beaf98ec  80248f78

References

Debugging Native Code: http://source./porting/debugging_native.html

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    一区二区三区18禁看| 欧美欧美欧美欧美一区| 欧美日韩国产综合特黄| 国产视频福利一区二区| 人妻久久一区二区三区精品99| 国产亚洲午夜高清国产拍精品| 沐浴偷拍一区二区视频| 亚洲高清一区二区高清| 丝袜破了有美女肉体免费观看| 99热九九热这里只有精品| 中文字幕久热精品视频在线| 五月婷日韩中文字幕四虎| 日韩1区二区三区麻豆| 日韩人妻av中文字幕| 好东西一起分享老鸭窝| 美女被后入福利在线观看| 亚洲一区二区三区在线中文字幕| 人人爽夜夜爽夜夜爽精品视频| 白丝美女被插入视频在线观看| 中文字幕在线区中文色| 欧美一区二区三区喷汁尤物 | 国产精品午夜视频免费观看| 亚洲欧美精品伊人久久| 中文日韩精品视频在线| 亚洲一区二区精品国产av| 91插插插外国一区二区| 国产精品欧美激情在线播放| 日木乱偷人妻中文字幕在线| 国产精品香蕉在线的人| 亚洲精品国产美女久久久99| 国产精品熟女乱色一区二区| 在线免费观看一二区视频| 国产成人亚洲欧美二区综| 最新国产欧美精品91| 婷婷伊人综合中文字幕| 久久精品中文字幕人妻中文| 亚洲熟女熟妇乱色一区| 色婷婷成人精品综合一区| 国产传媒高清视频在线| 国产精品久久精品毛片| 少妇高潮呻吟浪语91|