https://bugs.winehq.org/show_bug.cgi?id=48664
Bug ID: 48664 Summary: kernel32:process - Intermittent test_Toolhelp() failure Product: Wine Version: 5.2 Hardware: x86 OS: Windows Status: NEW Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com
From time to time kernel32:process produces the following failures:
process.c:1226: Test failed: expected 1, got 0 process.c:1229: Test failed: Child process termination process.c:1233: Test failed: Toolhelp:cntUsage expected 0, but got 1 process.c:1234: Test failed: Toolhelp:th32DefaultHeapID expected 0, but got 1 process.c:1235: Test failed: Toolhelp:th32ModuleID expected 0, but got 1 process.c:1236: Test failed: Toolhelp:th32ParentProcessID expected 1860, but got 0 process.c:1238: Test failed: Toolhelp:dwFlags expected 0, but got 1
https://test.winehq.org/data/tests/kernel32:process.html
These happened on fg-win7u64-1spie9* (32 and 64 bits), newtb-w7pro64-32, newtb-w864-32, newtb-w8adm, cw-gtx560-64, cw-rx460-1709-32 and cw-gtx560-1809-32 so it's not just one buggy system.
The tests were introduced by this commit:
commit a0b6bf86f74438c574f7165ab220060681bb66cd Author: Sebastian Lackner sebastian@fds-team.de AuthorDate: Mon Dec 21 13:06:37 2015 +0100
kernel32/tests: Add test for process object destruction.
Signed-off-by: Sebastian Lackner sebastian@fds-team.de Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=48664
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |a0b6bf86f74438c574f7165ab22 | |0060681bb66cd Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=48664
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@winehq.org |fgouget@codeweavers.com
--- Comment #1 from François Gouget fgouget@codeweavers.com --- Pids cannot be used to identify processes on Windows. https://testbot.winehq.org/JobDetails.pl?Key=65720
Here's what happens: * Process.exe with pid 1234 starts Child.exe. * Process.exe exits which means its pid can now be reused because despite Child.exe having 1234 as its ppid, it does not hold a handle to Process.exe.
* Test.exe comes around and starts Nested.exe which gets pid 1234. * Nested.exe starts Dump.exe and exits. ' Test.exe then numerates all processes on the system and latches onto the first process where ppid == 1234. Whether it gets Child.exe or Dump.exe is entirely up to chance.
https://bugs.winehq.org/show_bug.cgi?id=48664
--- Comment #2 from François Gouget fgouget@codeweavers.com --- A couple of other failures also happen even less frequently:
process.c:1209: Test failed: OpenProcess failed 5 process.c:1224: Test failed: OpenThread failed 5
These happen when the process we identified through its ppid happens to be a privileged system process.
https://bugs.winehq.org/show_bug.cgi?id=48664
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |e4c15b5bbd567694dbcdb142751 | |e7410e323c691 Status|NEW |RESOLVED
--- Comment #3 from François Gouget fgouget@codeweavers.com --- This is fixed.
commit e4c15b5bbd567694dbcdb142751e7410e323c691 Author: Francois Gouget fgouget@codeweavers.com Date: Mon Mar 2 18:27:30 2020 +0100
kernel32/tests: Fix test_Toolhelp()'s nested process lookup.
On Windows, processes are not reassigned to pid 1 when their parent dies. This means many processes could have the same ppid despite being started by unrelated processes. It also means test_Toolhelp() cannot reliably look up the nested process by its ppid. So look up for the nested process by its pid and only then check its ppid, executable file, etc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48664 Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=48664
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.4.
https://bugs.winehq.org/show_bug.cgi?id=48664
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |5.0.x
https://bugs.winehq.org/show_bug.cgi?id=48664
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|5.0.x |---
--- Comment #5 from Michael Stefaniuc mstefani@winehq.org --- Removing the 5.0.x milestone from bug fixes included in 5.0.1.
https://bugs.winehq.org/show_bug.cgi?id=48664
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression