Board logo

标题: Linux kernel crash analysis example [打印本页]

作者: look_w    时间: 2017-10-24 21:24     标题: Linux kernel crash analysis example

Issue reported:

When USB is connected as Mass Storage mode, copy file from external sdcard to clipboard.
The disconnect USB and try to paste clipboard file into internal sdcard but it will fail.
Reconnect USB and target crash several minutes later.


Crash Context:






System Triage Procedure:1) Find call stack and locate the DWC_WORKQ_SCHEDULE() API
2) Get the assembly code via objdump for offending API
3) ARM assembly code is listed





4) Check offset=0x1150 code






5) Check ARM instruction against crash context





6) Now we can conclude that null pointer is caused in offset=0x1150.7) Check against source c code DWC_CIRCLEQ_INSERT_TAIL()






8) Analyze Crash Context





So we know R3=(head)->cqh_last and it is NULL pointer.
9) Add protection code for NULL pointer.




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0