Bug 73386 - Intermittent problems with pthread mutexes on dual-processor systems
Intermittent problems with pthread mutexes on dual-processor systems
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-09-03 17:59 EDT by Wan-Teh Chang
Modified: 2016-11-24 09:50 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-04-22 03:09:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test program threads.c (3.85 KB, text/plain)
2002-09-03 18:01 EDT, Wan-Teh Chang
no flags Details

  None (edit)
Description Wan-Teh Chang 2002-09-03 17:59:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1)
Gecko/20020823 Netscape/7.0

Description of problem:
I have a small test program that demonstrates a bug in
the pthreads library.  Since the test program uses
several pthread features (mutexes, condition variables,
thread creation and join), it's not clear which feature
has a bug.  I am guessing it's the mutexes because the
symptom of the bug is that a variable protected by a
mutex may have the wrong value.

The bug occurs rarely.  I need to use a shell script to
run the test program repeatedly and often need to run it
for several minutes before it fails.  I can make the
test program fail on dual-processor machines but haven't
been able to do that on uniprocessor machines.

The test program creates threads, which in turn create
additional threads and join with them.  I wanted to
mention the recursive thread creation because two other
bugs (bug 43742 and bug 61353) occur under that condition.
I also want to mention that I can't reproduce this bug on
a dual-processor system running Red Hat Linux Advanced
Server release 2.1AS/i686, which has a newer kernel and
glibc than Red Hat Linux 7.2, so this bug may have been

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Compile the test program I am going to attach with
   this command

   % gcc -pthread threads.c -o threads

2. Run it repeatedly with this shell script:

   while ./threads; do

Actual Results:  On a dual-processor Red Hat Linux 7.2 machine, you
will eventually hit the assertion failure

threads: threads.c:112: CreateThreads: Assertion `!locked' failed.

Expected Results:  The script should be able to run the test program
repeatedly for hours without failure.
Comment 1 Wan-Teh Chang 2002-09-03 18:01:26 EDT
Created attachment 74784 [details]
Test program threads.c
Comment 2 Ulrich Drepper 2003-04-22 03:09:26 EDT
This seems to work just fine on RHL9, even with the LinuxThreads libpthreads,
not only with NPTL.

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