jsj
jsj

Reputation: 9431

memcpy backtrace no symbols available

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)

Upvotes: 5

Views: 1256

Answers (1)

jcm
jcm

Reputation: 2578

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.

Upvotes: 1

Related Questions