https://bugs.winehq.org/show_bug.cgi?id=48027
Bug ID: 48027 Summary: cmd pipe | not triggering ReadFile EOF Product: Wine Version: 4.18 Hardware: x86 OS: Linux Status: NEW Severity: minor Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: dark.shadow4@web.de Distribution: ---
Test program is find.exe as of wine commit ccec532879ec14b2e79da08288152a69221ec4d1.
I implemented the program so it waits for ReadFile to return FALSE, that's when the input is supposed to be over: ###### BOOL success = ReadFile(handle, buffer, 4096, &buffer_max, NULL); if (!success) return FALSE; ######
Now that's not right anyways, but it exposes a slight difference in Wine cmd:
1) Following input hangs on Wine, but not on Windows: "echo test | find test" It works on Wine when using "winetricks -q cmd"
2) Following input hangs on both Windows and Wine: "find test < test.txt"
Wine's implementation of the pipe | uses the redirect operator < internally. This leads to the pipe working differently on Wine, i.e. blocking ReadFile when it's not supposed to.
I'm not aware of a real program being affected by that, just noting.
https://bugs.winehq.org/show_bug.cgi?id=48027
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=48027
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Created attachment 75937 --> https://bugs.winehq.org/attachment.cgi?id=75937 Compiled test program
Use like "echo test | find2 test"
http://bugs.winehq.org/show_bug.cgi?id=48027
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #2 from Eric Pouech eric.pouech@gmail.com --- should be fixed by d28db44319d3558bcfe13b7da0c626b1ff9dd58a would you mind testing if it's really the case?
http://bugs.winehq.org/show_bug.cgi?id=48027
--- Comment #3 from Fabian Maurer dark.shadow4@web.de --- I did a bisect, and it got fixed by commit 486f33ee64121d0331fb3e943791ec42bd98ef51 Author: Eric Pouech epouech@codeweavers.com Date: Mon Sep 1 09:14:04 2025 +0200
cmd: Run single commands in pipe in external cmd instance.
Note: all builtin commands in LHS or RHS of a pipe shall be run in a separate cmd instance (to provide concurrency between RHS and LHS).
http://bugs.winehq.org/show_bug.cgi?id=48027
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |d28db44319d3558bcfe13b7da0c | |626b1ff9dd58a
--- Comment #4 from Eric Pouech eric.pouech@gmail.com --- thanks for (re)testing, good news it's solved
actually, I'll use d28db44319d3558bcfe13b7da0c626b1ff9dd58a as the closing commit for this ticket as: - it refers to this very bugzilla entry - all commits between 486f33ee64121d0331fb3e943791ec42bd98ef51 and d28db44319d3558bcfe13b7da0c626b1ff9dd58a are needed to cover other forms of pipe commands
http://bugs.winehq.org/show_bug.cgi?id=48027
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 10.18.