Red Hat Bugzilla – Bug 137827
"catch" command gives error when invoked to catch C++ exceptions
Last modified: 2008-05-06 11:27:50 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Description of problem:
The command "catch throw" should cause gdb to break when an exception
is thrown, but when invoked on a C++ application built on Fedora Core
2 or 3test it gives the following error message:
Function "__cxa_throw" not defined.
This functionality works fine on RedHat Enterprise 3 running
gdb-6.1post-1.20040607.17 and gcc-3.2.3-42 so I suspect the difference
is due to the gcc version installed. It looks like gdb needs to be
updated to take account of changes to the standard C++ library.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Invoke gdb on a C++ executable.
2. Give the "catch throw" command.
Actual Results: The error message 'Function "__cxa_throw" not
defined.' is given.
Expected Results: The message "Catchpoint 1 (throw)" should be given.
This bug occurs with both gcc-3.3.3-7 and gcc-3.4.2-6.fc3 on FC 2 and
3, running gdb-6.0post-0.20040223.19 and gdb-6.1post-1.20040607.41
I have some further information that may shed some light on this problem.
gdb correctly uses the symbol __cxa_throw to catch C++ exceptions, but because
the standard C++ library has not yet been loaded when gdb is first started, the
symbol is not available. Using the command "break __cxa_throw" gives the
Function "__cxa_throw" not defined.
Make breakpoint pending on future shared library load? (y or [n])
If the user responds with y, and then starts the program, the following message
Breakpoint 2 at 0xb7c3c931
Pending breakpoint "__cxa_throw" resolved
From this point on, the breakpoint is successfull in catching exceptions as they
It appears from the above investigation that in order to get "catch throw"
functionality working again, gdb needs to delay looking for the __cxa_throw
symbol until it is defined or use a pending mechanism similar to that used by
the break command. If it were to do so, catching C++ exceptions without having
to set a breakpoint manually should be possible.
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.
I confirm that this issue still exists in FC6 test1. using gdb-188.8.131.52-1.132.FC6.
This should probably be pushed upstream to the gdb team.
The "Verified" bug state confusingly means that a *fix* has been verified, not
that the bug is verified as a problem. Reopening as per comment #3, and adding
FC6test2 upwards was rebased to gdb-6.5.
Bug to be checked for reproducibility (not "verified for reproducibility" :-) ).
I have checked on my FC6 machine, and the issue is the same there. Version is
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.
If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
Thanks for your help, and we apologize again that we haven't handled
these issues to this point.
The process we are following is outlined here:
We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen thus bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.