Skip to content

rustc crashes when printing target list to invalid pipe on macos #48916

@Dentosal

Description

@Dentosal

I ran this command:

rustc --print target-list | xyz

I expected to see this happen:

An error message about pipe broken pipe, or no output.

Instead, this happened:

$ rustc --print target-list | xyz
-bash: xyz: command not found
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.25.0-nightly (3bd4af88b 2018-01-18) running on x86_64-apple-darwin

thread 'rustc' panicked at 'failed printing to stdout: Broken pipe (os error 32)', libstd/io/stdio.rs:690:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Meta

rustc --version --verbose:

$ rustc --version --verbose
rustc 1.25.0-nightly (3bd4af88b 2018-01-18)
binary: rustc
commit-hash: 3bd4af88bea2e6ecdd3455ed89b3ef1fc3500aa4
commit-date: 2018-01-18
host: x86_64-apple-darwin
release: 1.25.0-nightly
LLVM version: 4.0

Backtrace:

thread 'rustc' panicked at 'failed printing to stdout: Broken pipe (os error 32)', libstd/io/stdio.rs:690:9
stack backtrace:
   0:        0x1151d465b - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h419918b185546cd5
   1:        0x1151de4c4 - std::sys_common::backtrace::print::h95585d41a1966254
   2:        0x1151c0e50 - std::panicking::default_hook::{{closure}}::h3f11af6d88cbf44d
   3:        0x1151c0935 - std::panicking::default_hook::h363464b46ee98ef1
   4:        0x1151c12d6 - std::panicking::rust_panic_with_hook::h407d06fffbe934da
   5:        0x1151c112e - std::panicking::begin_panic::h920e256577b254d6
   6:        0x1151c1083 - std::panicking::begin_panic_fmt::h90b1bd692861f55b
   7:        0x1151c5d21 - std::io::stdio::_print::h1b11ed6c4298c9d2
   8:        0x10eeedcc2 - rustc_driver::RustcDefaultCalls::print_crate_info::h740def1787ac21db
   9:        0x10eeeb365 - <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::no_input::h113cc58422cdf9dd
  10:        0x10eee7bf5 - rustc_driver::run_compiler::h2396d8175e83b8c8
  11:        0x10ee14971 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb17c49d1c538ce03
  12:        0x11520521e - __rust_maybe_catch_panic
  13:        0x10ee5c38d - <F as alloc::boxed::FnBox<A>>::call_box::h5f46c789ab10a85d
  14:        0x1151e0ef7 - std::sys_common::thread::start_thread::h72beb878126afdad
  15:        0x1151eb208 - std::sys::unix::thread::Thread::new::thread_start::h2c9c3fd3c5fb7727
  16:     0x7fff8a63399c - _pthread_body
  17:     0x7fff8a633919 - _pthread_start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions