Bug 112602 - Strange pthread_testcancel exception behavior
Strange pthread_testcancel exception behavior
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-24 04:05 EST by Scott Lamb
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-01-06 15:54:30 EST
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 (4.50 KB, text/plain)
2003-12-24 04:06 EST, Scott Lamb
no flags Details

  None (edit)
Description Scott Lamb 2003-12-24 04:05:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
I'm getting weird exception behavior from pthread_testcancel(). Based
on exactly where I place it, it seems to either throw a C++ exception
or not. If it does throw an exception, it calls std::unexpected().

The std::unexpected() part I can begin to explain. My
/usr/include/pthread.h is identical to
linuxthreads/sysdeps/pthread/pthread.h in current glibc CVS, not
nptl/sysdeps/pthread/pthread.h. It has __THROW clauses in a lot of
places that are cancelable: pthread_testcancel(),
pthread_setcancelstate(), pthread_setcanceltype(),
pthread_cleanup_pop_restore_np() jump out at me. Is this just a case
of the wrong header getting installed in the glibc-devel package?

In addition to glibc-2.3.3-1, I have glibc-devel-2.3.3-1, gcc-3.3.2-1,
kernel-2.4.22-1.2115.nptl.

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

How reproducible:
Always

Steps to Reproduce:
Compile test_cancellation_exception.cc with and without
-DSEE_WEIRD_FEDORA_BEHAVIOR and run it.

Actual Results:  Without -DSEE_WEIRD_FEDORA_BEHAVIOR,
Testing nanosleep:
Cancellation exception type: generic
Cancellation invokes destructors.

Testing pthread_testcancel inside else:
terminate called without an active exception
Aborted


With -DSEE_WEIRD_FEDORA_BEHAVIOR:
Testing pthread_testcancel directly:
Cancellation exception type: none
Cancellation does not invoke destructors.

Expected Results:  Without -DSEE_WEIRD_FEDORA_BEHAVIOR:

Testing nanosleep:
Cancellation exception type: generic
Cancellation invokes destructors.

Testing pthread_testcancel inside else:
Cancellation exception type: generic
Cancellation invokes destructors.


With -DSEE_WEIRD_FEDORA_BEHAVIOR:
Testing pthread_testcancel directly:
Cancellation exception type: generic
Cancellation invokes destructors.
Comment 1 Scott Lamb 2003-12-24 04:06:24 EST
Created attachment 96691 [details]
demonstration program
Comment 3 Scott Lamb 2004-01-06 15:54:30 EST
Works now with glibc-2.3.3-3. Thanks.

(Out of curiosity, why was my -DSEE_WEIRD_FEDORA_BEHAVIOR causing it
to do the old-style cancellation without a C++ exception? I don't see
that mentioned in your mailing list post.)
Comment 4 John Flanagan 2004-05-11 21:28:23 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-212.html

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