Repository navigation
test: pin extglob quoted bracket literal in group scanners (Refs #3189) - #3190
Merged
Merged
Conversation
The extglob group-structure scanners (extglob_group_end and
extglob_split_alternatives in src/executor/conditional/extglob.rs) do
not honour the CTLESC escape, so a quoted structural character inside
an extglob group is read as pattern structure: a quoted '[' starts
the bracket skip and runs past the group end, a quoted '(' inflates
the depth, a quoted ')' ends the group early, and a quoted '|' splits
the alternative. The literal matchers already carry the CTLESC arm
(#3098 for the extglob one); the alternatives just never reach them
intact.
GNU: quote_string_for_globbing (pathexp.c:246-272) rewrites every
CTLESC-quoted glob char as a backslash escape, and every pattern
scanner checks the escape first (PATSCAN lib/glob/sm_loop.c:697-700;
GMATCH escape arm sm_loop.c:121 before the bracket arm at :327).
11 test functions, script-file harness as in the issue3050 pin:
RED cells for the group-end face, the alternative-split face, all
five group operators and the [[ == ]] face; LOCK cells for the
shapes #3098 fixed and for the accidentally-rescued shapes.
Expectations verified byte-for-byte against GNU bash 5.3.20.
Member
Author
|
【WIN-AGENT-AUDIT】 机制核查:
腿:
F 点:无。 未跑/VOID 的腿:无(本 stem Windows 可跑,全部腿已跑)。 |
Member
Author
|
【WIN-AGENT-FIX】P1b 批次汇总(2026-11-15)
要点:
|
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 #3189 — test-only pin (no product code).
What this pins
Quoted literal characters inside an extglob group never match when the
quoted character is structural to the group scanners: a quoted
[starts the bracket skip in the group-end scanner and runs past the
group end, a quoted
(inflates its depth counter, a quoted)endsthe group early, and a quoted
|splits the alternative in thealternative splitter. Root cause (both scanners in
src/executor/conditional/extglob.rs):extglob_group_endhas abackslash escape arm but no CTLESC arm, and
extglob_split_alternativeshas neither — while both literal matchersalready treat a CTLESC-quoted character as an opaque literal (the
extglob one since #3098). The alternatives therefore never reach the
literal matchers intact.
GNU semantics (vendored bash 5.3 source):
quote_string_for_globbing(pathexp.c:212, convert_to_backslash branch :246-272) rewrites every
CTLESC-quoted glob character —
[included, perglob_char_p(pathexp.c:164) — as a backslash escape before matching, and every
pattern scanner checks the escape first (PATSCAN
lib/glob/sm_loop.c:697-700 before the bracket case at :709; GMATCH
escape arm sm_loop.c:121 before the bracket arm at :327).
Pin contents (tests/issue3189_extglob_quoted_bracket_literal.rs)
11 test functions, script-file harness as in the issue3050 pin;
expectations verified byte-for-byte against the GNU bash 5.3.20
oracle and against base (pre-#3098) and current master (with #3098)
binaries:
@("a[b")and its single-quote / mid-word /group-position / operator (
*+?!) /[[ == ]]variants;@("a(b"),@("a)b"); the quoted-pipe and escaped-parenalternative-split shapes.
repaired (quoted
]/!), the accidentally-rescued shapes(
@("a[b]c"),@("a(b)c")), unquoted bracket-class controls,plain (non-extglob) quoted
[, plain negation, and theNOMATCH negative controls.
One adjudication note: the p8
(shape was recorded as MATCH on the#3098 head during that lane, but is deterministically NOMATCH on the
same head binary and on current master across 170+ repeat runs, as
the scanner model predicts — it is pinned RED here.
Fail-first status: the lane's five attempts to run this pin on base
a432632 were all voided by a build-environment write fault in the
lane's cell (cargo dies at its own bookkeeping writes —
.fingerprint/*/invoked.timestampand the global-cache DB return"Operation not permitted" / disk I/O errors — reproduced with and
without the build slot and the scrubbed-cargo wrapper; the fault is
in the cell's storage layer, not in this pin). Per-cell expectations
were instead verified directly against the real base and #3098-head
binaries, script file by script file; the full matrix and the fault
characterisation are in the lane report. The pin still needs one
harness run on a healthy machine:
cargo test --locked --test issue3189_extglob_quoted_bracket_literalon a432632 — expected: the 7 RED functions fail, the 4 LOCK
functions pass.
本 PR 删除了什么
无(纯测试新增,一个测试文件;无产品代码改动)。