Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: <003601c1dd93$00693370$0100a8c0@advent02> From: "Chris January" To: References: <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20020405195515 DOT 026fbb28 AT pop3 DOT cris DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20020406092736 DOT 0267b5a8 AT pop3 DOT cris DOT com> Subject: Re: Infinite Loop In "rm -fr" When Busy File Encountered Date: Sat, 6 Apr 2002 18:46:36 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 > > > Greetings, > > > > > > I have encountered a problem in "rm" when used with the "-f" and "-r" > > > options and a busy and hence unremovable file is encountered. > > > > > > When "rm -fr" encounters a busy and hence unremovable file, it goes into an > > > infinite loop consuming as much CPU time as it can get until it is forcibly > > > terminated. The error is completely repeatable as long as the file remains > > > busy by virtue of being open in another program. > > > > > > The file system is NTFS and the mount is binmode. The system is Windows > > > 2000 Pro with SP2 and security patches installed. > > > > > > This is an up-to-date Cygwin installation that is exhibiting no other > > > anomalous behavior. > > > > > > In reference to the attached "cygcheck -rs" output, this happened on "C:" > > > "/cygdrive/c" (reached via a symlink "/c -> /cygdrive/c"). > > > >I tried exhaustively to reproduce this (cygwin1.dll v1.3.10), but failed. > > > "Exhaustively?" In such little time? Oops - exhaustively was the wrong word to use. My apologies! > > Please tell me what you tried. I believe when it happened to me the file > triggering the problem was open for writing. From memory: mkdir test cp test.c test (where test.c is a program that just sleeps in a loop) cd test gcc test.c -otest ./test & cd .. rm -rf test mkdir test2 ln -s $PWD/test test2 rm -rf test2 mkdir test2 ln -s $PWD/test test2 rm -rf test2/* mkdir test/test3 cp test/test test/test3 test/test3/test & rm -rf test mkdir test2 ln -s $PWD/test test2 rm -rf test2/test3 mkdir /cygdrive/c/test cp test/test /cygdrive/c/test /cygdrive/c/test/test & rm -rf /cygdrive/c/test ln -s /cygdrive/c /c rm -rf /c/test And maybe some more, I forget. If it is indeed a bug causing the problem you specified, it probably lies in delqueue.cc somewhere. If you can reproduce the problem, try running rm under strace: strace rm -fr > > Randall Schulz -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/