https://bugs.winehq.org/show_bug.cgi?id=48266
Bug ID: 48266 Summary: Regression with redirecting stdout from native app Product: Wine Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: eb1+wine@sil.org Distribution: ---
Created attachment 65932 --> https://bugs.winehq.org/attachment.cgi?id=65932 demo program
A Windows program calls a native Linux command and redirects stdout so that it can process the output. This used to work in older Wine versions, e.g. 1.6.2 but is not working in newer versions.
It seems that instead of writing to a pipe (that the Windows program could read) the output goes directly to Wine's stdout.
Use case: a Wine-aware program can use Linux commands to check if the data is stored on an encrypted drive/folder.
The attached program demonstrates the problem. When passing "1" as parameter it will call "/bin/ls -al", and redirect and read the output. When running with newer Wine versions it can clearly be seen that the program reads 0 bytes from the pipe.
When passing "2" as parameter it calls the Windows command "dir" and redirects and reads the output. This works correctly.
The demo executable and the source code is available at https://gist.github.com/ermshiperete/8de3905d364cee362a90cacc03e7c358.
A second Windows program, available at https://gist.github.com/ermshiperete/1e4cb1bc32e5175c369ec3d0d594cef8, can be used in `git bisect`. It executes "/bin/uname" and compares the redirected output with "Linux". Exit code is 0 if the program read "Linux", otherwise 1.
https://bugs.winehq.org/show_bug.cgi?id=48266
--- Comment #1 from eb1+wine@sil.org --- Bisecting suggests that commit d56c576bc1fe5be78e98c9972343b5093e141935 is the first commit that introduces this problem.
https://bugs.winehq.org/show_bug.cgi?id=48266
eb1+wine@sil.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |4.21
https://bugs.winehq.org/show_bug.cgi?id=48266
--- Comment #2 from eb1+wine@sil.org --- Oops, no, d56c576bc1fe5be78e98c9972343b5093e141935 isn't really the problem. My test script was wrong. This commit crashes when running the demo app. I'll try again...
https://bugs.winehq.org/show_bug.cgi?id=48266
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=48266
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- The problem is that Win32 pipes are no longer backed by a Unix fd, so they can't be passed to a Unix app.
https://bugs.winehq.org/show_bug.cgi?id=48266
--- Comment #4 from Gijs Vermeulen gijsvrm@gmail.com --- Bug 44393 might be related.
https://bugs.winehq.org/show_bug.cgi?id=48266
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Indeed, it's the same issue.
*** This bug has been marked as a duplicate of bug 44393 ***
https://bugs.winehq.org/show_bug.cgi?id=48266
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing Duplicate