Skip to content

[deep-audit A3] Fix four data-facing builtin divergences (UNVERIFIED-BY-CAPTAIN) - #2668

Merged
caomengxuan666 merged 2 commits into
masterfrom
audit/a3-builtins
Nov 3, 2026
Merged

caomengxuan666 merged 2 commits into
masterfrom
audit/a3-builtins

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Deep-audit hunt lane A3 (rubash data-facing builtins value semantics), base master 75b2aa5.

Fixes (each twice-reproduced vs GNU bash 5.3.20, regression tests included):

  • R58-B: type/command -v printed absolute paths for slash names; now verbatim (type.def describe_command).
  • F1: declare -p printed sparse arrays in insertion order; now ascending (array.c:948).
  • F3: read with backslash in IFS split on the backslash; escape recognition now precedes delimiter recognition (read.def:823-833).
  • F4: mapfile -C ignored callback modifications to the target array; array is re-looked-up after each callback (mapfile.def:142-218).

Report-only findings (mechanism/architecture owners, see deep-audit/a3/REPORT.md): R58-A buffered-builtin-output interleaving, declare filtered-listing vs -p divergence for dynamic variables, THIS_SH visibility (needs owner decision), assoc assignment with bracket keys retaining value quotes, printf %()T Olson TZ fallback to UTC, readonly diagnostics bypassing redirections, test -v blind to FUNCNAME/BASH_SOURCE.

Verification: 10 new regression tests green via scrubbed_cargo; 12 adjacent mapfile/read/type/declare targets green; full probe corpora re-run shows no new diffs.

UNVERIFIED-BY-CAPTAIN. Refs-only draft; full findings report at deep-audit/a3/REPORT.md (lane workdir, not in this repo).

GNU sources cited (bash 5.3.20, vendored tree):
- type slash names: builtins/type.def describe_command disk-file
  branch prints the command verbatim (findcmd.c absolute_program);
  the executor type face absolutized slash names via the session cwd.
- declare -p sparse order: array.c:948 array_to_assign walks the
  element list in ascending index order; the storage mirror printed
  insertion order. Re-render through the sorted map exactly when the
  verbatim segment order is not ascending (in-order mirrors stay
  byte-identical).
- read IFS backslash: builtins/read.def:823-833 consumes a backslash
  as an escape introducer before testing the delimiter; the split
  loop tested IFS membership first, so IFS='\' ended the field.
- mapfile callback: builtins/mapfile.def:142-218 re-looks-up the
  array after run_callback; both drivers kept a local entry map and
  overwrote callback modifications at the final render. Re-read the
  live array after each callback.

Regression tests (10 tests, all green via scrubbed_cargo):
tests/a3_r58b_type_slash_names.rs, tests/a3_f1_sparse_declare_order.rs,
tests/a3_f3_read_ifs_backslash.rs, tests/a3_f4_mapfile_callback_modifies.rs.
Full probe corpora re-run: no new diffs; remaining diffs are the
report-only findings documented in deep-audit/a3/REPORT.md.
UNVERIFIED-BY-CAPTAIN.
@caomengxuan666
caomengxuan666 merged commit 0f45b73 into master Nov 3, 2026
11 checks passed
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