Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup panics when piping to grep -q #1621

Closed
NickeZ opened this issue Jan 22, 2019 · 3 comments
Closed

rustup panics when piping to grep -q #1621

NickeZ opened this issue Jan 22, 2019 · 3 comments

Comments

@NickeZ
Copy link
Contributor

NickeZ commented Jan 22, 2019

I noticed that rustup panics in the case below.

 RUST_BACKTRACE=1 rustup show | grep -q ^nightly
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', libstd/io/stdio.rs:700:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:227
             at libstd/panicking.rs:476
   3: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   4: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:345
   5: std::io::stdio::_print
             at libstd/io/stdio.rs:700
             at libstd/io/stdio.rs:709
   6: rustup_init::rustup_mode::main
   7: rustup_init::run_rustup
   8: rustup_init::main
   9: std::rt::lang_start::{{closure}}
  10: main
  11: __libc_start_main
  12: <unknown>
@NickeZ
Copy link
Contributor Author

NickeZ commented Jan 22, 2019

I guess grep exits too fast for rustups liking?

       -q, --quiet, --silent
              Quiet; do not write anything to standard output.  Exit immediately with zero status if any match is found, even if an error was detected.  Also see the -s
              or --no-messages option.

@NickeZ
Copy link
Contributor Author

NickeZ commented Jan 22, 2019

Btw, I have two nightlies installed:

$ rustup show | grep ^nightly
7:nightly-2018-10-05-x86_64-unknown-linux-gnu
8:nightly-x86_64-unknown-linux-gnu

@NickeZ
Copy link
Contributor Author

NickeZ commented Jan 30, 2019

Even easier reproducer:

rustup show | head -1

@nrc nrc closed this as completed in #1630 Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant