You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] Hard-killed pipeline lingerer reports exit 1; GNU reports 141 (128+SIGPIPE) — yes | head -3 PIPESTATUS[0] divergence #382
Found by the wt26/pipefix lane while landing the pipe data-loss fix (2c78165).
Shape
A pipeline producer that outlives its consumer and gets the Windows broken-pipe hard-kill (the yes | head lingerer, now correctly armed only after the downstream exits) reports exit status 1 (TerminateProcess), where WSL GNU Bash 5.3.0 reports 141 (128 + SIGPIPE).
yes | head -3;echo"${PIPESTATUS[0]}"# GNU: 141; rubash: 1
GNU spec pointer
execute_cmd.c pipeline status collection via wait_for (jobs.c:3064): a process terminated by SIGPIPE has WIFSIGNALED + WTERMSIG == SIGPIPE, surfaced as 128+13. The shell does not rewrite the status.
Direction
The hard-kill path in pipeline_exec.rswait_for_windows_pipeline_member (the process.kill() arm) is the single producer of this status on Windows; synthesizing a SIGPIPE-shaped status (exit 141 / "terminated by signal 13") for the killed lingerer restores GNU's observable contract. Check PIPESTATUS consumers and set -o pipefail interactions (yes | head -3 && echo ok shapes) with the fix.
Additional evidence for the fix matrix (from niubash#141/#155 reporter heptaspirit, measured on the pre-fix engine): in a bare external pipeline the killed writer's PIPESTATUS[0] showed 1 instead of its real exit code — python -c "import sys;sys.exit(7)" as a bare-pipeline writer reported 1; adding any explicit redirect/compound on either side restored 7. Post-2c781657 the writer completes so real codes flow; the residue proper is the lingerer-kill arm (TerminateProcess exit 1 where GNU reports 128+SIGPIPE=141). Suggested regression shapes for whoever picks this up: yes | head -3; echo ${PIPESTATUS[0]} (want 141), a fast-exiting writer with early reader close, and set -o pipefail interactions.
Landed as 9755458 + 6a5ba30 (unix cross-target): both hard-kill arms return the SIGPIPE-shaped 141 (jobs.c:2958 process_exit_status WTERMSIG convention; Windows synthesizes exit 141, unix 141<<8 wait-status for our own kill of a stuck lingerer — a real SIGPIPE death never reaches the arm). yes | head -3; echo ${PIPESTATUS[0]} now prints 141; pipefail/&&/mid-stage/compound-tail matrices byte-identical; #158 and 2c78165 canaries all held (5M pipelines full, $(seq 20000|cat) instant, yes|head clean); tests/issue382_* 6/6. Environment-bound residue filed upstream: WinuxCmd yes exits 1 on broken pipe instead of dying of SIGPIPE (unixwin/WinuxCmd#1142).
Activity
caomengxuan666 commentedon Oct 1, 2026
Additional evidence for the fix matrix (from niubash#141/#155 reporter heptaspirit, measured on the pre-fix engine): in a bare external pipeline the killed writer's PIPESTATUS[0] showed 1 instead of its real exit code —
python -c "import sys;sys.exit(7)"as a bare-pipeline writer reported 1; adding any explicit redirect/compound on either side restored 7. Post-2c781657 the writer completes so real codes flow; the residue proper is the lingerer-kill arm (TerminateProcess exit 1 where GNU reports 128+SIGPIPE=141). Suggested regression shapes for whoever picks this up:yes | head -3; echo ${PIPESTATUS[0]}(want 141), a fast-exiting writer with early reader close, andset -o pipefailinteractions.fix(#382): hard-killed pipeline lingerer reports SIGPIPE shape (141)
fix(#382): lingerer_sigpipe_status compiles on unix too (141<<8 wait-…
caomengxuan666 commentedon Oct 2, 2026
Landed as 9755458 + 6a5ba30 (unix cross-target): both hard-kill arms return the SIGPIPE-shaped 141 (jobs.c:2958 process_exit_status WTERMSIG convention; Windows synthesizes exit 141, unix 141<<8 wait-status for our own kill of a stuck lingerer — a real SIGPIPE death never reaches the arm).
yes | head -3; echo ${PIPESTATUS[0]}now prints 141; pipefail/&&/mid-stage/compound-tail matrices byte-identical; #158 and 2c78165 canaries all held (5M pipelines full, $(seq 20000|cat) instant, yes|head clean); tests/issue382_* 6/6. Environment-bound residue filed upstream: WinuxCmd yes exits 1 on broken pipe instead of dying of SIGPIPE (unixwin/WinuxCmd#1142).fix(invocation): accept clustered short options (#382)
fix(invocation): accept clustered short options (#382) (#697)
fix(launcher): list the GNU short invocation options in --help (#385) (…