Hi, Attach is the simple test case I use to reproduce the valgrind warning and random failures. Compile the test case in Cygwin with below command line: $ gcc -g -O0 flock.c -o flock.exe Thanks!