Red Hat Bugzilla – Bug 74282
race condition in bash
Last modified: 2007-04-18 12:46:48 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.9) Gecko/20020513
Description of problem:
In tracking down some hardware problems with an SMP system, we came up with this
very simple test.
while [ 1 ] ; do date ; done | uniq -c
I would expect that on an otherwise idle machine the date command can be run
roughly the same number of times per second over long periods of time. But we
see a trend over a few minutes where fewer and fewer instances are run.
Sometimes this leads to that shell crashing.
I posted this to the bash-bug list and got the following reply:
Date: Mon, 16 Sep 2002 10:10:32 -0400
From: Chet Ramey <email@example.com>
Cc: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org
Subject: Re: odd behavior of while loop, leading to crash
It's a race condition. There is a fix in bash-2.05b.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Fixed package is bash-2.05b-5.