delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/14/13:04:59

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <41E809AD.8000709@byu.net>
Date: Fri, 14 Jan 2005 11:04:29 -0700
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: snapshot 20050114 race

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Something between the stock 1.5.12-1 and the 20050114 snapshot introduced
a data race on removing a directory shortly after being in it.  I couldn't
narrow it down to a repeatable testcase, but notice the difference between
these two runs of a subset of the coreutils-5.3.0 testsuite:

$ make check
make  check-TESTS
make[1]: Entering directory `/home/eblake/coreutils-5.3.0/tests/chgrp'
PASS: no-x
PASS: posix-H
rm: cannot remove directory `basic.1912': Device or resource busy
PASS: basic
rm: cannot remove directory `slink.3060': Device or resource busy
PASS: deref
PASS: recurse
==================
All 5 tests passed
==================
make[1]: Leaving directory `/home/eblake/coreutils-5.3.0/tests/chgrp'
$ make check
make  check-TESTS
make[1]: Entering directory `/home/eblake/coreutils-5.3.0/tests/chgrp'
PASS: no-x
PASS: posix-H
rm: cannot remove directory `basic.4052': Device or resource busy
PASS: basic
rm: cannot remove directory `slink.632': Device or resource busy
PASS: deref
rm: cannot remove directory `recurse.3160': Device or resource busy
PASS: recurse
==================
All 5 tests passed
==================
make[1]: Leaving directory `/home/eblake/coreutils-5.3.0/tests/chgrp'

As seen by the difference on the `recurse' test, the snapshot is
sometimes, but not always, failing to remove the temporary directory right
after cd'ing out of it.  The testsuite is calling /bin/sh scripts with the
idiom:
$ cat race.sh
#! /bin/sh
pwd=`pwd`
tmp=race.$$
trap 'cd $pwd; rm -rf $tmp' 0
mkdir $tmp
cd $tmp
mkdir d
touch f f2 d/f3
#do tests on chgrp $tmp
exit 0

Adding a delay between the cd and rm of the trap makes the rm work all the
time, and reverting to the 1.5.12 release no longer has the problem.  I
wonder if the new code in chown() is causing this race.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB6Ams84KuGfSFAYARAvhiAJ46YwRnehdxAFEeJZQnzuTs0TMdpgCgpsmY
rNcKQLZHqc0ZeiABq1QGsLg=
=glSG
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019