android NE 分析
1:使用mtk 工具解析aee_exp,找到發生NE 程序資訊如:
pid: 5832, tid: 5840, name: AudioOut_15 >>> /system/bin/audioserver <<<
2:確定版本資訊,需要aee_exp 與out\target\product\A31\symbols 編譯生成的是同一次的
3:使用gat 工具 Backtrace decode 解析異常堆疊
backtrace 檔案選擇aee_exp 中 __exp_main.txt symbols 選擇上邊sysmbols目錄
會生成__exp_main.txt .decode.txt 解析的檔案與函式及行資訊。
4:根據__exp_main.txt .decode.txt判斷呼叫關係是否正確,有可能 symbols 與aee_exp 程式碼不是同一次編譯的。
trace32 下載 http://www.lauterbach.com/frames.html?manual.html
adb shell aee -d coreon
adb shell aee -d directon
adb reboot
使用user 版本,燒錄userdebug 版本boot img root ,這個時候如果出現unknow coreon 或 unknow directon ,需要將/system/build.prop 下ro.build.type=user 改為userdebug 在reboot 手機,再執行adb shell aee -d coreon adb shell aee -d directon
等手機重啟後再執行以下命令
adb shell setprop persist.libc.debug.malloc 15
adb shell setprop persist.libc.debug15.prog /system/bin/surfaceflinger
adb shell setprop persist.debug15.config 0x4a003024
adb reboot
5. 手機再次重啟後,開始復現問題。
M版本 USER load:1)open alps/bionic/linker/debugger.cpp, and modify code in debuggerd_init
__LIBC_HIDDEN__ void debuggerd_init() {
struct sigaction action;
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_sigaction = debuggerd_signal_handler;
action.sa_flags = SA_RESTART | SA_SIGINFO;
#if 0
// Use the alternate signal stack if available so we can catch stack overflows.
action.sa_flags |= SA_ONSTACK;
sigaction(SIGABRT, &action, nullptr);
sigaction(SIGBUS, &action, nullptr);
sigaction(SIGFPE, &action, nullptr);
sigaction(SIGILL, &action, nullptr);
sigaction(SIGPIPE, &action, nullptr);
sigaction(SIGSEGV, &action, nullptr);
#if defined(SIGSTKFLT)
sigaction(SIGSTKFLT, &action, nullptr);
#endif
sigaction(SIGTRAP, &action, nullptr);
#endif
}
2)rebuild load
3)need enable root permission first
adb shell setprop persist.aee.core.dump enable
adb shell setprop persist.aee.core.direct enable
adb reboot
memory map (2293 entries):
--->Fault address falls at 00000020 before any mapped regions