http://bugs.winehq.org/show_bug.cgi?id=32725
Bug #: 32725 Summary: VC runtime functions crash when called from reloaded library in a thread Product: Wine Version: 1.3.24 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt AssignedTo: wine-bugs@winehq.org ReportedBy: most@museresearch.com Classification: Unclassified
Created attachment 43181 --> http://bugs.winehq.org/attachment.cgi?id=43181 msvcrt-dll-problem.zip
Assume WHAT.DLL is a windows DLL with static MSVCRT linkage. If WHAT.DLL is unloaded and reloaded, it's C runtime functions like std::cout can crash when called from a thread.
According to Piotr Caban (piotr dot caban at gmail dot com) "The crash is caused by incomplete FlsFree implementation. There's a comment in it's code that says what needs to be added: /* FIXME: add equivalent of ThreadZeroTlsCell here */"
The crash is repeatable with the attached example winelib program (captain.exe) and windows DLL (what.dll). Code for the compiled what.dll is included. An included README file describes the contents. 'make test' demonstrates the problem.