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][P0] Function called in a pipeline receives caller "$@" as ONE space-joined argument (N=1 vs GNU N=3) — silently corrupts FFmpeg configure output (config.h loses 770 defines, rc still 0) #330
Found by ecosweep3 lane (FFmpeg n7.1.1 configure real-exec; carrier release build of 6106961).
Minimal reproducer (target/probe-out/p31.sh)
m(){ echo"N=$#"; for v;doecho"[$v]";done; }
set -- a b c
m "$@"| cat # pipeline member
m "$@"# control: not piped
GNU bash 5.3.0: both calls print N=3 / [a][b][c]
rubash: piped call prints N=1 / [a b c] ("$@" collapsed into ONE space-joined argument); non-piped call correct (N=3)
Only "$@" is affected (a literal "a b c" argument behaves identically in both positions; the bug is the $@ expansion's word structure being lost when the function call is a pipeline element).
Real-world impact (FFmpeg n7.1.1, verified)
configure:866map 'eval echo "$v \${$v:-no}"' "$@" | awk ... inside print_config, called as print_config ARCH_ "$config_files" $ARCH_LIST (configure:8230):
print_config itself receives 21/401/346 args correctly (instrumented PCDBG argc line in the artifacts)
the nested map ... "$@" | awk pipeline call receives N=1 (whole list space-joined) -> ${<whole list>:-no} -> bad substitution x5 -> zero output lines -> config.h generated with the header block only (15 lines) instead of GNU's 783 defines (ARCH_/HAVE_/CONFIG_* all missing), ffbuild/config.mak equally gutted - while configure still exits rc=0, i.e. silently broken build files.
Pipeline elements are forked copies running the same expansion path: execute_cmd.c:624 execute_command_internal() -> execute_simple_command -> subst.c:13219 expand_word_list_internal(); the "$@" split-into-per-parameter words (each remaining quoted) happens in expand_word_internal's $@ handling (subst.c:9900s, list semantics) and is INDEPENDENT of whether the command is a pipeline member. Re-verify the exact $@ branch with grep in subst.c before fixing.
Related
Same family as #298 (unquoted positional not word-split in array assignment) - different context (quoted "$@" in a pipeline function call), both positional-parameter word-structure bugs.
Fixed by wt14/pbbfix (568bd37, master): execute_function_pipeline_stage expanded arguments with scalar expand_word (space-joined), destroying field structure. GNU runs pipeline members through the SAME word-list expansion as everything else (execute_cmd.c:624 -> subst.c:13219; :10691 case @). Now expand_stage_tail_words (the shared argv builder). Matrix byte-identical ("$@"/$/"$"/mixed/"${arr[@]}"/glob/empties); FFmpeg n7.1.1 configure REAL RUN re-verified on the final binary: rc=0, zero bad substitutions, config.h 784 lines/781 defines = the GNU baseline (was 16/13), config.mak 3162 lines identical both sides; remaining diffs are platform-class only.
Activity
docs(corpus): ecosweep3 lane - pbb per-snippet, zlib/libpng/FFmpeg co…
fix(#330): pipeline function stages expand argv with the field-splitt…
caomengxuan666 commentedon Sep 29, 2026
Fixed by wt14/pbbfix (568bd37, master): execute_function_pipeline_stage expanded arguments with scalar expand_word (space-joined), destroying field structure. GNU runs pipeline members through the SAME word-list expansion as everything else (execute_cmd.c:624 -> subst.c:13219; :10691 case @). Now expand_stage_tail_words (the shared argv builder). Matrix byte-identical ("$@"/$/"$"/mixed/"${arr[@]}"/glob/empties); FFmpeg n7.1.1 configure REAL RUN re-verified on the final binary: rc=0, zero bad substitutions, config.h 784 lines/781 defines = the GNU baseline (was 16/13), config.mak 3162 lines identical both sides; remaining diffs are platform-class only.