https://bugs.winehq.org/show_bug.cgi?id=48875
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source Summary|Segfault when calling |Winelib applications can't |InitializeCriticalSection |call the Wine API during |(Kernel32.dll) during |static constructors |static initialization | Resolution|--- |DUPLICATE Status|UNCONFIRMED |RESOLVED
--- Comment #11 from Fabian Maurer dark.shadow4@web.de --- Okay, so the problem is indeed the program being a .so file (winelib) instead of an .exe (MinGW).
When the program is loaded, during wine_dlopen, the static constructors are run. But only during main, wine gets a chance to fixup the imports by calling LdrInitializeThunk.
So during static constructors no wine code can be called, since the imports are not fixed up yet.
No idea how to solve this though.
Marking dupe of already existing bug 40502.
*** This bug has been marked as a duplicate of bug 40502 ***