This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/13568] New: GDB can trigger a SIGBUS putting abreakpoint on a source line removed by linker garbage collection
- From: "nickc at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 06 Jan 2012 15:59:34 +0000
- Subject: [Bug breakpoints/13568] New: GDB can trigger a SIGBUS putting abreakpoint on a source line removed by linker garbage collection
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13568
Bug #: 13568
Summary: GDB can trigger a SIGBUS putting a breakpoint on a
source line removed by linker garbage collection
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: breakpoints
AssignedTo: unassigned@sourceware.org
ReportedBy: nickc@redhat.com
Classification: Unclassified
If GDB is asked to place a breakpoint on a line of source code that has been
removed from the executable via linker garbage collection it can trigger a
SIGBUS fault. Vis:
% cat a.c
int main()
{
return 0;
}
int fun ()
{
return 0;
}
% gcc -g3 -ffunction-sections -Wl.--gc-sections a.c
% gdb -nw a.out
(gdb) break a.c:6
Bus error (core dumped)
This problem can be reproduced using the current (2012-01-06) GDB mainline
sources. Note however that it needs a 4.6 or earlier version of GCC as the
compiler. Newer GCCs create a .debug_loc section in the executable which
appears to avoid this problem.
The underlying issue is that the linker has not removed the redundant entries
from the .debug_line section, and hence this is a binutils bug. On the other
hand it would be nice if GDB did not generate a SIGBUS when presented with
bogus debug information.
Detection of this problem originated from a thread in the binutils mailing list
that starts here:
http://sourceware.org/ml/binutils/2012-01/msg00047.html
--
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.