[Bug 52023] New: VirtualFree returning error when it should not
https://bugs.winehq.org/show_bug.cgi?id=52023 Bug ID: 52023 Summary: VirtualFree returning error when it should not Product: Wine Version: 6.19 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs(a)winehq.org Reporter: elpochodelagente(a)gmail.com Distribution: --- Created attachment 71022 --> https://bugs.winehq.org/attachment.cgi?id=71022 test case source and exe I find it odd that Wine's version of VirtualFree [1] with MEM_DECOMMIT does nothing, and always returns error (STATUS_NO_MEMORY, see decommit_pages and anon_map_fixed in dlls/ntdll/unix/virtual.c). The attached test passes, (crashing) in windows but doesn't in wine: $ x86_64-w64-mingw32-gcc -o decommit.exe decommit.c Windows: $ ./decommit.exe ====== test 1 - reserve, commit, release
success! ====== test 2 - reserve, commit, decommit, attempt use Segmentation fault
Wine: $ wine decommit.exe ====== test 1 - reserve, commit, release
success! ====== test 2 - reserve, commit, decommit, attempt use Could not decommit memory. Error code: 8 ======
[1] https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-vi... -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52023 Javier <elpochodelagente(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |elpochodelagente(a)gmail.com --- Comment #1 from Javier <elpochodelagente(a)gmail.com> --- Created attachment 71062 --> https://bugs.winehq.org/attachment.cgi?id=71062 simple test case seems like I had forgotten to upload the test sources -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52023 Louis Lenders <xerox.xerox2000x(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xerox.xerox2000x(a)gmail.com Keywords| |download, source --- Comment #2 from Louis Lenders <xerox.xerox2000x(a)gmail.com> --- Added some info.
The attached test passes, (crashing) in windows but doesn't in wine:
What exactly do you mean by that? I sent the test to wine test-bot and indeed it crashes, but i don`t see any output. How exactly does the test pass on windows then? -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52023 --- Comment #3 from Javier <elpochodelagente(a)gmail.com> --- Sorry if my description was confusing. The test frees (decommits but doesn't release, so it's still reserved but not accessible) a memory region and then tries to read from it, so it should segfault. On windows it crashes, as expected. In wine VirtualFree fails, doesn't free the memory and the read doesn't crash. The main problem is that VirtualFree shouldn't have failed, the memory should have been decommited. If the test crashes on wine, it means you are not able to reproduce the problem, maybe this depends on the implementation of mmap or the kernel version. I'm running Ubuntu 20.04, linux 5.11.0-40-generic. -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52023 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |7d2a7b94aad8a776a2ee3031a18 | |bb3b53d5925cd --- Comment #4 from Alexandre Julliard <julliard(a)winehq.org> --- Zero size decommit wasn't handled correctly, it should be fixed by 7d2a7b94aad8a776a2ee3031a18bb3b53d5925cd. Thanks for the good bug report! -- 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.
https://bugs.winehq.org/show_bug.cgi?id=52023 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 6.23. -- 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