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] set -x misses the '+ f' function-invocation trace line (GNU prints '+ f' before the body's '+ echo ...'; rubash prints body traces only) #247
Found by: wt4/regfix lane issue round (2026-09-27), script-file-verified against WSL GNU Bash 5.3.0 (/usr/local/bin/bash).
Summary: Under set -x, GNU prints one trace line per function invocation — the command head + f — before the body's own traces. Rubash skips the + f line entirely.
Reproducer (LF script file, identical bytes both shells; target/issue-suites/results/wt4-regfix/issue-probes/p1-xtrace-fn.sh):
set -x
f() { echo body; }
f
set +x
echodone
GNU Bash 5.3.0 stderr:
+ f
+ echo body
+ set +x
rubash stderr (wt4/regfix debug build):
+ echo body
+ set +x
(stdout body / done identical; only the invocation trace line is missing.)
GNU C source owner:execute_cmd.c:4649 execute_simple_command — the command-head xtrace_print_word_list (words, 1) runs before the function/builtin/external dispatch, so a word that resolves to a function still gets its head trace (+ f); the body then traces its own commands in the same shell.
Rubash owner:src/executor/command_dispatch.rs:38-47 — xtrace_command_lines(cmd) traces only the function's internal command lines for a function invocation; the invocation head line is not emitted. (Arithmetic commands are deliberately excluded there per #88; functions must not be.)
Classification: rubash-caused (WSL GNU 5.3.0 oracle). Severity: xtrace output is not byte-comparable for any traced script that calls functions (nvm.sh trace, bashdb set -x debugging, CI xtrace logs).
Activity
lexer: brace-scan resume must restore the snapshot position — depth>=…
docs: task board - regfix+deep201 recovered (#201 CLOSED), #247-251 q…
xtrace fn head line, reserved-word redirect operands, comsub $-carrie…
caomengxuan666 commentedon Sep 27, 2026
已修复并合入 master(commit 160d31b1,lane wt5/misc;GNU 引用与全矩阵验证见提交;相邻真 bug(v=$(f) 在 set -x 下双执行函数体)已一并修复)。感谢报告!