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
Fixed on wt/p3-comsub (ae54db57, base 26728da) — and the root cause is NOT an eval runtime mutation.
Actual root cause (parse-time):has_unclosed_parameter_expansion (src/lexer/brace_scan.rs) tracked single-quote state but its ${ branch fired regardless of quote state. A ${ inside a single-quoted word (eval 'x=${bad') therefore kept the logical line open: every later physical line joined into the opening line and inherited its CommandNode.line — the e7/e9 "all lines = eval line" instrumentation is this corruption. The same-line skip then discarded the tail. Minimal reproducer without any eval:
echo'x=${bad'echo l2
echo l3
all three commands got line=Some(1) (DBG instrumentation); GNU 5.3.0 prints the three lines normally, rc 0.
GNU anchor:parse.y:5305 read_token_word() — single-quoted text is literal until the closing '; ${ there never opens an expansion. Fix: gate the branch with !single (double quotes keep joining — "${unclosed" really is an expansion; ANSI-C already had its own branch).
Second fix in the same commit: the eval unclosed-construct diagnostic in execute_eval was a raw eprintln! that bypassed eval's own redirections. GNU eval_builtin binds the builtin's redirections before parse_and_execute, so eval 'x=${bad' 2>/dev/null suppresses it. Now routed via write_buffered_builtin_output.
Verification (WSL GNU Bash 5.3.0): e7 matrix → e=2 / m6=1 / end, rc 0, stdout byte-identical; stderr identical in both the no-redirect (diagnostic printed with eval: line 1 prefix) and 2>/dev/null (suppressed) forms. dstack/dstack2/errors suites unchanged (0/0/2).
Activity
caomengxuan666 commentedon Sep 27, 2026
Fixed on
wt/p3-comsub(ae54db57, base 26728da) — and the root cause is NOT an eval runtime mutation.Actual root cause (parse-time):
has_unclosed_parameter_expansion(src/lexer/brace_scan.rs) tracked single-quote state but its${branch fired regardless of quote state. A${inside a single-quoted word (eval 'x=${bad') therefore kept the logical line open: every later physical line joined into the opening line and inherited itsCommandNode.line— the e7/e9 "all lines = eval line" instrumentation is this corruption. The same-line skip then discarded the tail. Minimal reproducer without any eval:all three commands got
line=Some(1)(DBG instrumentation); GNU 5.3.0 prints the three lines normally, rc 0.GNU anchor:
parse.y:5305 read_token_word()— single-quoted text is literal until the closing';${there never opens an expansion. Fix: gate the branch with!single(double quotes keep joining —"${unclosed"really is an expansion; ANSI-C already had its own branch).Second fix in the same commit: the eval unclosed-construct diagnostic in
execute_evalwas a raweprintln!that bypassed eval's own redirections. GNUeval_builtinbinds the builtin's redirections beforeparse_and_execute, soeval 'x=${bad' 2>/dev/nullsuppresses it. Now routed viawrite_buffered_builtin_output.Verification (WSL GNU Bash 5.3.0): e7 matrix →
e=2/m6=1/end, rc 0, stdout byte-identical; stderr identical in both the no-redirect (diagnostic printed witheval: line 1prefix) and2>/dev/null(suppressed) forms. dstack/dstack2/errors suites unchanged (0/0/2).caomengxuan666 commentedon Sep 27, 2026
已在 9ecb59b 落地并关闭(三 commit 已在 issue 评论区有独立说明)。477/477 + 双交叉 + 套件账本零回归。
fix(parser): align the diagnostic message family with GNU - stdin lin…