Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

memcpy backtrace no symbols available

Tags:

gdb

libc

I don't know why I can't see this backtrace. The symbols from my own binary are loaded, and the package libc6-dbg is installed. Do I need to tell gdb where to find the libc symbols?

Program received signal SIGSEGV, Segmentation fault.
__memcpy_ia32 () at ../sysdeps/i386/i686/multiarch/../memcpy.S:74
74  ../sysdeps/i386/i686/multiarch/../memcpy.S: No such file or directory.
(gdb) bt full
#0  __memcpy_ia32 () at ../sysdeps/i386/i686/multiarch/../memcpy.S:74
No locals.
#1  0x00000000 in ?? ()
No symbol table info available.
(gdb)
like image 338
jsj Avatar asked Nov 10 '22 16:11

jsj


1 Answers

From your backtrace, is possible that you've a stack corruption that is overwriting your return address (mainly because there's only two calls and no information about code calling memcpy is available). Is it possible that you're using memcpy over an address in the stack?

One way to check for this kind of corruptions is by using watch gdb command:

  1. Most important part is delimit the call that should be corrupting. In your case should be a call to memcpy or close to it.
  2. once you have a suspicious function, add a break point on it.
  3. Run until break point is reached.
  4. Set a watchpoint into calling function's address by: watch 0xXXXXXX
  5. Run until watchpoint is reached.

If return address is overwritten, db should stop on corrupting call.

like image 96
jcm Avatar answered Dec 09 '22 11:12

jcm