X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0	tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4D026815.4070606@gmx.de>
Date: Fri, 10 Dec 2010 18:49:09 +0100
From: Matthias Andree <matthias.andree@gmx.de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: 1.7.7: rm -rf sometimes fails - race condition?
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Greetings,

I see that "rm -rf" on a directory sometimes fails, like here:

|>>> Creating source package
| fetchmail-6.3.19-1.cygport
| fetchmail-6.3.19-1.cygwin.patch
| fetchmail-6.3.19.tar.bz2
|>>> Removing work directory in 5 seconds...
|>>> Removing work directory NOW.
| rm: cannot remove `/usr/src/fetchmail-6.3.19-1/inst/usr/share/locale/da':
Directory not empty
| Command exited with non-zero status 1

Alternatively, you get "...in use" for an error, however, in this case, it
appears that the corresponding syscall triggered by rm(1) had already returned
but the file wasn't fully removed from the directory yet.

I've seen this happen for a while now.  This happens sporadically, and retrying
the operation usually succeeds, so it matters less in an interactive shell.
However, this often breaks scripts, in this case, cygport.

This looks like either a premature return from a syscall or libcall, or like a
genuine race in the system.

In case it matters, this is
- Windows 7 Prof. 32-bit German
- with Sophos Endpoint Security and Control ver. 9 and
- Microsoft Windows Defender.
- coreutils 8.5-2
- uname -a:
  CYGWIN_NT-6.1 somehost 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin


Has anyone seen similar things?

Is it worth investigating where Sophos hooks into the system with Helios or
other tools?  (Judging from the list traffic, Sophos is rather the invisible
observer type than getting in the way like usual suspects among the BLODA
residents do.)

I'd rather not see the need to disable virus inspection software in order to run
Cygwin though.

Thanks &
Best regards

-- 
Matthias Andree

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

