https://bugs.winehq.org/show_bug.cgi?id=45039
Bug ID: 45039 Summary: Mono: System.UnauthorizedAccessException when trying to read from stdin when both stdout and stderr are redirected Product: Wine Version: 3.6 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mk+winehq1803@pimpmybyte.de Distribution: ---
I wrote a simple C# program that reads a line from stdin and prints it in uppercase (01_shout.cs in [1]). The exe (compiled on Ubuntu with "mcs") is available for download at http://l.proggr.de/?1839m7ier
It accepts interactive input when run in cmd.exe on windows 7, even with both stdout and stderr redirected (02_log_win7.txt in [1]).
In Ubuntu, it crashes when trying to read the line while stdin is a TTY and both stdout and stderr are redirected (03_log_wine.txt in [1]).
Ubuntu 14.04.5 LTS trusty, wine-3.6, Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1.1) Kernel 3.13.0-142-generic #191-Ubuntu SMP Fri Feb 2 12:14:37 UTC 2018 i686 i686 i686 GNU/Linux
[1] https://gist.github.com/mk-pmb/adae211e875ff11274d9b81248d033a3
https://bugs.winehq.org/show_bug.cgi?id=45039
--- Comment #1 from M.K. mk+winehq1803@pimpmybyte.de --- Tried in a wineprefix that has the original .NET 4.0 framework installed. There, instead of the crash, typing has no visible effect except for my terminal echo. I can type multiple lines, even Ctrl+D, nothing; it hangs until I press Ctrl+C.
https://bugs.winehq.org/show_bug.cgi?id=45039
--- Comment #2 from M.K. mk+winehq1803@pimpmybyte.de --- In case someone else has this problem and didn't read the gist: My current workaround is to pipe cat into my program, thus providing a pipe as stdin instead of a TTY.
cat | wine shout.exe |& tee shout.log
When wine exits, cat won't know about it immediately; it takes another write attempt for cat to discover that wine has gone away. In my case this has the effect that I can enter one more line of text than the wine program reads; cat then silently discards that line and exits, too. Another way to quit is to close cat's input stream, e.g. by pressing Ctrl+d.
https://bugs.winehq.org/show_bug.cgi?id=45039
tokktokk fdsfgs@krutt.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fdsfgs@krutt.org
http://bugs.winehq.org/show_bug.cgi?id=45039
Andrew Nguyen arethusa26@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Andrew Nguyen arethusa26@gmail.com --- Using the provided test binary, I found that running it with wine-10.19 as instructed (stdin connected to a tty with stdout and stderr redirected) no longer raises an exception and it executes successfully, but running the binary with wine-3.6 with the same redirections did reproduce the reported issue.
The issue was fixed in wine-5.18 by commit 54e117018cd4cc58c258da92686bfad13946bde2. As bug 37644 was resolved as fixed by that same commit at the time and running the test binary on wine-5.17 shows the same "invalid handle" exception reported in that bug, I'll resolve this bug as a duplicate.
*** This bug has been marked as a duplicate of bug 37644 ***
http://bugs.winehq.org/show_bug.cgi?id=45039
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Closing duplicate.