delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/12/10/13:27:20

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 10 Dec 2010 13:26:52 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.7: rm -rf sometimes fails - race condition?
Message-ID: <20101210182652.GA27615@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4D026815 DOT 4070606 AT gmx DOT de>
MIME-Version: 1.0
In-Reply-To: <4D026815.4070606@gmx.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Fri, Dec 10, 2010 at 06:49:09PM +0100, Matthias Andree wrote:
>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?

Yes and you seem to have nailed the problem - it happens when a virus checker
hooks into a syscall and allows it to return before completion.  I don't think
we want to modify Cygwin to not trust success return values from system calls.

cgf

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

- Raw text -


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