Open
Description
I tried this code:
Command::new(command).
...
.stdin(Stdio::inherit())
In this case, I had already read a few bytes from stdin using stdin()
and read_exact
. strace showed that it read 8K from stdin, and that the command started missed the remainder of the 8K. #58326 discusses this in a roundabout way, but fundamentally it should be safe to read from stdin and then subsequently use it as input to a Command. The workaround was to use .stdin(Stdio::piped())
and copy the data across the pipe. Not ideal.
Meta
rustc --version --verbose
:
rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.60.0
LLVM version: 14.0.0