Hi Takashi,

Can your fix for flock (8f551af4f) also fix a similar issue between processes?
I figure that if Cygwin uses some kind of shared memory to handle
locking/inodes/..., then the issue that I had between threads would
also apply between processes.

There is a new test in MSYS2 fish that trigger something very similar
to the old issue but across processes this time:
- one application is blocked with this stacktrace:
========
Thread 1 (Thread 15116.0x8304 "fish"):
#0  0x00007ffb525c1c44 in ntdll!ZwWaitForSingleObject () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#1  0x00007ffb4f5e76af in WaitForSingleObjectEx () from
/c/WINDOWS/System32/KERNELBASE.dll
#2  0x0000000180067731 in lockf_t::create_lock_obj
(this=this@entry=0x80000cb50) at
/d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:838
#3  0x0000000180069def in lf_setlock (lock=0x80000cb50,
node=0x80000c570, clean=0x7ffff42e8, fhdl=<optimized out>) at
/d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:1401
#4  fhandler_base::lock (this=<optimized out>, a_op=<optimized out>,
fl=<optimized out>) at
/d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:1148
#5  0x000000018006a6a4 in flock (fd=4, operation=1) at
/d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:1864
#6  0x00000001801ac5b4 in _sigfe () at sigfe.s:35
...
====
- another is blocked with the following:
====
Thread 1 (Thread 20040.0x75ac "fish"):
#0  0x00007ffb525c1c44 in ntdll!ZwWaitForSingleObject () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#1  0x00007ffb4f5e76af in WaitForSingleObjectEx () from
/c/WINDOWS/System32/KERNELBASE.dll
#2  0x000000018006703b in inode_t::LOCK (this=0x800015360) at
/d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:314
#3  inode_t::get (dev=1881899537, ino=ino@entry=13792273859584895,
create_if_missing=create_if_missing@entry=false, lock=lock@entry=true)
at /d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:504
#4  0x0000000180068e31 in fhandler_base::del_my_locks
(this=0x800013a60, from=on_close) at
/d/S/B/src/msys2-runtime/winsup/cygwin/flock.cc:402
#5  0x000000018010d90f in fhandler_base::close_with_arch
(this=0x800013a60, flag=flag@entry=-1) at
/d/S/B/src/msys2-runtime/winsup/cygwin/fhandler/base.cc:1309
#6  0x00000001800de66b in __close (fd=5, flag=-1) at
/d/S/B/src/msys2-runtime/winsup/cygwin/syscalls.cc:1710
#7  close (fd=5) at /d/S/B/src/msys2-runtime/winsup/cygwin/syscalls.cc:1722
#8  0x00000001801ac5b4 in _sigfe () at sigfe.s:35
...
====

Killing one or the other unblock the remaining one.

Thanks,
Nahor

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to