Skip to content

fix(executor): propagate the redirect expansion-error verdict on the function fast path - #579

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/2837-unused-result-ci-parity
Oct 13, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/2837-unused-result-ci-parity

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Companion to the niubash -D warnings lane (PRs #278/#283/#288/#289 all red on this one site).

The bug: execute_function_command_invocation's FatalNounset arm called finish_heredoc_expansion_error and dropped its Result (unused_must_use under -D warnings). The dropped Err is not diagnostics noise — it is the GNU run/continue verdict: interactive sessions DISCARD (subst.c:10416), noninteractive scripts FORCE_EOF out of the main shell (execute_cmd.c:5606). Dropping it kept scripts running where GNU stops.

Evidence (WSL GNU Bash 5.3, script-file probes):

  • set -u; f() { echo ran; }; f <&"$nope"; echo after — GNU: ran/after never print, rc 1 (script) / 127 (the -c remap, shell.c:1471, already pinned by dash_c_mode_remaps_fatal_to_127). master: after prints, rc 0. This PR: matches GNU in both modes.
  • The classifier call stays scoped to the FatalNounset class — bad dup fd / ambiguous redirect rejections keep the plain skip path (issue518_redirect_message_regressions::dup_empty_quoted_word_reports_bad_fd_with_raw_word pins that an earlier draft of this fix broke it).

Validation: full suite failure set bidirectionally identical to a fresh 40586ca master on this machine (comm empty both ways), RUSTFLAGS="-D warnings" cargo check green, cargo fmt --check clean.

…function fast path

execute_function_command_invocation's FatalNounset arm called
finish_heredoc_expansion_error and dropped its Result (spotted by
niubash's -D warnings lane). The classifier's Err is the GNU
run/continue verdict: an interactive session DISCARDs (subst.c:10416),
a noninteractive script FORCE_EOFs out of the main shell
(execute_cmd.c:5606) — dropping it kept the script running where GNU
stops (`set -u; f() { :; }; f <&$nope; echo after` printed `after`
with rc 0; GNU prints nothing, rc 1 in script mode and 127 via the -c
remap at shell.c:1471).

The classifier call stays scoped to the FatalNounset class — other
redirect rejections (bad dup fd, ambiguous redirect) keep the plain
skip path, pinned by the issue518 dup_empty_quoted_word probe.
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.

1 participant