Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 137827 - "catch" command gives error when invoked to catch C++ exceptions
"catch" command gives error when invoked to catch C++ exceptions
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Kratochvil
: MoveUpstream, Reopened
Depends On:
  Show dependency treegraph
Reported: 2004-11-01 15:59 EST by Alistair Riddoch
Modified: 2008-05-06 11:27 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-06 11:27:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alistair Riddoch 2004-11-01 15:59:42 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040808 Firefox/0.9.3

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):
gdb-6.0post-0.20040223.19 gdb-6.1post-1.20040607.41

How reproducible:

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.

Additional info:

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
Comment 1 Alistair Riddoch 2005-04-21 19:26:12 EDT
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
following message:

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
is displayed:

Breakpoint 2 at 0xb7c3c931
Pending breakpoint "__cxa_throw" resolved

From this point on, the breakpoint is successfull in catching exceptions as they
are thrown.

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.
Comment 2 Matthew Miller 2006-07-10 19:25:03 EDT
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.

Thank you!
Comment 3 Alistair Riddoch 2006-07-10 19:45:01 EDT
I confirm that this issue still exists in FC6 test1. using gdb-

This should probably be pushed upstream to the gdb team.
Comment 4 Matthew Miller 2006-07-11 11:35:47 EDT

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
MoveUpstream keyword.
Comment 5 Jan Kratochvil 2007-01-14 12:18:40 EST
FC6test2 upwards was rebased to gdb-6.5.
Bug to be checked for reproducibility (not "verified for reproducibility" :-) ).
Comment 6 Alistair Riddoch 2007-01-14 19:50:26 EST
I have checked on my FC6 machine, and the issue is the same there. Version is
Comment 7 Bug Zapper 2008-04-03 21:51:54 EDT
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
the change.

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
Comment 8 Bug Zapper 2008-05-06 11:27:48 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.