Created attachment 13207 [details]
it contains: parent.cs (parent process); child.cs (child process); child (child script)
1) One "parent" process launches a "child" process.
2) The stardard input of the child process is redirected.
3) The parent process writes in the child process input.
4) The child process fails to read what the parent process wrote with ReadToEnd or ReadLine and got stuck.
* It worked with mono-4.0.4
* It failed with master/020a7c6 and master/5ab4c0d.
The code of parent and the client process is attached.
The way to execute the different scenario is:
parent.exe "child --readtoend" -----> hang
parent.exe "child --readtoend" "input line" -----> hang
parent.exe "child --readline" -----> hang
parent.exe "child --readline" "input line" -----> hang
parent.exe "child --read" -----> hang
parent.exe "child --read" "input line" -----> ok
I forgot to explain the parameters of the execution examples (although I think that the code is pretty easy).
* parent.exe (the name of the parent process assembly).
* "child --xxx" (the name of the child process executable, it invokes a 'mono child.exe' script) plus the mode that will use the child process to read from the console input.
** --readtoend -> it will do a Console.In.ReadToEnd();
** --readline -> it will do Console.ReadLine() reads.
** --read -> it will do Console.Read() reads checking if there are something to read with Console.In.Peek()
* "input line" -> the parent process will write the following parameters to the standard input of the child process. In this case, it will write just one "input line".
** if this parameter is missing the parent process will write nothing.