Confirmed that I see this with current edgy, but if you stop and start
gdb between each iteration the backtrace is fine.
Nothing here smells like glibc, however, so I'm reassigning it to gdb.
** Changed in: glibc (Ubuntu)
Sourcepackagename: glibc => gdb
Assignee: Jeff Bailey => (unassigned)
** Summary changed:
- assert() corrupts the stack?
+ gdb doesn't reset stack or reload symbols correctly
** Description changed:
- Here is the sample program:
-
- #include
- int main(void){
-int i = 1;
-assert(i == 0);
-return 0;
- }
-
+ If a program is recompiled while gdb is running, it will reload the
+ symbols. However, stack traces on assert appear to be corrupted.
- It compiles OK (gcc -g t.c); it runs OK, stopping at the assertion like it
should. But here's the output from
- running the program under gdb:
-
-
- (gdb) run
- a.out: t.c:5: main: Assertion `i == 0' failed.
-
- Program received signal SIGABRT, Aborted.
- 0xe410 in __kernel_vsyscall ()
- (gdb) bt
- #0 0xe410 in __kernel_vsyscall ()
- #1 0xb7ed6175 in raise () from /lib/tls/i686/cmov/libc.so.6
- #2 0xb7ed77d8 in abort () from /lib/tls/i686/cmov/libc.so.6
- #3 0xb4f0 in ?? ()
- #4 0x in ?? ()
- #5 0x0020 in ?? ()
- #6 0x in ?? ()
- [... many null pointers...]
- #36 0x in ?? ()
- #37 0xb7f19307 in _IO_file_write () from /lib/tls/i686/cmov/libc.so.6
- Previous frame inner to this frame (corrupt stack?)
-
-
- I don't know if gdb's "corrupt stack?" claim is true, but assert() pretty
consistently gives me this less-than-
- useless backtrace. Compiling and debugging on another system (Gentoo linux:
default-linux/amd64/2005.0, gcc-3.
- 4.4, glibc-2.3.5-r1, 2.6.11-gentoo-r7 x86_64, gdb 6.3) doesn't give me this
problem.
-
- My system: gdb 6.3-5ubuntu1.1, glibc 2.3.2.ds1-20ubuntu13, gcc 3.3 or
- 4.0 (happens with both), kernel 2.6.10.
-
- thanks,
-
- B
+ Exitting gdb and starting it again with the newly recompiled program
+ solves the problem.
--
gdb doesn't reset stack or reload symbols correctly
https://launchpad.net/bugs/25986
--
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs