[Bug 59935] New: Request to implement NtLockFile
http://bugs.winehq.org/show_bug.cgi?id=59935 Bug ID: 59935 Summary: Request to implement NtLockFile Product: Wine Version: 11.11 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@list.winehq.org Reporter: chenyutao0706@gmail.com Distribution: --- NtLockFile has been missing in Wine for a long time, and it doesn't seem like there has been much progress on it. e.g, When running: wine zig.exe cc test.zig it breaks the Zig compiler. After looking into Zig's source code, I'm fairly confident this is the root cause of why `zig cc` fails under Wine. Here are the relevant logs: 0024:fixme:file:NtLockFile Unimplemented yet parameter 012c:fixme:file:NtLockFile Unimplemented yet parameter 0150:fixme:file:NtLockFile Unimplemented yet parameter 014c:fixme:file:NtLockFile Unimplemented yet parameter 0144:fixme:file:NtLockFile Unimplemented yet parameter 0114:fixme:file:NtLockFile Unimplemented yet parameter 00f4:fixme:file:NtLockFile Unimplemented yet parameter 010c:fixme:file:NtLockFile Unimplemented yet parameter 0138:fixme:file:NtLockFile Unimplemented yet parameter 0108:fixme:file:NtLockFile Unimplemented yet parameter 0140:fixme:file:NtLockFile Unimplemented yet parameter 013c:fixme:file:NtLockFile Unimplemented yet parameter 00f0:fixme:file:NtLockFile Unimplemented yet parameter 00fc:fixme:file:NtLockFile Unimplemented yet parameter 0134:fixme:file:NtLockFile Unimplemented yet parameter 0110:fixme:file:NtLockFile Unimplemented yet parameter 0148:fixme:file:NtLockFile Unimplemented yet parameter 0120:fixme:file:NtLockFile Unimplemented yet parameter 00f8:fixme:file:NtLockFile Unimplemented yet parameter 00e8:fixme:file:NtLockFile Unimplemented yet parameter 0130:fixme:file:NtLockFile Unimplemented yet parameter 011c:fixme:file:NtLockFile Unimplemented yet parameter 0104:fixme:file:NtLockFile Unimplemented yet parameter 0118:fixme:file:NtLockFile Unimplemented yet parameter 0124:fixme:file:NtLockFile Unimplemented yet parameter 0100:fixme:file:NtLockFile Unimplemented yet parameter error: sub-compilation of mingw-w64 crt2.o failed note: failed to check cache: manifest_create Unexpected error: sub-compilation of compiler_rt failed note: failed to check cache: manifest_create Unexpected error: sub-compilation of mingw-w64 libmingw32.lib failed note: failed to check cache: manifest_create Unexpected error: unable to generate mingw DLL import .lib file for api-ms-win-crt-conio-l1-1-0: CacheCheckFailed Z:\lib\zig\c.zig:1:1: error: unable to load 'c.zig': Unexpected Z:\lib\zig\std\std.zig:1:1: error: unable to load 'std.zig': Unexpected Z:\lib\zig\ubsan_rt.zig:1:1: error: unable to load 'ubsan_rt.zig': Unexpected -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 Austin English <austinenglish@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com --- Comment #1 from Austin English <austinenglish@gmail.com> --- Could you add a download link/any extra steps needed, please? In the future, please attach terminal output instead of pasting inlone. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #2 from Nikolay Sivov <bunglehead@gmail.com> --- Looks like it's about IO_STATUS_BLOCK parameter. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #3 from Ken Sharp <imwellcushtymelike@gmail.com> --- Can you provide an example source file to test against? Zig: https://ziglang.org/download/ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 Stian Low <wineryyyyy@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wineryyyyy@gmail.com --- Comment #4 from Stian Low <wineryyyyy@gmail.com> --- (In reply to Ken Sharp from comment #3)
Can you provide an example source file to test against?
hello-world reproduces bug: https://ziglang.org/learn/samples/ Simply commenting `return STATUS_NOT_IMPLEMENTED` for NtLockFile allows hello-world.exe to compile and run via wine. Unclear if NtLockFile needs to be handled better for more complex cases but simplest cases seem satisfied just not returning a FAILED status. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #5 from coyote <chenyutao0706@gmail.com> ---
In the future, please attach terminal output instead of pasting inlone.
Oh Sorry for this To answer all the questions: The Zig build I’m using can be downloaded here: https://ziglang.org/builds/zig-x86_64-windows-0.17.0-dev.1099+7db2ef610.zip. In fact, this issue triggers before the actual compilation stage, so you don’t need a source file. In other words, running wine zig.exe cc anyfile.zig (even if anyfile.zig does not exist at all) is enough to reproduce this error. Additionally, I built Zig myself with debug flags enabled and traced down the exact line where Zig invokes NtLockFile: https://codeberg.org/ziglang/zig/src/commit/4c9d06416c1f0e4e7bf5139a705c50ad.... It is clear that the missing implementation of NtLockFile is a fatal bug for Zig. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #6 from coyote <chenyutao0706@gmail.com> --- (In reply to Stian Low from comment #4)
Simply commenting `return STATUS_NOT_IMPLEMENTED` for NtLockFile allows hello-world.exe to compile and run via wine.
I'd like to find out if Wine has implemented NtLockFile to some extent. For your information, simply calling NtLockFile via Python also results in an unimplemented error. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #7 from Nikolay Sivov <bunglehead@gmail.com> --- (In reply to coyote from comment #6)
(In reply to Stian Low from comment #4)
Simply commenting `return STATUS_NOT_IMPLEMENTED` for NtLockFile allows hello-world.exe to compile and run via wine.
I'd like to find out if Wine has implemented NtLockFile to some extent. For your information, simply calling NtLockFile via Python also results in an unimplemented error.
It depends on how it's called. Some options are not supported and function will fail in such cases. Take a look at wine implementation of it and you'll find such checks in there. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #8 from Stian Low <wineryyyyy@gmail.com> --- (In reply to coyote from comment #6)
I'd like to find out if Wine has implemented NtLockFile to some extent.
I found nothing for NtLockFile for staging and gitlab merge requests.
For your information, simply calling NtLockFile via Python also results in an unimplemented error.
Right but hacking wine's code so that NtLockFile does not return STATUS_NOT_IMPLEMENTED; allows hello-world.exe to compile and run. If you are able to build wine, you may test this patch to see if it also works for your zig version and source files: modified dlls/ntdll/unix/file.c @@ -6973,7 +6973,7 @@ NTSTATUS WINAPI NtLockFile( HANDLE file, HANDLE event, PIO_APC_ROUTINE apc, void if (apc || io_status || key) { FIXME("Unimplemented yet parameter\n"); - return STATUS_NOT_IMPLEMENTED; + //return STATUS_NOT_IMPLEMENTED; } if (apc_user && !warn++) FIXME("I/O completion on lock not implemented yet\n"); -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 --- Comment #9 from Stian Low <wineryyyyy@gmail.com> --- (In reply to Stian Low from comment #8)
If you are able to build wine, you may test this patch to see if it also works for your zig version and source files:
https://gitlab.winehq.org/wine/wine/-/wikis/Building-Wine -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59935 Louis Lenders <xerox.xerox2000x@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source URL| |https://ziglang.org/builds/ | |zig-x86_64-windows-0.17.0-d | |ev.1099+7db2ef610.zip Status|UNCONFIRMED |NEW Summary|Request to implement |Zig compiler needs |NtLockFile |NtLockFile implementation. CC| |xerox.xerox2000x@gmail.com Ever confirmed|0 |1 --- Comment #10 from Louis Lenders <xerox.xerox2000x@gmail.com> --- Add some info. FYI: there was a thread about this NtLockFile on wine-devel: https://list.winehq.org/hyperkitty/list/wine-devel@list.winehq.org/thread/RS... The (three relevant) patches from the github page below seem to fix this bug, as I could compile the hello world example. Unfortunately these are AI generated code so they won't go upstream, but maybe the analysis from this page might help to get someone to fix this? link: https://github.com/livingstaccato/space-wine/tree/main -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla