This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/13613] New: Cancellation is broken in single-threaded processes
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Sun, 22 Jan 2012 23:54:42 +0000
- Subject: [Bug nptl/13613] New: Cancellation is broken in single-threaded processes
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13613
Bug #: 13613
Summary: Cancellation is broken in single-threaded processes
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: drepper.fsp@gmail.com
ReportedBy: bugdal@aerifal.cx
Classification: Unclassified
Cancellation is not acted upon unless the process has more than one thread.
Consider the program:
#include <pthread.h>
#include <unistd.h>
int main()
{
char c;
pthread_cancel(pthread_self());
read(0, &c, 1);
return 1;
}
Being a cancellation point, read should cause the pending cancellation request
to be acted upon, and the program should terminate with status 0 as a
consequence of the last thread exiting from cancellation. However, under
glibc/NPTL, the program waits for input then terminates with status 1.
I suspect the cancellation wrapper code is incorrectly checking SINGLE_THREAD_P
and (wrongly) assuming that it implies cancellation is impossible.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.