Bug 211437 - Bug in pthread_cond_wait in conjunction with thread cancellation.
Bug in pthread_cond_wait in conjunction with thread cancellation.
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2006-10-19 04:57 EDT by Joachim Koetzing
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-10-19 09:51:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
C++ program for testing the bug. (5.32 KB, text/plain)
2006-10-19 04:57 EDT, Joachim Koetzing
no flags Details

  None (edit)
Description Joachim Koetzing 2006-10-19 04:57:11 EDT
Description of problem:

When a thread which is currently waiting on a condition with pthread_cond_wait
() is cancelled with pthread_cancel() and shortly before that, the condition 
was signalled by pthread_cond_signal(), then the condition variable may become 

If the condition is reused afterwards the thread get stuck in pthread_cond_wait

Version-Release number of selected component (if applicable):
fc5, glibc-2.4-8 und
fc3, glibc-2.3.6-0.fc3.1

How reproducible:

See attached file.
If you execute the program, '+' charecters are displayed as long as all works 
fine. After a while the condition variable gets corrupted and then '-' 
characters are displayed. Though the main thread signals the condition 
repeatedly then, the side thread stucks in pthread_cond_wait.

Additional info:
A work around to the problem is to destroy and initialize again the condition 
variable after the thread was cancelled.
Comment 1 Joachim Koetzing 2006-10-19 04:57:14 EDT
Created attachment 138868 [details]
C++ program for testing the bug.
Comment 2 Jakub Jelinek 2006-10-19 09:51:02 EDT
This sounds very much like BZ#3123, which is fixed in glibc-2.4-11 (the current
FC-5 update glibc).  Certainly I couldn't reproduce the problem with your
testcase on dual G5 with glibc-2.4-11.

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