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:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=Bhqy/B0FVcZFsQR4NAvst28keot4FEIw4qaP60bWSTbiJIxfsAI1o 19RrtxHJdOMFEcMLmyblCuY62v/hA0suqnpXway3GGA1Tw+FVb/uxsMqZmrGNoUJ bQ9y4QfvyHJnyb9diK2fHGxsdyBzlEItbkYv+Q/pHxXpVmn4dmL8KM= 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:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=g34BpANWXYtAxV+KkHft1y1h1l8=; b=Gp61MntJUw/8cS9KP97CvwKVozF6 OF+0dcIMFq1586SvcJFiLZoW66YQt1cqad/WAlVxjh7EAkO0GKs4f1X32t/AHgO3 rLqKU9Pqo7saMOsQygDDil+j1fNHQ+Kq1fgy7P+z9ZcAxXCf5qXrSh5QUw1CX9Bm XLFBAr/DQV7QrY4= 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=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Tue, 2 Dec 2014 16:52:13 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Fatal error using flock Message-ID: <20141202155213.GX3810@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20141202134803 DOT GW3810 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TOcCsfss/f1fJPnO" Content-Disposition: inline In-Reply-To: <20141202134803.GW3810@calimero.vinschen.de> User-Agent: Mutt/1.5.23 (2014-03-12) --TOcCsfss/f1fJPnO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: > >=20 > > 0 [main] flock 7008 C:\cygwin64\bin\flock.exe: *** fatal error - > > NtCreateEvent(lock): 0xC0000035 > > ./test.sh: line 12: 7008 Hangup flock -x 5 >=20 > Confirmed. I'll investigate. >=20 > > 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. >=20 > 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. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --TOcCsfss/f1fJPnO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUfeAtAAoJEPU2Bp2uRE+gbDEQAKQdvaf+Kjij0iVB3VeJKexu ArhguNVKLRMyluW63vXXNjLOblwCFtIl6eZSP9VoqqlMhhjwWHuvVsGG302IB7Ak bw1mUrLTGEDY8125xCluv3826An3g8vRRd2ZZ/Guw+wA0rxHG+epWCeIwXZGS1bc C1zk/n/AC7btGbt00J86xii5I/UGEGSirukSNyGej2kflwdIxoJRcvTShn+HVMCy T16eai1QInRt0PkmKvuzs36FjU3mG93IgSRQtXv4a6dBquYEAzqoBnrfXXnVC+qT sgwOtAhVZRnwKlpsOgXgzj9QCY6Mg0r59+ocH6yC9IlI/nqAGWtsBfYXXFtlbSgA NdonyTPbrFhXQosVPCYkrx3ocSKxg3s8nk7CSkUSiECGkWZ26xWMcqOvxGj68jnw u3JPdK5TABNDHLY9jEfaEg19pwACZCWIbnPhwmiL9SsQG+4qH1iIgdkLycTKMsYp ch6coEfDPHJQjNaDweWKm0tBqNP+4iqIcqSFO0wW/M07hKxIW//EnYMC+voP2oj0 SIpbMQ77ddzgY63ndDfMALd14+3yf0qRM1Al1POylmRuZhwPOhYip4ZllWmY8eAF Bi2+J1ruUlto52pQsZ0xT0rNW3bd1g/Eaps05RauqyHftdAiIEcvXAoWSendntEO rAf/Wlo917E+8kt+l+Hw =S+kj -----END PGP SIGNATURE----- --TOcCsfss/f1fJPnO--