https://bugs.winehq.org/show_bug.cgi?id=52720
Bug ID: 52720 Summary: cmd.exe:batch times out in Wine Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
cmd.exe:batch started timing out in Wine on 2022-03-17:
batch.c:427: running TEST_CMDLINE.CMD test... cmd.exe:batch:040c done (258) in 120s Test failed: timed out
https://test.winehq.org/data/patterns.html#cmd.exe:batch
Unfortunately I was unable to find a change in Wine that would be the cause for the timeout: in my tests cmd.exe:batch still times out when run from older Wine versions.
* Based on the WineTest logs cmd.exe:batch was taking about 50 seconds up to 2022-03-16. But the next day that run time more than doubled to about 118 - 170 seconds, causing it to time out most of the time.
* Reverting the Wine source to the 2022-03-16 head, rebuilding from scratch and recreating the wineprefix did not help: cmd.exe:batch still times out.
* No package upgrades were performed on that date. Plus this regression happened simultaneously on multiple machines with different upgrade schedules.
* WINETEST_TIME=1 indicates that almost all of the time is spent running TEST_BUILTINS.CMD:
batch.c:427:0.149 running TEST_BUILTINS.CMD test... batch.c:136:158.289 Test succeeded ^^^ The first ok() call after WaitForSingleObject() is in the map_file() called after run_test()
* Running the test manually it looked like the "--- for /R" "Plain directory enumeration" part of test_builtins.cmd was enumerating all of the computer's directories, starting with /bin, /boot, /etc, ... That would certainly take a long time but that run crashed after about 1 minute so this may be unrelated.
https://bugs.winehq.org/show_bug.cgi?id=52720
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=52720
--- Comment #1 from François Gouget fgouget@codeweavers.com --- Adding echo %time% traces in test_builtins.cmd shows it is spending:
* 33 s in chain success ---> Testing 'set' * 16 s in for /R ---> for /R passed * 21 s in individual operations ---> precedence and grouping * 13 s in variables ---> quotes * 13 s in quotes ---> whitespace are ignored between double char operators
Which is 96 seconds for a 159 seconds total runtime. So there is also quite a bit that is spread around.
https://bugs.winehq.org/show_bug.cgi?id=52720
Eric Pouech eric.pouech@orange.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@orange.fr
--- Comment #2 from Eric Pouech eric.pouech@orange.fr --- Created attachment 72168 --> https://bugs.winehq.org/attachment.cgi?id=72168 mbox+gzip fix for this
mbox contains: - two patches to solve the issue - plus extension of tests to cover in flight alteration of a .cmd file in cmd.exe
attaching it here so that it doesn't get lost
https://bugs.winehq.org/show_bug.cgi?id=52720
--- Comment #3 from Eric Pouech eric.pouech@orange.fr --- not clear why this test now times out... but, the patch locally reduces execution time of the cmd test by 95%
https://bugs.winehq.org/show_bug.cgi?id=52720
--- Comment #4 from François Gouget fgouget@codeweavers.com --- Hmmm, this test stopped timing out on April 11-12. But it does not look like your patch to speed up locating labels got applied.
Is the reason for the speedup known? Is there a reason not to apply the "labels cache" patch? Does it need more testing? Reviewing?
https://bugs.winehq.org/show_bug.cgi?id=52720
--- Comment #5 from Eric Pouech eric.pouech@orange.fr ---
Is the reason for the speedup known?
the speedup of the patch yes, the speedup experienced on Apr 11-12 no
Is there a reason not to apply the "labels cache" patch? Does it need more testing? Reviewing?
I'm not the one to be asked
https://bugs.winehq.org/show_bug.cgi?id=52720
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|cmd.exe:batch times out in |Speed up cmd.exe:batch in |Wine |Wine
--- Comment #6 from François Gouget fgouget@codeweavers.com --- Even though the speedup patch has not been applied the timeouts stopped happening in Wine on 2022-04-11... and 2022-04-12 for the wow64 configurations! It would still be nice to speed up cmd if possible so I renamed this bug but I am keeping it open.
https://bugs.winehq.org/show_bug.cgi?id=52720
Neko-san nekoNexus@protonmail.ch changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nekoNexus@protonmail.ch
https://bugs.winehq.org/show_bug.cgi?id=52720
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #7 from Fabian Maurer dark.shadow4@web.de --- Why news on this?
https://bugs.winehq.org/show_bug.cgi?id=52720
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #72168|1 |0 is patch| | Attachment #72168|text/plain |application/gzip mime type| |
https://bugs.winehq.org/show_bug.cgi?id=52720
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch