http://bugs.winehq.org/show_bug.cgi?id=33546
Bug #: 33546 Summary: MSVC 2012 C compiler (cl.exe) fails/crashes Product: Wine Version: 1.5.29 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: wine@martin.st Classification: Unclassified
For MSVC 2010, the plain C compiler binary (cl.exe) has worked just fine when run in wine, if extracted from an existing installation of MSVC. For MSVC 2012, the compiler binary fails/crashes. The exact reason is still unknown, but it seems like the compiler corrupts the heap at some point.
To reproduce, copy the following files from an MSVC 2012 installation:
From Microsoft Visual Studio 11.0\Common7\IDE:
mspdb110.dll
From Microsoft Visual Studio 11.0\VC\bin:
cl.exe c1.dll c2.dll 1033/clui.dll
And optionally from Microsoft Visual Studio 11.0\VC\redist\x86\Microsoft.VC110.CRT: msvcr110.dll msvcp110.dll
Then using these files, try to compile a simple C file containing:
int main(int argc, char* argv[]) { return 0; }
wine cl.exe -c test.c
This currently ends with the following error: err:seh:setup_exception_record stack overflow 848 bytes in thread 0009 eip f74e847d esp 00230fe0 stack 0x230000-0x231000-0x330000
If the native msvcr110.dll isn't used, this fails due to some unimplemented function. Stubs for these can be added by the crude, proof of concept patches attached, which also gets rid of a number of other fixmes printed. The third patch adds calls _heapchk() after each memset, to pinpoint one particular memset call (with length parameter 0x6f0) that seems to corrupt the heap. The actual cause for this is still unknown though.
http://bugs.winehq.org/show_bug.cgi?id=33546
--- Comment #1 from Martin Storsjö wine@martin.st 2013-05-08 18:16:28 CDT --- Created attachment 44399 --> http://bugs.winehq.org/attachment.cgi?id=44399 Stub implementation of the reader_writer_lock class constructor/destructor
http://bugs.winehq.org/show_bug.cgi?id=33546
--- Comment #2 from Martin Storsjö wine@martin.st 2013-05-08 18:22:01 CDT --- Created attachment 44400 --> http://bugs.winehq.org/attachment.cgi?id=44400 Crude implementation of the slim read/write lock functions using pthread rwlocks
While this patch most probably isn't at all what should be done to implement these functions properly for wine, it serves as a proof of concept to rule out these functions as the culprit for the crashes in the compiler.
http://bugs.winehq.org/show_bug.cgi?id=33546
--- Comment #3 from Martin Storsjö wine@martin.st 2013-05-08 18:22:45 CDT --- Created attachment 44401 --> http://bugs.winehq.org/attachment.cgi?id=44401 Patch for checking the heap consistency after each memset call
http://bugs.winehq.org/show_bug.cgi?id=33546
Sylvain Petreolle spetreolle@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |spetreolle@yahoo.fr
http://bugs.winehq.org/show_bug.cgi?id=33546
oli.huber@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |oli.huber@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=33546
Richard Hayden r.hayden@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |r.hayden@gmail.com
--- Comment #4 from Richard Hayden r.hayden@gmail.com --- I've done some further investigation into this issue and tracked down the problem, see:
http://bugs.winehq.org/post_bug.cgi
I also have a simple work-around detailed in that post.
http://bugs.winehq.org/show_bug.cgi?id=33546
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to comment #4)
http://bugs.winehq.org/show_bug.cgi?id=35176
http://bugs.winehq.org/show_bug.cgi?id=33546
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello folks,
why are you creating new bugs then?
FYI there is also bug 34869 which contains analysis of the same problem.
Regards
http://bugs.winehq.org/show_bug.cgi?id=33546
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE
--- Comment #7 from Anastasius Focht focht@gmx.net --- Hello,
merging with bug 33546 because it contains analysis.
Regards
*** This bug has been marked as a duplicate of bug 35176 ***
http://bugs.winehq.org/show_bug.cgi?id=33546
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Austin English austinenglish@gmail.com --- Closing.