Closed
Description
After the following IRC conversation: https://botbot.me/mozilla/rust/msg/13926593/
I made the following test case:
fn main() {
let mut inp = std::io::stdin();
println!("{}", inp.read_line());
for _ in range(0, 100) {
std::io::println("b")
}
}
(The blocking read at the beginning was to offer me the opportunity to attach a debugger.)
I have two builds of rustc. One is build with --enable-debug --enable-optimize
; the other with --enable-debug --disable-optimize
. The latter build is nondeterministically getting a pipe broken error when piping the above program into head
:
% grep CFG_CONFIGURE_ARGS ~/Dev/Mozilla/rust.git/objdir-dbgopt/config.mk
CFG_CONFIGURE_ARGS := --enable-debug --enable-optimize --enable-ccache --enable-clang --prefix=~/opt/rust-dbg
% grep CFG_CONFIGURE_ARGS ~/Dev/Mozilla/rust.git/objdir-dbg/config.mk
CFG_CONFIGURE_ARGS := --enable-debug --disable-optimize --enable-ccache --enable-clang --prefix=~/opt/rust-dbg-nopt
% ~/Dev/Mozilla/rust.git/objdir-dbgopt/x86_64-apple-darwin/stage2/bin/rustc --version
/Users/fklock/Dev/Mozilla/rust.git/objdir-dbgopt/x86_64-apple-darwin/stage2/bin/rustc 0.11-pre (7a19a82 2014-04-27 23:06:41 -0700)
host: x86_64-apple-darwin
% ~/Dev/Mozilla/rust.git/objdir-dbg/x86_64-apple-darwin/stage2/bin/rustc --version
/Users/fklock/Dev/Mozilla/rust.git/objdir-dbg/x86_64-apple-darwin/stage2/bin/rustc 0.11-pre (7a19a82 2014-04-27 23:06:41 -0700)
host: x86_64-apple-darwin
% ~/Dev/Mozilla/rust.git/objdir-dbgopt/x86_64-apple-darwin/stage2/bin/rustc /tmp/nums.rs
% echo a | ./nums | head
Ok(a
)
b
b
b
b
b
b
b
b
% ~/Dev/Mozilla/rust.git/objdir-dbg/x86_64-apple-darwin/stage2/bin/rustc /tmp/nums.rs
% echo a | ./nums | head
Ok(a
)
b
b
b
b
b
b
b
b
% echo a | ./nums | head
Ok(a
)
b
b
b
b
b
b
b
b
task '<main>' failed at 'failed printing to stdout: broken pipe (Broken pipe)', /Users/fklock/Dev/Mozilla/rust.git/src/libstd/io/stdio.rs:245
%
Metadata
Metadata
Assignees
Labels
No labels