Summary: | GDB can trigger a SIGBUS putting a breakpoint on a source line removed by linker garbage collection | ||
---|---|---|---|
Product: | gdb | Reporter: | Nick Clifton <nickc> |
Component: | breakpoints | Assignee: | Tom Tromey <tromey> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mark, tromey |
Priority: | P2 | ||
Version: | HEAD | ||
Target Milestone: | 7.5 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | Executable to demonstrate the problem |
Description
Nick Clifton
2012-01-06 15:59:34 UTC
FYI I have created a Binutils PR for this issue as well: http://sourceware.org/bugzilla/show_bug.cgi?id=13569 I couldn't reproduce with gcc 4.5 and CVS head gdb; see appended transcript. If it still fails for you, could you attach an executable? That might help. barimba. gcc --version gcc (GCC) 4.5.1 20100430 (prerelease) [gcc-4_5-branch revision 158946] Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. barimba. gcc -g3 -ffunction-sections -Wl,--gc-sections a.c -o prbarimba. ~/gnu/baseline-gdb/build/gdb/gdb -nw ./pr GNU gdb (GDB) 7.4.50.20120125-cvs Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/tromey/gnu/PRS/gdb13568/pr...done. (gdb) b a.c:6 No line 6 in file "a.c". Make breakpoint pending on future shared library load? (y or [n]) n Created attachment 6177 [details] Executable to demonstrate the problem % gdb -nw a.bad GNU gdb (GDB) 7.4.50.20120126-cvs Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /media/Devo/current/i686-pc-linux-gnu/tests/a.bad...done. (gdb) break a.c:6 Bus error (core dumped) Thanks. The bug is that there is a recursive include in the .debug_macro section. This causes gdb to overrun the stack. I'm testing a fix. Contents of the .debug_macro section: Offset: 0x0 Version: 4 Offset size: 4 Offset into .debug_line: 0x0 DW_MACRO_GNU_transparent_include - offset : 0x0 DW_MACRO_GNU_start_file - lineno: 0 filenum: 1 filename: a.c DW_MACRO_GNU_end_file CVSROOT: /cvs/src Module name: src Changes by: tromey@sourceware.org 2012-01-30 20:10:33 Modified files: gdb : ChangeLog dwarf2read.c Log message: PR breakpoints/13568: * dwarf2read.c (dwarf_decode_macro_bytes): Add 'include_hash' argument. Check for recursive includes. (dwarf_decode_macros): Create an include hash. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13789&r2=1.13790 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.610&r2=1.611 Fixed. |