Repository navigation
audit B4: shopt / set -o / POSIX-mode matrix — 9 fixes (UNVERIFIED-BY-CAPTAIN) - #2675
Merged
Merged
Conversation
Deep-audit lane B4 (round 2): systematic 4-cell differential matrix of every shopt option (59) and set -o flag (27) against GNU bash 5.3.20. - F01 bash_source_fullpath inert: push_bash_source now pushes sh_realpath(name) when the option is set (variables.c:5719-5736 push_source), resolving against the shell's logical PWD. - F03 shopt -o set/unset with an invalid name returned 1; GNU keeps 0 outside the query/list forms (builtins/shopt.def). - F06 lithist space-joined after reserved words: the lithist branch of build_recorded_entry now precedes the NO_SEMI space join (bashhist.c: lines are saved with their newlines). - F07 compat44 subshell loop_level reset ungated: subshell entries keep the loop depth as inherited at level <= 44 (execute_cmd.c:1641-1642), and the flat-region dispatch absorbs a residual break/continue at the fork boundary. - F08 POSIX bad substitution ignored the compat <= 43 error class: both FORCE_EOF consumption sites gated on level > 43 (subst.c:10285-10288 bad_substitution). - F09 BASH_COMPAT import rewrote the value and swallowed the range diagnostic: the import loop consumes pre-mutation snapshots of SHELLOPTS/BASHOPTS instead of the rebuilt BASHOPTS, and the sv_shcompat error is reported at startup (shell.c:1974-1986; builtins/shopt.def:654-708 set_compatibility_level). - F10 POSIX special-builtin prefix assignments did not persist: the setattr absorption arm (builtins/setattr.def:590-614 — the non-POSIX mechanism) is skipped for POSIX special builtins (variables.c push_posix_temp_var / merge_temporary_env). - F11 POSIX set listing used $'...' quoting: shell_quote's ansic branch is gated on non-POSIX (variables.c:1126-1142 print_var_value). - F12 POSIX export/readonly -p value-less and assoc forms: shared posix utility-form renderer, kind-aware (-A) attrs builders, and assoc values rendered through the assoc formatter. Report-only: F02 (extquote lex-time gate, parse.y:4053), F04 (set -v read-time echo, flags.c:284), F05 (interactive job-control init), F13 (varredir_close undo gate, redir.c:972 — fdwalk project). Regression pins: tests/audit_b4_shopt_regressions.rs (9 tests). UNVERIFIED-BY-CAPTAIN.
This was referenced Nov 3, 2026
Closed
Closed
caomengxuan666
marked this pull request as ready for review
November 3, 2026 17:26
This was referenced Nov 3, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UNVERIFIED-BY-CAPTAIN — deep-audit round 2, lane B4 (shopt / set -o / POSIX-mode behavioral matrix). Captain re-verification required before merge.
Systematic 4-cell differential matrix (GNU off/on × rubash off/on) over every shopt option (59) and every
set -oflag (27), plus listing formats, exit codes, SHELLOPTS/BASHOPTS/BASH_COMPAT import, inheritance, and the POSIX-mode delta list — all against the GNU bash 5.3.20 oracle (binary + C sources).13 findings: 9 fixed here, 4 report-only. Full report with per-finding evidence, GNU file:line citations, the complete option × 4-cell coverage table, and verification tallies lives in the lane workspace (
~/workspace/deep-audit/b4/REPORT.md).Fixed:
bash_source_fullpathinert —push_bash_sourcepushessh_realpath(variables.c:5719-5736), resolved against the shell's logical PWD.shopt -oset/unset with an invalid name returned 1; GNU keeps 0 outside query/list forms.lithistspace-joined multi-line commands after reserved words (bashhist.c).loop_levelreset ungated (execute_cmd.c:1641-1642) + residual break/continue absorbed at the fork boundary.BASH_COMPATenv import rewrote the value (4.3→43) and swallowed the out-of-range diagnostic (shell.c:1974-1986).v=zz readonly,v=ww export) did not persist — the non-POSIX setattr absorption arm (setattr.def:590-614) no longer runs for POSIX special builtins.setlisting used$'...'quoting; the ansic branch is POSIX-gated in GNU (variables.c:1126-1142).export -p/readonly -pvalue-less + assoc forms, kind-aware (-A) attrs builders, assoc values via the assoc formatter.Report-only (in the report, with mechanisms + discriminating probes):
${...}— needs the lex-time verdict threaded into stored words (parse.y:4053).set -vechoes rendered commands at execution, not input lines as read (flags.c:284) — driver-architecture change.$-/job-control init — REPL establishment layer.varredir_closeOFF ignored: command-scoped{var}fds always closed at command end (redir.c:972 undo gate) — fdwalk structural project.Verification (lane-local, pre-captain): post-fix probe suite 54/54 vs oracle; regression pins
tests/audit_b4_shopt_regressions.rs9/9; all matrix harnesses re-run (remaining diffs are the report-only findings plus previously catalogued cross-lane/artifacts); adjacent suites green (one proven-environmental failure in issue1043_1054: the python launcher's inherited SIGXFSZ=SIG_IGN, documented in the report).