This is the mail archive of the cygwin 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]

Re: Fatal error using flock


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.

>  but the inner workings of the locking
> system is a bit beyond me.

Pity.  When I created the locking code I added lots and lots of comments
in the hope that

  a) other people would have a chance to understand how the code is
     supposed to work and

  b) *I* have a chance to understand how the code is supposed to work
     after not looking at the code for a year or longer...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgp9i9ubgKoym.pgp
Description: PGP signature


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