X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=RevuEnOZrUrBwEzN tSWXbD5DXqT2jXV7ifKLlvbqEV79LqCTfgQVIMKMRv79VMoiQfKXYoa1is5ftaEZ 5hmKiBGeWyZdjrG50PwNEFmUtbFJNbVciDnM9wHqPTAnp7pFZ6y+6tUEpH9ALf3H McCeUyXxO9/1zmsWlEClm7i+ftQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=fh/rhqSVs7Y11DMeNB0l7z lL1+0=; b=N2TG2NUwocmGnsGZlnZcjB1Q/51vzkRPXhBkwx0SnXoG+lGxUK3Wj3 8RHX0AAdQVSYNRdHCGfI2G0aQwQDnqvU1K2IHxIGYDSCg+esLtYxASQij3m/V6ra FeZPQke4heyXLT9GjVdQsUl7mr0R5JhXwFC9OxB0S5Vbok2XiJ/Qc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.7 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_BODY_URIBL_PCCC,KAM_FROM_URIBL_PCCC,KAM_THEBAT,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.ht-systems.ru Date: Wed, 3 Dec 2014 10:27:41 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <11948217.20141203102741@yandex.ru> To: Corinna Vinschen , cygwin AT cygwin DOT com Subject: Re: Fatal error using flock In-Reply-To: <20141202155213.GX3810@calimero.vinschen.de> References: <20141202134803 DOT GW3810 AT calimero DOT vinschen DOT de> <20141202155213 DOT GX3810 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Greetings, Corinna Vinschen! > On Dec 2 14:48, Corinna Vinschen wrote: >> On Dec 1 23:43, Kyle R. wrote: >> > I've run into a problem with flock while doing some parallel scripting >> > in bash (also seen in dash) on the latest 64-bit version of Cygwin >> > running on Windows 8.1. In the attached simple test case, the code >> > locks and unlocks a file in a loop. After the first iteration of the >> > loop is completed, this error is thrown: >> > >> > 0 [main] flock 7008 C:\cygwin64\bin\flock.exe: *** fatal error - >> > NtCreateEvent(lock): 0xC0000035 >> > ./test.sh: line 12: 7008 Hangup flock -x 5 >> >> Confirmed. I'll investigate. >> >> > However, the problem doesn't occur if I comment out the "while true >> > do" and "done" and call the script file from a while loop in another >> > bash script. >> >> This sounds like a problem with the parent process holding the event >> object connected to the lock. This doesn't happen in the second case, >> because the parent holding the lock disappeared as well. > Ouch. The handle in the parent got created non-inheritable. That's > bad if the handle is utilized in subsequent child processes which rely > on being able to access the handle. > I applied a patch and created a new developer snapshot on > https://cygwin.com/snapshots/ > Please give it a try. Works here with original STC. -- WBR, Andrey Repin (anrdaemon AT yandex DOT ru) 03.12.2014, <10:27> Sorry for my terrible english... -- 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