Rustdoc ICE in CI build


#1

For some reason we got an ICE when merging a trivial README change into master on mdbook.

Looking at the logs, it seems like travis closed stdout causing a println!() in rustdoc to panic. Before I make a bug report, has anyone seen this before?

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.23.0 (766bd11c8 2018-01-01) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'failed printing to stdout: Resource temporarily unavailable (os error 11)', /checkout/src/libstd/io/stdio.rs:690:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

WARNING: rendering difference in `Provides multiple conditional default values in th ... exact same manner as`
error: Could not document `clap`.

Caused by:
  process didn't exit successfully: `rustdoc --crate-name clap /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.29.0/src/lib.rs -o /home/travis/build/rust-lang-nursery/mdBook/target/doc --cfg feature="ansi_term" --cfg feature="atty" --cfg feature="color" --cfg feature="default" --cfg feature="strsim" --cfg feature="suggestions" --cfg feature="vec_map" -L dependency=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps --extern atty=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libatty-c451b2ece5b799d4.rlib --extern vec_map=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libvec_map-a6e38ae82d25e4cd.rlib --extern strsim=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libstrsim-5b26b7d204f15494.rlib --extern ansi_term=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libansi_term-012690530882c051.rlib --extern textwrap=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libtextwrap-94d7c2b82652f6c9.rlib --extern bitflags=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libbitflags-d9077c45affafc32.rlib --extern unicode_width=/home/travis/build/rust-lang-nursery/mdBook/target/debug/deps/libunicode_width-915ad14b945324b2.rlib` (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error: build failed

#2

Doing a bit more digging, OS error 11 is EAGAIN. An error you typically get when some syscall operation was interrupted and you should try it again.

The usual way to deal with in C is to have a do-while loop which will repeat the write as long as you keep getting EAGAIN… Is there any reason why we don’t do this automatically within println!()?


#3

This may be related to https://github.com/travis-ci/travis-ci/issues/4704.


#4

Write::write_all does loop on ErrorKind::Interrupted and and print!/println! look like they should use that. Not verified dynamically.