https://bugs.winehq.org/show_bug.cgi?id=39614
Bug ID: 39614 Summary: Wine initialises a Critical Section for Mutexes by NULL instead of (void*)-1 Product: Wine Version: 1.7.55 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: EoD@xmw.de Distribution: ---
After initialising a critical section for mutexes by using
static CRITICAL_SECTION Mutex = {(PCRITICAL_SECTION_DEBUG)-1, -1, 0, 0, 0, 0};
wine crashed in "RtlpWaitForCriticalSection()".
According to http://locklessinc.com/articles/pthreads_on_windows/ this is a valid way of initialising the critical section. However, Wine seems to initialize it by NULL instead of (void*)-1: http://source.winehq.org/git/wine.git/blob/e8b9bda53ac39c913ddc93de0308f0c8b...
This is a re-reporting of an issue on github: https://github.com/apitrace/apitrace/issues/397 with a backtrace in https://gist.github.com/EoD/cf759116a4af8744bdb7