breakpoints/2119: gdb 6.4 prints errors when restarting program with pending breakpoints

Greg Law glaw@undo-software.com
Tue Jul 25 15:38:00 GMT 2006


The following reply was made to PR breakpoints/2119; it has been noted by GNATS.

From: Greg Law <glaw@undo-software.com>
To: gdb-gnats@sources.redhat.com
Cc:  
Subject: Re: breakpoints/2119: gdb 6.4 prints errors when restarting program
 with pending breakpoints
Date: Tue, 25 Jul 2006 16:35:20 +0100

 I think this issue may be more serious than first thought.
 
 If I've understood correctly, the problem here is that when the inferior 
 is restarted, gdb tries to re-apply all the breakpoints in shared 
 libraries, but libraries that the program loads explicitly (i.e. with 
 dlopen) are not mapped in yet.  Usually this means a bogus breakpoint 
 address, so the ptrace operation fails, so we get the error message.
 
 But with address-space randomization (e.g. used by modern Linuxes) the 
 location of the stale breakpoint might be anywhere, including in data 
 sections.  The effect is gdb writes a bunch of breakpoint instructions 
 at essentially random locations in the inferior's address space, which 
 can lead to very subtle issues.
 
 
 Cheers,
 
 Greg
 
 -- 
 Greg Law, Undo Software                       http://undo-software.com/



More information about the Gdb-prs mailing list