Cause: When a breakpoint was pending (i.e., its location had not been resolved yet) and a new object file appeared (e.g., when a shared library is loaded), if this new object file contained multiple possible locations for the breakpoint (e.g., overloaded methods in C++), GDB was being too strict on checking this condition, and would issue an internal error if this scenario was found. A possible workaround for this issue would be to explicitly specify the location for the breakpoint. For example, if the code defines two functions 'f ()' and 'f (int)', the user could insert a breakpoint on each one by issuing, respectively, break 'f ()' and break 'f (int)' (note the single quotes around the functions).
Consequence: This internal error would affect the user experience, causing GDB to display an unnecessarily urgent message that would lead the user to stop debugging.
Fix: The check for multiple locations for the same breakpoint has been relaxed, and GDB does not issue an internal error in this scenario anymore.
Result: The user will receive a warning mentioning that more than one location for the breakpoint has been found, but only one location will be used. The debugging experience is not affected and the user can continue working with GDB without any problems.
Just to make it clear, the customer wants strictly the
bug described in comments 1 and 2 of the sourceware
report.
Unfortunately, it appears to have been corrected in
a quite large cvs commit, so it may not be trivial
to find what commit actually corrected it.
The problem does not happen in recent fedora or
rhel-7.
Comment 4Sergio Durigan Junior
2015-02-16 19:12:12 UTC
We investigated this bug, and the conclusion is that the patch to fix the issue is too big to be backported safely for 6.7. We cannot afford applying it and causing an obscure regression elsewhere.
The fix that I proposed (suggested by Jan Kratochvil) is to replace the assertion by a warning, which would not crash GDB and therefore would not impact the debugging session.
Also, it is worth mentioning that, for a more advanced debugging experience with C++, there is the DTS version of GDB.
That is removing the assertion will make the breakpoint placed only one instanced of a constructor/destructor; execution of other instances will miss the breakpoint.
The warning's printing should be also limited somehow (per struct breakpoint?) otherwise it would get printed on each shared library load.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-1325.html