http://bugs.winehq.org/show_bug.cgi?id=7229
Summary: Critical section problem in ntdll.dll Product: Wine Version: 0.9.29. Platform: PC OS/Version: FreeBSD Status: UNCONFIRMED Severity: major Priority: P2 Component: wine-winelib AssignedTo: wine-bugs@winehq.org ReportedBy: yongjhen@fastmailbox.net
There is a race-condition problem in the critical section code in ntdll.dll code.
In critsection.c, for non-linux/x86, non-macosx platforms, fast_wait and fast_wake are not implemented. When the first time the semaphore used for waking up waiting thread(s) are needed, it will be created. But the code to check if a semaphore is present is not protected by critical section by itself. Thus there is a situation that both the thread leaves critical section and the thread enters critical create semaphores, that causes all waiting threads unable to enter that critical section anymore.
Please see the log that demos this situation.