rust-lang / rust-lang/rust

`thread 'main' panicked. failed printing to stdout: Broken pipe (os error 32)`

Open
#119,980 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried this command:

cargo run | echo

I expected to see this happen: ignore.

Instead, this happened: thread 'main' panicked. failed printing to stdout: Broken pipe (os error 32)

Meta

rustc --version --verbose:

1.74.1 (a28077b28 2023-12-04)
Backtrace

thread 'main' panicked at library/std/src/io/stdio.rs:1019:9:
failed printing to stdout: Broken pipe (os error 32)
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
   2: std::io::stdio::print_to
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/io/stdio.rs:1019:9
   3: std::io::stdio::_print
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/io/stdio.rs:1095:5
   4: data_type::compound_type
             at ./src/main.rs:3:5
   5: data_type::main
             at ./src/main.rs:100:5
   6: core::ops::function::FnOnce::call_once
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the pipeline with cargo run | echo, then inspect library/std/src/io/stdio.rs around line 1019 and the related stdout implementation. Check existing standard-library I/O tests for broken-pipe behavior; the issue needs an explicit decision on the expected behavior before a newcomer can define done.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.