Skip to content

[bug] All-external pipeline members do not die of SIGPIPE: EPIPE exit 1 + leaked diagnostics, PIPESTATUS 1 instead of 141 #1580

Closed

Description

@caomengxuan666

Summary

In an all-external pipeline, upstream members whose consumer closes early do not die of SIGPIPE. They exit 1 via EPIPE errors, leak their own Broken pipe diagnostics to the shell's stderr, and PIPESTATUS records 1 instead of 141.

Regression seed

yes | cat | head -1
echo "PIPESTATUS=${PIPESTATUS[*]}"

Measured (Linux, debug build of master ec279df tree vs self-compiled GNU bash 5.3.20)

  • GNU: stdout y, PIPESTATUS=141 141 0, stderr silent.
  • rubash: stdout y, plus stderr cat: write error: Broken pipe and yes: standard output: Broken pipe, PIPESTATUS=1 1 0.

Mechanism candidate (from the executor architecture audit)

The concurrent pipeline path is topologically first-class (real processes, real pipes). The seam is the child's signal birth environment: the whole pipeline execution runs inside a SIGPIPE-blocked bracket (sigpipe_block_guard around execute_pipeline_command, src/executor/pipeline_exec.rs ~:410), children inherit the blocked mask, and pre_exec resets disposition but not the mask — so the kernel never delivers SIGPIPE and writes surface as EPIPE instead. A synthetic 141 exists on some paths (lingerer_sigpipe_status) but not this one. Fix direction: restore SIGPIPE mask + SIG_DFL in the child's pre_exec so members die naturally and 141 comes from wait decoding.

Distinct from #382 (hard-killed lingerer reporting 1) and #1333 (entry-ignored SIGPIPE reset): different path, different root cause.

Source: executor architecture audit (arch-audit B, candidate C2), probe p2b_sigpipe3.sh double-run on oracle and current build.

Activity

  1. added
    bug
    gnu-baseline
    on Oct 26, 2026
  2. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buggnu-baseline

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions