https://bugs.winehq.org/show_bug.cgi?id=52771
Bug ID: 52771 Summary: Wine console creation breaks comctl32:button, dinput:keyboard, user32:dialog, user32:input, user32:monitor and user32:win Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: programs Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
The way Wine creates the window for console applications breaks comctl32:button, dinput:keyboard, user32:dialog, user32:input, user32:monitor and user32:win.
https://test.winehq.org/data/patterns.html#comctl32:button https://test.winehq.org/data/patterns.html#dinput:keyboard https://test.winehq.org/data/patterns.html#user32:dialog https://test.winehq.org/data/patterns.html#user32:input https://test.winehq.org/data/patterns.html#user32:monitor https://test.winehq.org/data/patterns.html#user32:win
These all started failing in Wine on 2022-03-17 with the commit below (also referenced in bug 52761):
commit f034084d49b354811096524d472ae5172ac1cebf Author: Eric Pouech eric.pouech@gmail.com Date: Thu Mar 17 08:27:28 2022 +0100
kernelbase: Handle corner case in CreateProcess.
In CreateProcess, if: - parent isn't attached to a console - CreateProcess's flag isn't set with DETACHED_PROCESS nor CREATE_NEW_CONSOLE - child is a CUI program then a console must be allocated for the child.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52048 Signed-off-by: Eric Pouech eric.pouech@gmail.com Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
The way the TestBot starts the tests in Wine is this [1]:
testagentd (Unix, no terminal) - shell script (sh Unix, no terminal) - WineTest.pl (perl Unix, no terminal) - ./wine TestLauncher (Windows CUI, no console) - unit test (Windows CUI) -> creates a console - unit test can recurse upon itself (CUI)
I will now try to summarize the current understanding of the issue from the wine-devel discussion [2], using the above figure as a reference: 1. testagentd is a daemon so it does not have an associated terminal. 2. When ./wine does not have a terminal it does not create a console window, even when starting a console application. This is so wine can be used for background (batch) tasks without requiring a X session or popping up windows all over the place. 3. But when a Windows application calls CreateProcess() without DETACHED_PROCESS, a console does get created. This is what happens when TestLauncher starts a unit test. 4. While the console object is created synchronously in the wineserver process, the actual window is created asynchronously (by wineconsole). This causes it to pop up while the unit test as already started, which confuses the tests that check the window hierarchy, the focus, etc.
There are two ways the above differ from Windows: 1. I believe Windows creates both the console object and the matching window synchronously. So even if the console was created when starting the test unit there should be no failure. 2. On Windows the shell script is replaced by a batch script which triggers the console creation. So the console creation happens a bit earlier which could also mask any window creation delay.
The reason why f034084d49b3 made a difference is that before Wine was not creating console windows.
[1] More details on the different ways the TestBot starts the tests: https://www.winehq.org/pipermail/wine-devel/2022-April/212550.html
[2] March: https://www.winehq.org/pipermail/wine-devel/2022-March/212330.html April: https://www.winehq.org/pipermail/wine-devel/2022-April/212513.html
https://bugs.winehq.org/show_bug.cgi?id=52771
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression, source, | |testcase Regression SHA1| |f034084d49b354811096524d472 | |ae5172ac1cebf
--- Comment #1 from François Gouget fgouget@codeweavers.com --- This issue is caused by the same commit that causes bug 52761 but the circumstances are quite different so it did not feel right to hijack that bug. (Also I needed the names of the impacted test units in the title so the test.winehq.org can point to this bug.)
https://bugs.winehq.org/show_bug.cgi?id=52771
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@orange.fr
--- Comment #2 from Eric Pouech eric.pouech@orange.fr --- potentially when review & accepted, the patch tested here [1] might help (even resolve?) this bug
https://testbot.winehq.org/JobDetails.pl?Key=111845
https://bugs.winehq.org/show_bug.cgi?id=52771
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=52771
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=52786
https://bugs.winehq.org/show_bug.cgi?id=52771
M.K. mk+winehq1803@pimpmybyte.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mk+winehq1803@pimpmybyte.de
--- Comment #3 from M.K. mk+winehq1803@pimpmybyte.de --- Using wine-7.5 via apt:wine-devel on Ubuntu focal, "winepath" seems to omit printing its result when none of stdin, stdout, or stderr are a TTY. (In my case: stdin < /dev/null, 1>pipe, 2> pipe; but also mutes with files instead of pipes.) Might be related, so we might want to add a test cases for winepath as well.
https://bugs.winehq.org/show_bug.cgi?id=52771
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |chopinbig@tutanota.com
--- Comment #4 from Eric Pouech eric.pouech@orange.fr --- *** Bug 52789 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=52771
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kohhnztqscldrekdqn@kvhrw.co | |m
--- Comment #5 from Eric Pouech eric.pouech@orange.fr --- *** Bug 52796 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=52771
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |felix.huber@schyf.de
--- Comment #6 from Eric Pouech eric.pouech@orange.fr --- *** Bug 52793 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=52771
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bill2allison@yahoo.co.uk
--- Comment #7 from Eric Pouech eric.pouech@orange.fr --- *** Bug 52786 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=52771
--- Comment #8 from Eric Pouech eric.pouech@orange.fr --- commit eff83cd4e00e8ccd4daad05bdd6d76e77664ddd1 should have improved the situation would you mind retesting with git Wine?
https://bugs.winehq.org/show_bug.cgi?id=52771
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|programs |kernel32 Version|unspecified |7.4
https://bugs.winehq.org/show_bug.cgi?id=52771
--- Comment #9 from felix.huber@schyf.de --- That fixed it.
https://bugs.winehq.org/show_bug.cgi?id=52771
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |eff83cd4e00e8ccd4daad05bdd6 | |d76e77664ddd1 Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #10 from François Gouget fgouget@codeweavers.com --- I agree: based on the test patterns it is clear that eff83cd4e00e fixed this issue.
https://bugs.winehq.org/show_bug.cgi?id=52771
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.8.