Fatal error using flock

Kyle R. kroes921@gmail.com
Tue Dec 2 05:43:00 GMT 2014


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

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. I found a similar problem in an older thread (here:
https://sourceware.org/ml/cygwin/2011-08/msg00480.html) which may help
to shed some light on the issue, but the inner workings of the locking
system is a bit beyond me. My full Cygwin version is "CYGWIN_NT-6.3
1.7.33-2(0.280/5/3) 2014-11-13 15:47", and my cygcheck output is
attached along with the STC and flock's stackdump. The cygcheck output
has been edited to remove one license server address.

Thanks,
Kyle R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stc.sh
Type: application/x-sh
Size: 122 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141202/fbf25dc8/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flock.exe.stackdump
Type: application/octet-stream
Size: 863 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141202/fbf25dc8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 37154 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141202/fbf25dc8/attachment-0001.obj>
-------------- next part --------------
--
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


More information about the Cygwin mailing list