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