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
set -E ERR-trap edge cases: nested subshell fire count, f() ( ) flat region, process substitution, return-in-until attribution #720
Four pre-existing set -E / ERR-trap divergences found (and deliberately not fixed) while verifying PR #719 (rubash#702). Filing so they stay tracked; each has a byte-verified GNU comparison (D:/Git/bin/bash.exe 5.2/5.3).
fires 2 (nested subshell as first body command over-fires; GNU suppresses the middle level)
set -E; trap 'echo ERR' ERR; f() ( false ); f
fires 2
fires 3 (flat f() ( ) region misses one level-0 fire)
set -E; trap 'echo ERR' ERR; cat <(false)
differs from GNU
process-substitution copy path (shares the read/procsub area — PR #715 touched the read side)
set -e; trap 'echo ERR:$?' ERR; f(){ return 7; }; until false; do f; done
condition's stale status attributed to f (same mechanism as #702 R4.1, different command: return also unwinds via Err)
ERR fires for the failing body command, semantic differs
Notes
PR fix(executor): until-break errexit attribution and -E subshell ERR inheritance (#702) #719 fixed the attribution only for break/continue (execute_loop_control now sets a status before unwinding). The generic fix — the dispatcher post-command gate at src/executor/command_dispatch.rs:262 attributing the last condition status to any Err-returning command — was judged too broad for that PR; that is the right lever for item 4.
Three of the four forms are fixed and byte-pinned against WSL GNU bash 5.3.0(1) (stdin oracle; 12-case regression file tests/issue720_err_trap_nested_context_regressions.rs):
form
was
now
1. ( (false) ) fire count
3
2 — GNU fork-collapses a user subshell whose whole body is a single subshell command (execute_cmd.c:1799-1806 + :662-663): the middle frame never waits, so no :769 fire. Non-collapsed middles (( (false); false ), ( { (false); } )) still fire, per GNU.
2. f() ( false ); f fire count
2
3 — the flat region now runs the wait-side completion fire (execute_cmd.c:756-778): $LINENO = the region's ) line (execute_cmd.c:696), BASH_COMMAND = the region text ( false ) (the :703-710 fork-preamble the_printed_command_except_trap).
4. return-in-until attribution
ERR:1/exit 1
ERR:7/exit 7 — the dispatcher gate no longer consumes Err(Return) with the loop condition's stale status; the function boundary stamps exit_code = N and the call's gate adjudicates.
Form 3 (cat <(false)) remains open — it is the procsub/read-reaping area (PR #715's seam), deliberately not fixed here. The audit train also extended scripts/audit/nested-context-probes.py to 45 cases and filed #825/#826 from the same pass (#713).
Activity
caomengxuan666 commentedon Oct 18, 2026
Fix train: PR #831 (branch fix/720-713)
Three of the four forms are fixed and byte-pinned against WSL GNU bash 5.3.0(1) (stdin oracle; 12-case regression file
tests/issue720_err_trap_nested_context_regressions.rs):( (false) )fire count( (false); false ),( { (false); } )) still fire, per GNU.f() ( false ); ffire count$LINENO= the region's)line (execute_cmd.c:696),BASH_COMMAND= the region text( false )(the :703-710 fork-preamblethe_printed_command_except_trap).ERR:1/exit 1ERR:7/exit 7 — the dispatcher gate no longer consumesErr(Return)with the loop condition's stale status; the function boundary stampsexit_code = Nand the call's gate adjudicates.Form 3 (
cat <(false)) remains open — it is the procsub/read-reaping area (PR #715's seam), deliberately not fixed here. The audit train also extendedscripts/audit/nested-context-probes.pyto 45 cases and filed #825/#826 from the same pass (#713).fix(trap): ERR-trap nested-context semantics — collapse suppression, …
caomengxuan666 commentedon Oct 18, 2026
由 #831 修复落地(复核轮二 APPROVE-WITH-NITS):三形态 ERR-trap 修复(子壳折叠 CMD_NO_FORK 精确圈定/扁平函数 close_flat_region 覆盖含 Ok(Some) 管道与 catch-all/Return 归因不吞 Err)+ 同类扩展两处(brace Ok(true)/早派发 catch-all 统一 close-before-return)+ 状态泄漏归零(BASH_SUBSHELL 序列与 GNU 逐字节)。17/17 回归、14 形态电池 IDENTICAL、issue797 8/8(#807 无回退)。残余两处未盖路径预存不阻塞(其一建议并入 #826)。#713 审计交付=两新票 #825/#826。
fix(trap): ERR-trap nested-context semantics — collapse suppression, …
Merge master into fix/720-713 — failglob probe-fix is the same patch …
audit(713): third nested-context pass — 56 probes, #934 faces pinned,…
fix: name the whole subshell in the exec signal-death notice (#1493)