Only question marks in backtrace reported by gdb on ARM

六月ゝ 毕业季﹏ 提交于 2019-11-30 09:37:24

The corrupt stack note is probably your problem. It looks like a return address or virtual table entry or something was overwritten with zeros, and then control was transferred there. Even if you have symbols available, those addresses aren't pointing to valid symbols. Hence the segfault.

I don't envy your task. These are some of the hardest bugs to track down, and can even move or temporarily go away when you make code changes to try and catch them. Your best bet is usually something like git bisect or your VCS equivalent to find the commit that introduced it. Hopefully it isn't too difficult to reproduce.

One trick you can sometimes use when you get the "SEGV at address 0" problem is to manually pop the return address from the top of the stack into the pc and trying to do a stack trace from there. This assumes that you got to address 0 by doing an indirect call through a NULL pointer, which is the most common way of getting to address 0.

Now I'm not too familiar with ARM, but on an x86 PC, you would do:

(gdb) set $eip = *(void **)$esp
(gdb) set $esp = $esp + 4

and then do another backtrace to figure out where you really are.

If you can figure out the calling convention used for ARM by your compiler, you should be able to do something similar.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!