Bug 211437 - Bug in pthread_cond_wait in conjunction with thread cancellation.
Summary: Bug in pthread_cond_wait in conjunction with thread cancellation.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 5
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-19 08:57 UTC by Joachim Koetzing
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-10-19 13:51:02 UTC
Type: ---
Embargoed:


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

Description Joachim Koetzing 2006-10-19 08:57:11 UTC
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 
corrupted.

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 08:57:14 UTC
Created attachment 138868 [details]
C++ program for testing the bug.

Comment 2 Jakub Jelinek 2006-10-19 13:51:02 UTC
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.