Quote:
Originally Posted by bcg121
(gdb) bt
#0 0x40d478 in strlen ()
#1 0x174aed8 in ?? ()
|
Sometimes gdb simply fails to understand the stack frame at the point where crash occurs. So it is possible that 0x174aed8 is not the correct return address.
If you know a little bit about x86 assembler, you could display a little of the stack and display the disassembly of strlen and understand the stack frame that gdb didn't understand so you could find the correct return address.
0x174aed8 is a rather large value for a return address. That would not be an address in your main executable. Maybe it could be in a .so file (that has no symbols). Maybe it is in executable data. But more likely it is just wrong.
strlen did not corrupt the stack. Earlier stack corruption would not destroy the return address to strlen. So stack corruption is a possibility here, but if this is stack corruption then even the identification of strlen is incorrect. More likely, strlen is correct, the value passed to strlen was bad and caused the fault, and gdb is misunderstanding the stack frame.
Or is this process multi threaded? If it is multi threaded then some other thread might have trashed this thread's stack during the execution of strlen.