https://bugs.winehq.org/show_bug.cgi?id=40225
Bug ID: 40225 Summary: NtQuerySection returns wrong size Product: Wine Version: 1.9.3 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: mail@georg.so Distribution: ---
Created attachment 53743 --> https://bugs.winehq.org/attachment.cgi?id=53743 NtQuerySection test case via boost interprocess
When using NtQuerySection to get the file size of a file mapping the wine result deviates from the native one.
With wine, it seems that the size is rounded up to the next page. On native windows, the real file size is returned.
How to reproduce (e.g. with a mingw cross compile environment):
mkdir build cd build mingw64-cmake .. mingw64-make wine64 main
Actual behavior:
fixme:winediag:start_process Wine Staging 1.9.3 is a testing version containing experimental patches. fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org. region.get_size() == 4096 sizeof(inp)-1 == 5 Assertion failed!
Program: Z:\home\gms\program\libixxxutil\build-case-win-rel\main.exe File: /home/gms/program/libixxxutil/test/mapped_size_case/main.cc, Line 28
Expression: region.get_size() == sizeof(inp)-1
abnormal program termination
Expected behavior (as e.g. on Windows 7):
No output and success exit code.
How reproducible: always
The test program uses Boost Interprocess functions for creating that mapping and getting the size.
See also:
cf. http://www.boost.org/doc/libs/1_60_0/doc/html/boost/interprocess/mapped_regi...
The OS could allocate more pages than size/page_size(), but get_address() will always return the address passed in this function (if not null) and get_size() will return the specified size.
http://stackoverflow.com/a/26983182/427158 -> NtQuerySection
https://bugs.winehq.org/show_bug.cgi?id=40225
--- Comment #1 from Georg Sauthoff mail@georg.so --- Created attachment 53744 --> https://bugs.winehq.org/attachment.cgi?id=53744 simple build file for the test case
https://bugs.winehq.org/show_bug.cgi?id=40225
--- Comment #2 from Georg Sauthoff mail@georg.so --- Same resultings when compiling with mingw64-32 and running under wine32.
I am using the wine packages from the main Fedora 23 repository.
https://bugs.winehq.org/show_bug.cgi?id=40225
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dmitry@baikal.ru, | |erich.e.hoover@wine-staging | |.com, michael@fds-team.de, | |sebastian@fds-team.de Component|ntdll |-unknown Product|Wine |Wine-staging
--- Comment #3 from Sebastian Lackner sebastian@fds-team.de --- An implementation for NtQuerySection is only available in Wine Staging, which means this bug is very likely Wine Staging specific. Also adding the author of the patchset.
https://bugs.winehq.org/show_bug.cgi?id=40225
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #4 from Dmitry Timoshkov dmitry@baikal.ru --- There are existing todo_wine statements in NtQuerySection tests for the wrong size returned.
https://bugs.winehq.org/show_bug.cgi?id=40225
--- Comment #5 from Sebastian Lackner sebastian@fds-team.de --- (In reply to Georg Sauthoff from comment #2)
I am using the wine packages from the main Fedora 23 repository.
This issue should be fixed in Wine Staging 1.9.6 (with https://github.com/wine-compholio/wine-staging/commit/5a9e5cae3c36f2e39fdbc3...). Could you please retest if your test cases also work now?
https://bugs.winehq.org/show_bug.cgi?id=40225
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mail@georg.so, | |winetest@luukku.com
https://bugs.winehq.org/show_bug.cgi?id=40225
--- Comment #6 from Georg Sauthoff mail@georg.so --- (In reply to Sebastian Lackner from comment #5)
(In reply to Georg Sauthoff from comment #2)
I am using the wine packages from the main Fedora 23 repository.
This issue should be fixed in Wine Staging 1.9.6 (with https://github.com/wine-compholio/wine-staging/commit/ 5a9e5cae3c36f2e39fdbc3114b27dc3bd331289f). Could you please retest if your test cases also work now?
Looks fine now.
I re-ran my original test-case on Fedora 25 (wine-2.0-rc2 (Staging)) and the assertion now holds.
Details:
$ wine64 main fixme:winediag:start_process Wine Staging 2.0-rc2 is a testing version containing experimental patches. fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org. $ echo $? 0 $ rpm -q wine wine-2.0-0.1.rc2.fc25.x86_64
https://bugs.winehq.org/show_bug.cgi?id=40225
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #7 from Sebastian Lackner sebastian@fds-team.de --- (In reply to Georg Sauthoff from comment #6)
I re-ran my original test-case on Fedora 25 (wine-2.0-rc2 (Staging)) and the assertion now holds.
Thanks for testing. In the meantime this issue should also be fixed in non-Staging versions of Wine, so marking as FIXED.
https://bugs.winehq.org/show_bug.cgi?id=40225
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Fixed Staging 3.14