Bug 73386

Summary: Intermittent problems with pthread mutexes on dual-processor systems
Product: [Retired] Red Hat Linux Reporter: Wan-Teh Chang <wtc>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 7.2CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-04-22 07:09:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test program threads.c none

Description Wan-Teh Chang 2002-09-03 21:59:44 UTC
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
fixed.

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


How reproducible:
Sometimes

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
   date
   done

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 22:01:26 UTC
Created attachment 74784 [details]
Test program threads.c

Comment 2 Ulrich Drepper 2003-04-22 07:09:26 UTC
This seems to work just fine on RHL9, even with the LinuxThreads libpthreads,
not only with NPTL.