public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/417] New: pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang.
@ 2004-09-30  9:47 sebastien dot decugis at ext dot bull dot net
  2004-09-30  9:48 ` [Bug nptl/417] " sebastien dot decugis at ext dot bull dot net
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sebastien dot decugis at ext dot bull dot net @ 2004-09-30  9:47 UTC (permalink / raw)
  To: glibc-bugs

In some circumstances, the pthread_mutex_timedlock operation can be awaken by a
call to pthread_mutex_unlock, but the timeout expires before it is scheduled. In
case the futex status is 1 when the awaken thread resumes, it will return the
timeout status and leave the futex in "1" state. In case another thread whould
be waiting for the same mutex, it will never be awaken.

This bug was first posted on 10/2003 in comp.programming.threads
http://groups.google.com/groups?selm=x74qxsrde4.fsf%40bolo.xenadyne.com

I've checked, the faulty behavior is still present in the current nptl code.

-- 
           Summary: pthread_mutex_timedlock can sometime consume a
                    futex_wake signal and return a timeout -- leading to a
                    hang.
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: sebastien dot decugis at ext dot bull dot net
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=417

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug nptl/417] pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang.
  2004-09-30  9:47 [Bug nptl/417] New: pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang sebastien dot decugis at ext dot bull dot net
@ 2004-09-30  9:48 ` sebastien dot decugis at ext dot bull dot net
  2004-09-30  9:51 ` sebastien dot decugis at ext dot bull dot net
  2004-10-01 10:34 ` drepper at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: sebastien dot decugis at ext dot bull dot net @ 2004-09-30  9:48 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From sebastien dot decugis at ext dot bull dot net  2004-09-30 09:48 -------
Created an attachment (id=211)
 --> (http://sources.redhat.com/bugzilla/attachment.cgi?id=211&action=view)
Sample test to show the bug and more detailed explanation

This archive contains a sample code to show the error (will reproduce on a
mono-CPU machine), and a file describing the problem in a more detailed
fashion.

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=417

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug nptl/417] pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang.
  2004-09-30  9:47 [Bug nptl/417] New: pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang sebastien dot decugis at ext dot bull dot net
  2004-09-30  9:48 ` [Bug nptl/417] " sebastien dot decugis at ext dot bull dot net
@ 2004-09-30  9:51 ` sebastien dot decugis at ext dot bull dot net
  2004-10-01 10:34 ` drepper at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: sebastien dot decugis at ext dot bull dot net @ 2004-09-30  9:51 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From sebastien dot decugis at ext dot bull dot net  2004-09-30 09:51 -------
Created an attachment (id=212)
 --> (http://sources.redhat.com/bugzilla/attachment.cgi?id=212&action=view)
patch attempt to correct the bug for i486 architecture

Here is an attempt I made to correct the problem. I'm not sure if there are no
undesirable side effects. The basics is that if the futex was in "1" state, we
change it to "2". The only problem I can see is that we will eventually enter
the kernel on a mutex_unlock where it would not be necessary....

-- 


http://sources.redhat.com/bugzilla/show_bug.cgi?id=417

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug nptl/417] pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang.
  2004-09-30  9:47 [Bug nptl/417] New: pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang sebastien dot decugis at ext dot bull dot net
  2004-09-30  9:48 ` [Bug nptl/417] " sebastien dot decugis at ext dot bull dot net
  2004-09-30  9:51 ` sebastien dot decugis at ext dot bull dot net
@ 2004-10-01 10:34 ` drepper at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: drepper at redhat dot com @ 2004-10-01 10:34 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2004-10-01 10:34 -------
I've checked in some changes which should fix the problem.  The test program is
bogus, though.  At least the assert is and this is the only reason why I saw the
program abort at any time.

Somebody might want to tell the original poster about the change and ask for
retesting.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sources.redhat.com/bugzilla/show_bug.cgi?id=417

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-01 10:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-30  9:47 [Bug nptl/417] New: pthread_mutex_timedlock can sometime consume a futex_wake signal and return a timeout -- leading to a hang sebastien dot decugis at ext dot bull dot net
2004-09-30  9:48 ` [Bug nptl/417] " sebastien dot decugis at ext dot bull dot net
2004-09-30  9:51 ` sebastien dot decugis at ext dot bull dot net
2004-10-01 10:34 ` drepper at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).