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 }}
Repository navigation
[bug] v+=("word") on an unset variable creates a scalar containing the serialized array literal (with \x10 carrier when quotes present) instead of an array — kills bash-preexec PROMPT_COMMAND #214
Corpus: bash-preexec master d866ee (corpus2 lane, first run of this corpus; sandbox target/issue-suites/results/corpus2/, artifacts results/bash-preexec/ + probe/p10-stepwise.*, probe/p11-appendarr.*).
Minimal reproducer (LF script file, run on both shells):
unset v
v+=("hello world")
declare -p v
unset w
w+=("a \"q\" b")
declare -p w
GNU Bash 5.3.0 (WSL /usr/local/bin/bash): declare -a v=([0]="hello world") / declare -a w=([0]="a \"q\" b") — array-append onto an unset variable creates the array with one element.
rubash (9bf2df9): declare -- v="(\"hello world\")" / declare -- w="(\"a \\\"q\\\" b\")" — the variable stays a scalar whose value is the serialized array-literal text (including the parens and internal quoting; with quotes inside the element a \x10 carrier byte leaks into the value as well, see real-corpus evidence below).
Real-corpus kill (bash-preexec): at source time bash-preexec runs PROMPT_COMMAND+=("${__bp_install_string}") with __bp_install_string='__bp_install "$_"' on an unset PROMPT_COMMAND (bash-preexec.sh:75 and file tail; bash >= 5.1 takes the array path). GNU ends with declare -a PROMPT_COMMAND=([0]="__bp_install \"\$_\""). rubash ends with a scalardeclare -- PROMPT_COMMAND=$'(\020"__bp_install \\"\$_\\"")' — the serialized literal, \x10 carrier included. Every later step of __bp_install then does string surgery on that garbage, and the final PROMPT_COMMAND becomes ([0]=$'__bp_precmd_invoke_cmd "$_""\n":"\n"\020":"' [1]="__bp_interactive_mode") — the precmd/preexec hook value is corrupted, so the framework's hook dispatch is dead on arrival.
GNU C source owner: append-to-array-element assignment is dispatched through variables.c:3120-3138 (do_assignment_internal → assign_array_element, arrayfunc.c) — with ASS_APPEND and an unset name, GNU binds a new array with the appended element; there is no code path that stores the rendered ( elements ) literal as a scalar string. Lexical side: parse.y:5342compound_assignment in read_token_word().
Classification: rubash-caused (byte-reproduced both sides from the same script file). Environment: rubash 9bf2df9e (wt4/corpus2 build), GNU bash 5.3.0 owner-compiled WSL baseline; all outputs file-captured (wsl.exe stdout relay drops bytes — never trust inline capture).
Status update (ecosweep lane, 2026-09-28, rubash e207b0d release build): the pinned fixture tests/fixtures/corpus2/repro/append_array_literal_unset.sh now runs byte-identical to WSL GNU bash 5.3.0 (stdout+stderr+rc). The bash-preexec PROMPT_COMMAND += shape is no longer reproducible at this commit.
Activity
docs+tests: corpus coverage inventory (all prior waves + corpus2 lane…
docs: task board update - corpus2 recovered, corpusfix dispatched for #…
executor: compound `+= (list)` converts non-array targets; integer el…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(lane wt4/corpusfix,2026-09-27):根因修复 + 全形状矩阵与 WSL GNU 5.3.0 字节一致;源语料复跑(bash-preexec/tldr 转 CLEAN)。感谢报告!
caomengxuan666 commentedon Sep 28, 2026
Status update (ecosweep lane, 2026-09-28, rubash e207b0d release build): the pinned fixture
tests/fixtures/corpus2/repro/append_array_literal_unset.shnow runs byte-identical to WSL GNU bash 5.3.0 (stdout+stderr+rc). The bash-preexec PROMPT_COMMAND+=shape is no longer reproducible at this commit.docs(corpus): ecosweep lane — OMB item-by-item matrices + new ecosyst…