This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15407] Partial frame info in sysdeps/x86_64/start.S


http://sourceware.org/bugzilla/show_bug.cgi?id=15407

--- Comment #24 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2013-05-10 18:26:07 UTC ---
(In reply to comment #23)
> For codes without CFI, what does GDB today do for
> 
> 1. _start.

Incorrectly performs the unwind not stopping here, as discussed above.


> 2. It does have BP.

Incorrectly unwinds stripped code as GDB cannot find start of the function (and
therefore its prologue).  For non-stripped (ELF symbols) code unwinding works.


> 3. It doesn't have BP.

Attempts to re-sync backtrace:

(gdb) run
Program received signal SIGTRAP, Trace/breakpoint trap.
(gdb) bt
#0  0x0000000000400529 in f ()
#1  0x6f77206f6c6c6568 in ?? ()
#2  0x0000000000646c72 in ?? ()
#3  0x0000000000400533 in main ()


> What will GDB do if it is changed to assume there is BP?

2. It does have BP.

Correctly unwinds stripped code.  But such code does not exist, stripped code
is -O2 code and that was always using -fomit-frame-pointer on x86_64.


3. It doesn't have BP.

It will incorrectly stop backtrace if GDB accidentally finds %rbp == 0 which:

 * Does not indicate to user something went wrong during unwinding.

 * Does not try to re-sync backtrace for a possibly later found correct frame
   on stack.

(gdb) run
Program received signal SIGTRAP, Trace/breakpoint trap.
(gdb) bt
#0  0x0000000000400529 in f ()


void *p;
static void g(void) {
  p=p;
}
static void f(void) {
  char a[]="hello world";
  p=a;
  g();
  asm volatile ("int3");
}
int main() {
  f();
  return 0;
}

-fomit-frame-pointer -fno-asynchronous-unwind-tables

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]