From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21208 invoked by alias); 4 Jul 2011 12:22:12 -0000 Received: (qmail 21193 invoked by uid 22791); 4 Jul 2011 12:22:11 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL,TO_NO_BRKTS_PCNT X-Spam-Check-By: sourceware.org Received: from BACHE.ECE.CMU.EDU (HELO bache.ece.cmu.edu) (128.2.129.23) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Jul 2011 12:21:57 +0000 Received: from [192.168.0.100] (69-196-174-65.dsl.teksavvy.com [69.196.174.65]) by bache.ece.cmu.edu (Postfix) with ESMTP id 47BE310A for ; Mon, 4 Jul 2011 08:21:56 -0400 (EDT) Message-ID: <4E11B063.7000808@cs.utoronto.ca> Date: Mon, 04 Jul 2011 12:22:00 -0000 From: Ryan Johnson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: untarring symlinks with ../ fails randomly, silghtly OT References: <1309437783.2097.68.camel@geldmacher-pc> <20110630133703.GE9552@calimero.vinschen.de> <4E0C90B2.2060409@cornell.edu> <1309447688.12904.21.camel@geldmacher-pc> <1309770955.22699.15.camel@geldmacher-pc> <20110704104656.GA20822@calimero.vinschen.de> <4E119C61.7070505@cs.utoronto.ca> <20110704113319.GC20822@calimero.vinschen.de> In-Reply-To: <20110704113319.GC20822@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-07/txt/msg00032.txt.bz2 On 04/07/2011 7:33 AM, Corinna Vinschen wrote: > On Jul 4 06:56, Ryan Johnson wrote: >> On 04/07/2011 6:46 AM, Corinna Vinschen wrote: >>> On Jul 4 11:15, Wolf Geldmacher wrote: >>>> As an aside: >>>> I also used to have some trouble with "rm -rf" of a directory >>>> hierarchy failing more or less reproducibly (like: 80% of the >>>> time) because files were presumably still "in use". Repeating >>>> the command several times would succeed, though. >>>> >>>> Downgrading from cygwin1.dll/1.7.9.1 to cygwin1.dll/1.7.8.1 >>>> seems to have solved that issue as well - still have to see >>>> the first "retry to delete". >>>> >>>> This may or may not be related to the original report, as it also reeks >>>> of a race condition during file/directory operations. >>> I can neither reproduce the tar problem, nor can I reprocude the rm >>> problem. I tried this under 2008R2 which is basically the same as your >>> W7-64 bit. I used local and remote drives to test the issue but to no >>> avail. >>> >>> Are you sure this isn't a BLODA problem which is triggered by the >>> changes in 1.7.9? >>> >>> I just took a look through the changes between 1.7.8 and 1.7.9, and >>> the list of changes which affect filesystem access is pretty small: >>> >>> [snip] >>> >>> So, is it possible that the request for WRITE_DAC access in the call to >>> NtCreateFile triggers some hiccup of your virus checker? It could easily >>> explain both effects. >> I have also seen the rm -rf problem occasionally on my w7-64 >> machine, and I don't think anything from BLODA is installed. > Also with 1.7.8? Given the minor number of FS-related changes, it's > so very unlikely that they would cause a differnce between 1.7.8 and > 1.7.9. > >> However, I haven't noticed the issue since disabling the search >> indexer on my machine. I did this on the hunch that I often delete >> large directory trees which aren't very old (e.g. after >> untar/configure/make of some source package), and that it wouldn't >> be a big surprise if indexing and cygwin's rm don't mix for whatever >> reason. > Hard to imagine that setting the WRITE_DAC flag would interfere with the > search indexer. On second thought, the flag is only set if a file does > not exist yet and NtCreateFile gets called to create the file. That > makes it especially unlikely that this would affect unlinking. > > However, given that you can reproduce the issue, could you test the > scenario again? If the issue occurs, can you disable the following code > in fhandler.cc and see if it changes anything? > > 616 else if (!exists ()&& has_acls ()) > 617 /* If we are about to create the file and the filesystem supports > 618 ACLs, we will overwrite the DACL after the call to NtCreateFile. > 619 This requires a handle with additional WRITE_DAC access, > 620 otherwise set_file_sd has to open the file again. */ > 621 access |= WRITE_DAC; > Sorry, I have no idea which version of the dll I had at the time. It was at least a month ago, maybe more. However, I was wrong about not seeing the problem since. Choosing a random source dir to blow away: > $ rm -rf Python-2.6.6 > rm: cannot remove `Python-2.6.6/Lib/lib2to3/tests': Directory not empty > $ rm -rf Python-2.6.6 > $ This seems to happen more than half the time (different non-empty dir every time). Naturally, running under strace makes the problem go away (it doesn't help that strace kills stderr, where any error messages might have gone). Running the following command 10x: $ tar -xaf Python-2.6.6.tar.bz2 && sleep 3 && (rm -rf Python-2.6.6 || (echo 'Retrying...' && rm -rf Python-2.6.6)) I get six times with no error, two times with one error, one time each with two and three errors. I'm currently updating and rebuilding my cygwin sources to try out your patch... Ryan -- 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