Bug 114699 - Cancellation during exception handling calls terminate()
Summary: Cancellation during exception handling calls terminate()
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-31 20:38 UTC by Scott Lamb
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-06-30 19:33:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
demonstration program (2.02 KB, text/plain)
2004-01-31 20:39 UTC, Scott Lamb
no flags Details

Description Scott Lamb 2004-01-31 20:38:04 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
rv:1.5) Gecko/20031007 Firebird/0.7

Description of problem:
If a cancellation request is received while handling an exception,
std::terminate() will be called. This is quite bad since it means I
can't safely call close() when handling an IO exception, etc.

I tested for this behavior since cancellation is now handled as an
exception, and C++ can have only one active exception. Could
cancellation be disabled for the duration of the exception handling to
avoid this problem?

Version-Release number of selected component (if applicable):
glibc-2.3.3-3

How reproducible:
Always

Steps to Reproduce:
Compile and run attached test program. 

Actual Results:  $ ./test_cancellation_while_throwing
terminate called without an active exception
Aborted

Expected Results:  The thread is not cancelled, since cancellation can
not safely happen during the exception handling, and there are no
cancellation points in my test code after the exception handling.

Additional info:

Comment 1 Scott Lamb 2004-01-31 20:39:03 UTC
Created attachment 97393 [details]
demonstration program

Comment 2 Ulrich Drepper 2004-09-28 10:12:55 UTC
Of course it is possible to call interfaces which are cancellation
points in exception handlers.  Just disable cancellation first.

I don't see us putting any more effort into the C++ handling.  The
situation is hopeless since there is no cooperation from the C++
maintainers forthcoming.  I'll keep the bug open but mark it as an
enhancements (which it is).

Comment 3 Ulrich Drepper 2005-06-30 19:33:43 UTC
Actually, it's better served by closing as DEFERRED.  Once upstream gcc C++
handles thing correctly you can file an RFE.


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