Repository navigation
test: add fail-first regression pins for procsub brace-group body (Refs #3808) - #3812
Merged
Merged
Conversation
Record the single-field verdict for a bare procsub redirect operand
in expand_redirect_target: GNU redirection_expand (redir.c:296-333)
returns NULL only for zero or several fields, and expand_word_internal's
`<'/`>' cases (subst.c:11364-11391) extract the substitution whole
(extract_process_subst, subst.c:1311) and splice the single /dev/fd/N
filename in, so a `{ ...; }` group body's `{` is a compound-command
opener, never a brace-expansion introducer. Without the memo, the
textual ambiguity gate misread the body's `{` and rejected
`exec 3> >({ echo a; echo b; })` as ambiguous redirect.
Member
Author
|
【WIN-AGENT-AUDIT】PR #3812 第1轮 — 建议:PASS 机制核查:
腿(逐项数字):
F 点:无 续作记录:无(本轮只读验证,未动分支) 未跑/VOID 的腿:无 |
caomengxuan666
marked this pull request as ready for review
November 17, 2026 04:25
This was referenced Nov 17, 2026
Closed
fix(executor): expand non-ASCII bracket members to UTF-8 byte escapes in C locale (Refs #3791)
#3822
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3808
根因
exec 3> >({ echo a; echo b; })在 reject_invalid_redirects 的 file-open 臂被判 ambiguous redirect。expand_redirect_target对裸 procsub 操作数直接原样返回(#1223 守卫),不记录 #3089 字段裁决 memo;redirect_operand_ambiguous于是落到文本门redirect_target_is_ambiguous,它把 raw 词里未加引号的{(组体的{,实为复合命令 opener)误读为 brace-expansion introducer,而展开结果含空白 → 判多字段。子 shell 列表体能过只因体内无此类字符;输入侧 procsub 因已物化为 carrier 路径而不触发。修法(
src/executor/expand_word.rs):procsub 守卫命中时记录 single-field 裁决 memo;两处 ambiguity 门均先查 memo。GNU 锚点:redir.c:296-333 redirection_expand(NULL 仅当零/多字段)+ subst.c:11364-11391 expand_word_internal</>cases(extract_process_subst subst.c:1311 整体抽取、process_substitute subst.c:6362,拼入单个 /dev/fd/N 文件名)。本 PR 删除了什么
无(仅新增 19 行修法 + 先行回归钉)。
验证
UNVERIFIED-BY-CAPTAIN:X299(Windows MSVC 原生):
issue3808_procsub_group_body:base 969230b 上 3 绿 1 红(fail-first:group_body_output_procsub_on_fd3报ambiguous redirect);修后 4/4 绿。{ ...; }rejected on write-side>(...)(GNU runs it; read side works) #1223/fd: procsub-body parse restores a retired fd 0 entry (same hazard as #3706) #3731/[bug]exec N< <(slow-producer)blocks until producer exits (GNU returns immediately) #1021/[bug] Redirect target joining a quoted space segment with a substitution reports "ambiguous redirect" #3089×2/[bug] Output process substitution >(...) hands external commands a dangling /dev/fd/N (data silently lost) #1460/[harvest nightly 10-23] HANG ×2 on current master (legacy cumulative watchlist: 78) #1336/[bug]exit Nin>(...)write-side procsub terminates the shell (GNU: ignored, rc=0) #1219/[bug]>(slow-consumer)blocks the next command until the consumer exits (GNU runs it async) #1220/[bug]>(while-read)consumer output is printed twice (GNU: once) #1221/#339_340/[hunt] Behavioral differential sweep — 6 divergences vs GNU 5.3.20 (lexer '2' arm skips dequote is the big one) #1184):9 茎全绿;[bug] Redirect target joining a quoted space segment with a substitution reports "ambiguous redirect" #3089 两茎各 1 红与 [hunt] Behavioral differential sweep — 6 divergences vs GNU 5.3.20 (lexer '2' arm skips dequote is the big one) #1184 6 红为 base 同名同数既存红,非回归。issue2084_session_end_restores_host_process_state既存红)。RUSTFLAGS="-D warnings" cargo check --locked --lib --binsRC=0,无 warnings/errors;rustfmt --check(expand_word.rs)RC=0。