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/4169] New: SIGSTOP then SIGCONT on a whole process incorrectly releases a thread from sigwait(3) for another signal


If a whole process, which has a thread waiting with sigwait(3), is stopped with
SIGSTOP, then when it is restarted with SIGCONT sigwait returns without writing
to *sig (second argument).  This appears to be in contradiction with
POSIX-1003.1 2004.

http://www.opengroup.org/onlinepubs/000095399/functions/sigwait.html

Steps to reproduce:

$ wget http://purposeful.co.uk/testcase.c
$ gcc -o testcase -pthread -lpthread testcase.c
$./testcase

The test program prints 'a' from one thread and 'b' from another.  After ten of
each the 'b' thread calls sigwait, and you get just 'a's.  When this happens,
hit Ctrl+Z.  Now restart the process (with fg).  The 'b' thread resumes straight
away.

Expected behaviour:

$ gcc -o testcase -pthread -lpthread -DWORKAROUND testcase.c
$./testcase

Now do the same.  The 'b' thread returns to its waiting state.  You  get as more
of just 'a' until there have been 10 of them and then a mix again.

-- 
           Summary: SIGSTOP then SIGCONT on a whole process incorrectly
                    releases a thread from sigwait(3) for another signal
           Product: glibc
           Version: 2.3.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: tom dot viza at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=4169

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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