Bug 73386 - Intermittent problems with pthread mutexes on dual-processor systems
Summary: Intermittent problems with pthread mutexes on dual-processor systems
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.2
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-09-03 21:59 UTC by Wan-Teh Chang
Modified: 2016-11-24 14:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-04-22 07:09:26 UTC
Embargoed:


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

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.


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