This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/13613] New: Cancellation is broken in single-threaded processes


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]