This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

1.3.12: rm -rf on directory with open files hangs


Hi all, I've been bitten lately by rm -rf on a directory occasionally 
hanging. After some fooling around, I've come up with a simple way of 
reproducing the problem. I'm currently using 1.3.12 of the DLL on Windows 
2000 Professional SP2. Results from 'cygcheck -s -v -r' are attached.

Way to reproduce is to create a directory (say foo, in your home dir) and 
place a largish file in that (I've been using 'od -c /bin/gcc.exe > 
foo/foo.txt' to produce it, but anything would do). Then in another shell 
window, keep that file open. I do this by using 'less foo/foo.txt' under 
bash, or 'type foo\foo.txt | more' under cmd.exe. Then try to do an 'rm -rf 
foo' in the original shell window. The rm will hang. I can kill it ok with a 
^C, or I can quit out of the "less" in the other window, at which point the 
"rm" will proceed and succeed.

I had a bit of a poke around with strace and it seems that "rm" is stuck in a 
loop, continually reading the contents of directory "foo". I looked in the 
"rm" sources, but couldn't really see an obvious reason for this to occur, so 
thought I'd better seek some more help. I've attached some bzip2'ed strace 
runs. One shows the results of killing the rm with a ^c, the other shows the 
results of rm completing after I close foo/foo.txt by quitting the less.

Any help here would be greatly appreciated. Thanks!

Regards
M.Beach

Attachment: cygcheck.out
Description: Text document

Attachment: rm-killed-strace.txt.bz2
Description: BZip2 compressed data

Attachment: rm-success-strace.txt.bz2
Description: BZip2 compressed data

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]