Closed
Description
Reproduction steps:
- Be on windows.
cargo new --bin something
- replace main.rs with main.txt and rename it back to main.rs.
- Open git bash
- Run
cargo run | cat
I expected to see this happen: my really long string gets printed twice, followed by a clean exit
Instead, this happened: some amount of my really long string gets printed, followed by:
fatal runtime error: I/O error: operation failed to complete synchronously
Additional Details
- The test case, while simple, does appear to have a minimum size requirement to trigger this crash. Shrinking the string will cause it to stop crashing.
- I'm using
cat
in the steps for simplicity, but we've observed this happening with other programs at the end of the pipe too. - Redirecting to a file instead of a pipe seems to not trigger this crash.
- Using
cargo run
is not necessary to trigger the crash, running the built executable directly also crashes. - This PR added this new error condition: Fix unsound
File
methods #95469 - I am not the only one seeing this new error message:
rustc -C help
panics (ICEs) when piped to a closed stdout #98700 (comment)
Version it worked on
rustc 1.61.0 (fe5b13d68 2022-05-18)
binary: rustc
commit-hash: fe5b13d681f25ee6474be29d748c65adcd91f69e
commit-date: 2022-05-18
host: x86_64-pc-windows-msvc
release: 1.61.0
LLVM version: 14.0.0
Version with regression
rustc 1.62.0 (a8314ef7d 2022-06-27)
binary: rustc
commit-hash: a8314ef7d0ec7b75c336af2c9857bfaf43002bfc
commit-date: 2022-06-27
host: x86_64-pc-windows-msvc
release: 1.62.0
LLVM version: 14.0.5
@rustbot modify labels: +regression-from-stable-to-stable +O-windows