https://bugs.winehq.org/show_bug.cgi?id=48875
Bug ID: 48875 Summary: Segfault when calling InitializeCriticalSection (Kernel32.dll) during static initialization Product: Wine Version: 5.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winelib Assignee: wine-bugs@winehq.org Reporter: winehq@twig.hk Distribution: ---
Created attachment 66810 --> https://bugs.winehq.org/attachment.cgi?id=66810 Example Code that causes segfault
When InitializeCriticalSection is called during static initialization, the program segfaults. When it's removed, or moved into WinMain, it does not.
Code Snippet: #include <windows.h>
CRITICAL_SECTION crit;
struct Critical{ Critical(){ InitializeCriticalSection(&crit); } };
static Critical critical;
...Snip...
The code was compiled and run with: wineg++ simple.cpp && wine a.out.so