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 }}
regression(ba69f0d9): exec-copied fds (exec 3>&2) no longer honored by external command redirects (>&3 lands on wrong stream) #370
Found by ecosweep4-B triage lane (wt23/bats364, 2026-10-01); bisected with throwaway worktrees. Covers the two red cli_tests fd_redirects cases (c_external_command_uses_persistent_fd_copied_from_stderr, c_external_stderr_uses_persistent_fd_copied_from_stdout).
Reproducer (GNU oracle: WSL GNU Bash 5.3.0)
# helper: external script whose body is `echo external-via-fd`exec3>&2; helper >&3
GNU: output lands on stderr (fd 3 was dup'd from 2; redir.c do_redirect / move_fd semantics).
Builtin-side probes (exec 3>&2; echo x >&3 with the echo builtin) are still correct — the regression is specific to the EXTERNAL-command fd plumbing (the merged-streams rework's single true path loses the fd-3 -> stderr copy for spawned children).
Introducing commit: ba69f0d; c70d109 (parent region) verified good; still bad at 2e6b0e9.
Landed as 085c6a7 (wt24/regfix lane commit f1a26578). Root cause confirmed at ba69f0d: the deleted ordered capture-replay family was the only consumer resolving >&N dups through ordered redirect state. Fix restores both halves at the fd-resolution root: plan_external_stdio's resolve_dup_source now consults the fd table's live ambient bindings (mirroring fd-1/2 seeding, Stdout generation bookkeeping included), and the piped-fallback drain routes through route_builtin_buffered_output. GNU contract: redir.c:1170 dup2 + :1188-1192 no-close-on-exec. 10-case fd matrix byte-identical; the two fd_redirects reds are green; remaining 2 diffs are pre-existing platform limits (foreign child can't receive exec-established numbered fds via std::process) — filed separately. CI green on 085c6a7.
Activity
fix(#364): assignment RHS never re-executes procsub text from expansi…
fix(#370): exec-copied fds honored by external-command redirects (>&N…
caomengxuan666 commentedon Oct 1, 2026
Landed as 085c6a7 (wt24/regfix lane commit f1a26578). Root cause confirmed at ba69f0d: the deleted ordered capture-replay family was the only consumer resolving >&N dups through ordered redirect state. Fix restores both halves at the fd-resolution root: plan_external_stdio's resolve_dup_source now consults the fd table's live ambient bindings (mirroring fd-1/2 seeding, Stdout generation bookkeeping included), and the piped-fallback drain routes through route_builtin_buffered_output. GNU contract: redir.c:1170 dup2 + :1188-1192 no-close-on-exec. 10-case fd matrix byte-identical; the two fd_redirects reds are green; remaining 2 diffs are pre-existing platform limits (foreign child can't receive exec-established numbered fds via std::process) — filed separately. CI green on 085c6a7.
docs: record wt24 recovery (#376/#369/#370 closed, #377-#379 opened, …
docs: platform gap — foreign children cannot receive exec-established…