https://bugs.winehq.org/show_bug.cgi?id=43884
Bug ID: 43884 Summary: MSVC LINK.EXE version 14.11.25547.0 crashes due to unimplemented function _memicmp_l Product: Wine Version: 2.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: api-ms-win-* Assignee: wine-bugs@winehq.org Reporter: MTest31@outlook.com Distribution: ---
Created attachment 59491 --> https://bugs.winehq.org/attachment.cgi?id=59491 stdout/stderr output with the crash
Hi there,
I've downloaded the very latest (I think its the very latest) MSVC LINK.EXE from Microsoft and tried to get it working with my locally compiled Wine version 2.19.
You can download the linker from this URL [1] that points to a zip file containing the linker. Inside that zip file the link.exe is located in the path [2]. The linker is a 64 bit binary, so it needs 64 bit Wine. WOW64 is not needed.
You'll obviously also need a Windows SDK handy to try out the linker, and some object files to feed it with. I haven't tried out whether cl.exe works, its not my priority. My object files were generated by rustc which uses llvm, its msvc based target only uses the linker.
You can see that my setup is a bit hard to reproduce, therefore it would probably be the best idea to just send me a patch that I can then test.
Just invoking the linker without any args works as expected. It prints all the options and then complains that it didn't get any args fed.
If you use the linker to link actual payloads however, you'll get an error, boiling down to the following error message: wine: Call from 0x7b44f727 to unimplemented function api-ms-win-crt-string-l1-1-0.dll._memicmp_l, aborting
I've attached a file containing stdout/stderr output of the linker with the crash happening and the /VERBOSE option passed.
I've created a patch for wine to implement the stubbed out _memicmp_l in all the dlls that reference it and with the patch applied the linker is able to produce working binaries for me!
Now I am afraid I can't share the patch with you because I can't fulfill your requirements for contributions. However, I hope my information that implementing that function fixes the issue for me, will lead to the function being implemented in upstream Wine as well. I am ready to test any patches you send me.
Thank you!
[1]: https://download.visualstudio.microsoft.com/download/pr/11436965/d360453cfd1... [2]: Contents/VC/Tools/MSVC/14.11.25503/bin/Hostx64/x64/
https://bugs.winehq.org/show_bug.cgi?id=43884
--- Comment #1 from MTest31@outlook.com --- Sorry disregard the URL I gave you, I was using this URL to obtain the linker instead:
https://download.visualstudio.microsoft.com/download/pr/11437778/36f212a9738...
https://bugs.winehq.org/show_bug.cgi?id=43884
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=43884
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|api-ms-win-* |msvcrt
https://bugs.winehq.org/show_bug.cgi?id=43884
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://download.visualstud | |io.microsoft.com/download/p | |r/11437778/36f212a9738f5888 | |c73f46e0d25c1db7/microsoft. | |visualcpp.tools.hostx64.tar | |getx64.vsix CC| |focht@gmx.net Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello MTest31,
confirming, very good bug report quality. Rarely see that, thanks ;-)
I managed to reproduce with a simple test that doesn't need any further SDK/install dependencies in plain 64-bit WINEPREFIX.
The culprit is the debug information generation in PDB format -> force the compiler to create full symbolic info triggers this ('/DEBUG:full').
_memicmp_l is imported by:
* mspdbcore.dll * mspdbst.dll
Create a dummy source file:
--- snip --- $ cat main.c int main() { return 0; } --- snip ---
Build without CRT, otherwise you would need SDK libs:
--- snip --- $ wine ./cl.exe main.c /link /nodefaultlib /entry:main /verbose /DEBUG:full ... Microsoft (R) Incremental Linker Version 14.11.25547.0 Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe /nodefaultlib /entry:main /verbose /DEBUG:full main.obj ... Starting pass 2 main.obj wine: Call from 0x7b494130 to unimplemented function api-ms-win-crt-string-l1-1-0.dll._memicmp_l, aborting
Version 14.11.25547.0
ExceptionCode = 80000100 ExceptionFlags = 00000001 ExceptionAddress = 000000007B494130 (000000007B460000) "C:\windows\system32\KERNEL32.dll" NumberParameters = 00000002 ExceptionInformation[ 0] = 00007FB7FE379D61 ExceptionInformation[ 1] = 00007FB7FE379E22
CONTEXT: Rax = 000000007B476B68 R8 = 0000000000000002 Rbx = 0000000000000004 R9 = 000000000149D9F0 Rcx = 000000000149D860 R10 = 000000007B5D2640 Rdx = 0000000000000010 R11 = 0000000000000000 Rsp = 000000000149D840 R12 = 00000000010B3F30 Rbp = 000000000149D9B0 E13 = 00000000010B2A40 Rsi = 000000000149D9F0 R14 = 0000000000000000 Rdi = 000000000149D880 R15 = 0000000000000001 Rip = 000000007B494130 EFlags = 0000000000000202 SegCs = 0000000000000033 SegDs = 0000000000000000 SegSs = 000000000000002B SegEs = 0000000000000000 SegFs = 0000000000000063 SegGs = 0000000000000000 Dr0 = 0017001600000000 Dr3 = 0023002200210020 Dr1 = 001B001A00190018 Dr6 = 0027002600250024 Dr2 = 001F001E001D001C Dr7 = 002B002A00290028 LINK : fatal error LNK1000: unknown error at 00000000004C1A60; consult documentation for technical support options --- snip ---
NOTE: To have cl.exe work this way from command line without proper install/SDK, a hack for missing 'clui.dll' is needed, otherwise it hangs:
--- snip --- .. fatal error C1510: Cannot load language resource clui.dll. err:ntdll:RtlpWaitForCriticalSection section 0x140037420 "?" wait timed out in thread 002a, blocked by 0000, retrying (60 sec) --- snip ---
https://social.msdn.microsoft.com/Forums/vstudio/en-US/78a72624-b89e-4989-94...
--- quote --- if you're using cl.exe as a command line compiler, or underneath a different editor, clui.dll has to be in a /1033 subdirectory or it can't be found :( --- quote ---
Something like this, only for testing without valid install:
--- snip --- $ pwd /home/focht/Downloads/Contents/VC/Tools/MSVC/14.11.25503/bin/Hostx64/x64
$ mkdir 1033
# any valid PE dll as dummy $ cp atlprov.dll 1033/clui.dll --- snip ---
Regards
https://bugs.winehq.org/show_bug.cgi?id=43884
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |bunglehead@gmail.com
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com --- Looking.
https://bugs.winehq.org/show_bug.cgi?id=43884
MTest31@outlook.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|2.19 |2.20
https://bugs.winehq.org/show_bug.cgi?id=43884
--- Comment #4 from Nikolay Sivov bunglehead@gmail.com --- I'm going to resend a patch for this soon. Note that there's no need to bump Wine version for the report, as it's meant to indicate original version bug was reported for.
https://bugs.winehq.org/show_bug.cgi?id=43884
--- Comment #5 from MTest31@outlook.com --- Sorry, I wasn't aware that the version should not be bumped. Both 2.19 and 2.20 are affected.
I've downloaded your patch [1] and it works really well for me. Looking forward for it being upstreamed. Thanks for looking into the matter!
[1]: https://source.winehq.org/patches/data/138012
https://bugs.winehq.org/show_bug.cgi?id=43884
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bunglehead@gmail.com |wine-bugs@winehq.org Fixed by SHA1| |d045a5ea29aada4182689cd80f4 | |b57a694322b42 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com --- Fixed with d045a5ea29aada4182689cd80f4b57a694322b42. Thanks, Piotr.
https://bugs.winehq.org/show_bug.cgi?id=43884
--- Comment #7 from MTest31@outlook.com --- I confirm that the fix comitted to git works. Thank you very much!
https://bugs.winehq.org/show_bug.cgi?id=43884
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.21.
https://bugs.winehq.org/show_bug.cgi?id=43884
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=43884
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #9 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.5.