Skip to content

WIP: wave-3 remainder — jobs/coproc/carrier batch (#1853, #1869) - #1879

Merged
caomengxuan666 merged 2 commits into
masterfrom
fix/w3-rem-core
Oct 27, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
fix/w3-rem-core

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

WIP: wave-3 remainder — jobs/coproc/carrier batch.

Fixes #1853
Refs #1869

#1853 (commit 7c7b6b5)

Signal death in a stream's last command never printed its job notice (the boundary flush in execute_ast needs a NEXT command). finish_shell now replays reap + report once at stream end, before the EXIT trap — GNU: wait_for notify_and_cleanup (jobs.c:3385), maybe_print_job_notifications (jobs.c:4723-4728). Pins in tests/issue1853_last_line_signal_notice_regressions.rs (4/6 fail on pristine, 6/6 pass here).

#1869 (commit 634f612, tests only)

Reproduction on current master shows the grammar is already unified (parse.y:1125-1175 rule in parse_coproc_command is route-independent; the multi-line misreport was the #1625 fold family, cured by merged PR #1866). Guard pins in tests/issue1869_coproc_group_grammar_regressions.rs lock group/top-level/function routes together. The residual the recon observation actually showed — coproc child diagnostics lost when the parent exits promptly (stderr pipe + forwarder lifetime) — is documented with deterministic probes in the cluster REPORT as a separate mechanism, not grammar.

Carrier-host adjudication (c)

Landed on PR #1812's own branch (commit 27bddbf on fix9/1766-forward): nameref alias cells are dropped from the host env map's base clone by the NAMEREF_VARS attribute set in invoke_host_external_command; PR #1812's pins now run 16/16. #1812 stays draft for the main session's merge call.

A signal death in the stream's last command never printed its job
notice: report_pending_signal_notices only ran at the next top-level
command boundary in execute_ast, and at EOF there is no next command.
GNU prints without a following command - wait_for calls
notify_and_cleanup for the dead foreground job as the wait completes
(jobs.c:3385), and maybe_print_job_notifications prints whenever the
shell is not interactive (jobs.c:4723-4728), background deaths
included.

finish_shell (the script-file/stdin/-c drivers' shared finish path)
now replays the reap + report half of the boundary step once at
stream end, before run_exit_trap_with_status, matching GNU's order
(notice precedes the EXIT trap). The exec-replacement -c final unit
never reaches finish_shell, so that silent shape stays silent.

Pins: tests/issue1853_last_line_signal_notice_regressions.rs -
script last line, stdin last line, background death during the last
command, EXIT-trap ordering, followed-line exactly-once control,
-c brace-group final unit. 4 of 6 fail on pristine master; all pass
here. GNU expectations verified against bash 5.3.20 script-file
probes.
…sh#1869)

Adjudication from reproduction on current master (bb360a9),
against GNU bash 5.3.20 script-file probes:

- Claim 1 (group route steals the first simple-command word as the
  coproc NAME): the parse is already unified - parse_coproc_command
  implements the parse.y:1125-1175 rule route-independently (a WORD
  is a NAME only before a compound/shell command). With a settle
  window the group, function-body and top-level forms are
  byte-identical: FC2 stays unbound, fds bind as COPROC, the child
  reports 'FC2: command not found'. What the recon observation saw
  as silence is a stderr-lifetime mechanism (coproc child stderr
  rides a pipe + forwarder thread whose read end dies with the
  parent), not a binding difference - recorded with deterministic
  probes in the cluster REPORT as a separate residual.
- Claim 2 (multi-line group, coproc first line, reports 'coproc:
  command not found' + stray '}'): the brace-fold defect family
  fixed for #1625 and merged in PR #1866 (03f7271 + bbf3b53) -
  the fold ending one brace early is exactly the stray-'}'
  mechanism. Broad context matrices on current master (pipeline,
  subshell, comsub, case, loops, if-condition, time, negation)
  show no reproduction.

These pins lock both shapes so the routes cannot drift apart
again. No product change.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 15:41
@caomengxuan666
caomengxuan666 merged commit 688e86e into master Oct 27, 2026
8 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/w3-rem-core branch October 30, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[jobs] 脚本/stdin 最后一行前台子进程信号死亡时,待决死亡通知不在退出前 flush(GNU 印、rubash 无声,rc 同 129)

1 participant