Bug 114699 - Cancellation during exception handling calls terminate()
Cancellation during exception handling calls terminate()
Status: CLOSED DEFERRED
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-31 15:38 EST by Scott Lamb
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-30 15:33:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Scott Lamb 2004-01-31 15:38:04 EST
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 15:39:03 EST
Created attachment 97393 [details]
demonstration program
Comment 2 Ulrich Drepper 2004-09-28 06:12:55 EDT
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 15:33:43 EDT
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.