X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-0.8 required=5.0	tests=AWL,BAYES_20,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4D029937.5080007@etr-usa.com>
Date: Fri, 10 Dec 2010 14:18:47 -0700
From: Warren Young <warren@etr-usa.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
To: Cygwin-L <cygwin@cygwin.com>
Subject: Re: 1.7.7: rm -rf sometimes fails - race condition?
References: <4D026815.4070606@gmx.de> <20101210182652.GA27615@ednor.casa.cgf.cx> <4D027DDE.1000905@gmx.de>
In-Reply-To: <4D027DDE.1000905@gmx.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
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

On 12/10/2010 12:22 PM, Matthias Andree wrote:
>>> 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.
>
> Well, I don't know a solution but I think this is unexpected behaviour.

When some bit of third-party software patches the kernel and breaks its 
API -- which includes details like "when this call returns a success 
code, it means it succeeded" -- that is going to result in unexpected 
behavior in any program that calls that syscall.

If you were to take a survey of existing Windows programs and sort them 
according to density of calls into the deepest parts of the Windows 
kernel, I'd bet Cygwin would be way over at the high-density end.  Since 
antimalware programs hook these same parts of the kernel to do their 
job, bugs in those hooks will affect Cygwin more often than most other 
Windows programs.

Cygwin doesn't -- and shouldn't -- patch around such bugs.  Cygwin 
probably contains code to work around bugs in Windows itself, but that's 
as far as it should go.

You say you've disabled your antimalware software and the problem 
persists.  I doubt you've actually gotten yourself back to a stock 
Windows configuration, but if so, you should be able to write a program 
that will show the same behavior on anyone's system.  If you can do 
that, I think a fix would shortly follow.  I'm not making promises of 
other people's resources, just making a history-based prediction.

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

