[Issue 136] Corrupt GDB backtrace

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 27 08:47:18 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=136





------- Comment #5 from thomas-dloop at kuehne.cn  2007-02-27 10:47 -------
(In reply to comment #4)
> I just want to note that since this failed after upgrading DMD
> (not GDB) this can hardly be considered the fault of GDB.

This isn't a code generation issue.
It might be related to incomplete/incorrect debugging information.

# import cn.kuehne.flectioned; // for print_trace
#
# void main() {
#       static int i = 0;
#       while(i++ < 10)
#               main();
#       *(cast(int *)0) = 0;
# }


dmd -g test.d flectioned.d
gdb ./test
[...]
(gdb) run
Starting program: /cage/test.d 
[Thread debugging using libthread_db enabled]
[New Thread 4158367408 (LWP 23206)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 4158367408 (LWP 23206)]
0x0804af4a in _Dmain () at a.d:16
16              *(cast(int *)0) = 0;
Current language:  auto; currently minimal
(gdb) bt
#0  0x0804af4a in _Dmain () at a.d:16
#1  0xf7cbdb00 in ?? ()
#2  0xfff775a0 in ?? ()
#3  0x0804af44 in _Dmain () at a.d:15
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) call print_trace($ebp)
0xfff775a0      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775a8      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775b0      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775b8      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775c0      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775c8      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775d0      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775d8      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775e0      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff775e8      0x804af44       int main(char[][]) (0x804af2c, 36)
0xfff77618      0x8052269       extern(C) int main(int, char**) (0x80521a0,
279)

call_trace only uses stack/frame pointers and those seem to be OK.
DMD-0.155's doesn't show this issue but DMD-0.157 does.

Added to DStress as
http://dstress.kuehne.cn/norun/d/debug_info_12_A.d


-- 



More information about the Digitalmars-d-bugs mailing list