From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24600 invoked by alias); 2 Dec 2014 15:52:18 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 24581 invoked by uid 89); 2 Dec 2014 15:52:17 -0000 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 Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Dec 2014 15:52:16 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 04E618E1439; Tue, 2 Dec 2014 16:52:13 +0100 (CET) Date: Tue, 02 Dec 2014 15:52:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Fatal error using flock Message-ID: <20141202155213.GX3810@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20141202134803.GW3810@calimero.vinschen.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) X-SW-Source: 2014-12/txt/msg00012.txt.bz2 --TOcCsfss/f1fJPnO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1459 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 Content-length: 819 -----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--