Bug 137827 - "catch" command gives error when invoked to catch C++ exceptions
Summary: "catch" command gives error when invoked to catch C++ exceptions
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 6
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact:
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-01 20:59 UTC by Alistair Riddoch
Modified: 2008-05-06 15:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-06 15:27:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alistair Riddoch 2004-11-01 20:59:42 UTC
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:
Always

Steps to Reproduce:
1. Invoke gdb on a C++ executable.
2. Give the "catch throw" command.
3. 
    

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
respectively.

Comment 1 Alistair Riddoch 2005-04-21 23:26:12 UTC
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 23:25:03 UTC
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 23:45:01 UTC
I confirm that this issue still exists in FC6 test1. using gdb-6.3.0.0-1.132.FC6.

This should probably be pushed upstream to the gdb team.

Comment 4 Matthew Miller 2006-07-11 15:35:47 UTC
Thanks!

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 17:18:40 UTC
FC6test2 upwards was rebased to gdb-6.5.
Bug to be checked for reproducibility (not "verified for reproducibility" :-) ).


Comment 6 Alistair Riddoch 2007-01-15 00:50:26 UTC
I have checked on my FC6 machine, and the issue is the same there. Version is
gdb-6.5-15.fc6.

Comment 7 Bug Zapper 2008-04-04 01:51:54 UTC
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.
http://fedoraproject.org/wiki/LifeCycle/EOL

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:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

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 15:27:48 UTC
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.