http://bugs.winehq.org/show_bug.cgi?id=35563
Bug ID: 35563 Summary: GetProcessMemoryInfo() is unimplemented Product: Wine Version: 1.7.12 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: achurch+wine@achurch.org Classification: Unclassified
Despite bug 13302, GetProcessMemoryInfo() is still effectively unimplemented, in that it returns zero in all fields instead of actual data. The missing code is in the underlying ntdll call, NtQueryInformationProcess(ProcessVmCounters): (see http://source.winehq.org/source/dlls/ntdll/process.c#L231)
case ProcessVmCounters: { VM_COUNTERS pvmi; [...] /* FIXME : real data */ memset(&pvmi, 0 , sizeof(VM_COUNTERS));
Test program (compile with -lpsapi):
#include <assert.h> #include <windows.h> #include <psapi.h> int main(int argc, char **argv) { PROCESS_MEMORY_COUNTERS pmc; assert(GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))); assert(pmc.WorkingSetSize > 0); return 0; }
http://bugs.winehq.org/show_bug.cgi?id=35563
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
http://bugs.winehq.org/show_bug.cgi?id=35563
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #1 from Anastasius Focht focht@gmx.net --- Hello Andrew,
do you have a real world app/game that breaks because of incorrect values?
Creating 'meta' bugs because of 'FIXME' status of some API is not useful.
For example there is already a bug that targets specific field of 'ProcessVmCounters' info class:
Bug 5657 ("NtQueryInformationProcess ProcessVmCounters info class: actual value for 'PagefileUsage'")
Regards
http://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #2 from Andrew Church achurch+wine@achurch.org --- I had to disable a test in a library I use for game development because it expects a nonzero value in WorkingSetSize. That's perhaps not as "real-world" as bug 5657, but I'd still like to be able to run all the tests under Wine if possible.
http://bugs.winehq.org/show_bug.cgi?id=35563
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Summary|GetProcessMemoryInfo() is |Custom game development |unimplemented |library expects non-zero | |value for ProcessVmCounters | |info class member | |'WorkingSetSize' Ever confirmed|0 |1
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello Andrew,
--- quote --- I had to disable a test in a library I use for game development because it expects a nonzero value in WorkingSetSize. --- quote ---
if the library is publicly available (game SDK?) please add a download link just for completeness.
Refining summary.
Regards
http://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #4 from Andrew Church achurch+wine@achurch.org --- Created attachment 47524 --> http://bugs.winehq.org/attachment.cgi?id=47524 procmeminfo.diff
The library isn't publicly available, but I found a few spare cycles and wrote a patch that fixes the bug (as well as bug 5657) on Linux. I don't know how you feel about having platform-dependent code there, but it's a proof of concept, at least.
https://bugs.winehq.org/show_bug.cgi?id=35563
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, patch
https://bugs.winehq.org/show_bug.cgi?id=35563
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #5 from super_man@post.com --- assuming still valid issue, the patch itself applies cleanly against git (Hunk #1 succeeded at 243 (offset 12 lines).
wine 1.7.50
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #6 from Andrew Church achurch+wine@achurch.org --- The issue is still relevant, just for the record.
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #7 from super_man@post.com --- Would you mind sending the patch wine-devel?
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #8 from Andrew Church achurch+wine@achurch.org --- Done.
https://bugs.winehq.org/show_bug.cgi?id=35563
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #9 from super_man@post.com --- (In reply to Andrew Church from comment #8)
Done.
http://source.winehq.org/patches/ ?
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #10 from Andrew Church achurch+wine@achurch.org --- (In reply to super_man from comment #9)
What's that supposed to mean? (Please note that I'm not familiar with the Wine development process, so I don't know about any patch submission procedures that may exist. If you're involved with development, you're welcome to submit the patch yourself -- I don't particularly care about credit or anything like that.)
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #11 from super_man@post.com --- (In reply to Andrew Church from comment #10)
(In reply to super_man from comment #9)
What's that supposed to mean? (Please note that I'm not familiar with the Wine development process, so I don't know about any patch submission procedures that may exist. If you're involved with development, you're welcome to submit the patch yourself -- I don't particularly care about credit or anything like that.)
http://wiki.winehq.org/SubmittingPatches
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #12 from Andrew Church achurch+wine@achurch.org --- (In reply to super_man from comment #11)
(In reply to Andrew Church from comment #10)
(In reply to super_man from comment #9)
What's that supposed to mean? (Please note that I'm not familiar with the Wine development process, so I don't know about any patch submission procedures that may exist. If you're involved with development, you're welcome to submit the patch yourself -- I don't particularly care about credit or anything like that.)
Well, I've got too many other things going on at the moment to go through a complex process like that right now. Again, feel free to submit the patch yourself if you like.
https://bugs.winehq.org/show_bug.cgi?id=35563
Andrew Church achurch+wine@achurch.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #47524|0 |1 is obsolete| |
--- Comment #13 from Andrew Church achurch+wine@achurch.org --- Created attachment 53981 --> https://bugs.winehq.org/attachment.cgi?id=53981 Patch (for wine-1.9.5)
Updated the patch to work with wine-1.9.5.
Just for completeness, the relevant library is now online at http://achurch.org/SIL/ and the relevant test can be run by building the included sample program (make -C SIL-*/sample/build PLATFORM=windows) and running it with the option "-test=sys_debug".
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #14 from super_man@post.com --- (In reply to Andrew Church from comment #4)
Created attachment 47524 [details] procmeminfo.diff
The library isn't publicly available, but I found a few spare cycles and wrote a patch that fixes the bug (as well as bug 5657) on Linux. I don't know how you feel about having platform-dependent code there, but it's a proof of concept, at least.
It seems to me that they have mac specific function for VM_COUNTERS already included
http://source.winehq.org/git/wine.git/blob/6bc0ce26a853b51f11958545bfa5570bd...
117 #if defined(HAVE_MACH_MACH_H) 118 119 static void fill_VM_COUNTERS(VM_COUNTERS* pvmi) 120 {
https://bugs.winehq.org/show_bug.cgi?id=35563
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #15 from winetest@luukku.com --- https://source.winehq.org/git/wine.git/commitdiff/bf7a97e5d3482d1ee4130d716f...
Might be fixed now.
https://bugs.winehq.org/show_bug.cgi?id=35563
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |achurch+wine@achurch.org
https://bugs.winehq.org/show_bug.cgi?id=35563
--- Comment #16 from Andrew Church achurch+wine@achurch.org --- Confirmed that https://source.winehq.org/git/wine.git/commitdiff/bf7a97e5d3482d1ee4130d716f... fixes the bug. Sorry for the delay in responding.
https://bugs.winehq.org/show_bug.cgi?id=35563
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |bf7a97e5d3482d1ee4130d716f0 | |2b870df804040 Status|NEW |RESOLVED
--- Comment #17 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Andrew Church from comment #16)
Confirmed that https://source.winehq.org/git/wine.git/commitdiff/ bf7a97e5d3482d1ee4130d716f02b870df804040 fixes the bug. Sorry for the delay in responding.
Thanks for the reply.
https://bugs.winehq.org/show_bug.cgi?id=35563
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #18 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.7.
https://bugs.winehq.org/show_bug.cgi?id=35563
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=35563
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #19 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.2.