Back-references are rejected in byte (C locale) mode
Maintainers usually reply within 1 day
@Omkar-Wagholikar is already working on this.
Since Oct 14, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- cli, testing-qa
Research direction
Start in src/sed/fast_regex.rs and trace how byte-mode regular expressions reject back-references. Reproduce the locale-specific commands from the issue, then inspect fuzz/fuzz_targets/fuzz_sed.rs and its KNOWN_ISSUES entry. Done means the C-locale command matches GNU sed behavior and the fuzzer no longer needs to skip back-reference scripts.
Written by the indexing model from the issue text.
Description
Found by the differential fuzzer (fuzz/fuzz_targets/fuzz_sed.rs).
In the C/POSIX locale we select the byte-oriented engine, which rejects
back-references outright. GNU sed supports them in every locale.
$ printf 'aba\n' | LC_ALL=C sed -n '/\(a\)b\1/p'
aba
$ printf 'aba\n' | LC_ALL=C ./target/release/sed -n '/\(a\)b\1/p'
sed: <script argument 1>:1:11: error: invalid regex '(a)b(?:\1)': back-references are not supported in byte mode
# Exit code: 1
The same script works in a UTF-8 locale, so this only affects byte mode:
$ printf 'aba\n' | LC_ALL=en_US.UTF-8 ./target/release/sed -n '/\(a\)b\1/p'
aba
The error comes from src/sed/fast_regex.rs. Until this is fixed the fuzzer
skips scripts using back-references; see KNOWN_ISSUES in
fuzz/fuzz_targets/fuzz_sed.rs.
- Dominant language
- Rust
- Stars
- 110
- Forks
- 36
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 30
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/sed
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
l command: the wrap width comes from the terminal size, and -l is ignoredPossibly taken @SichenLiang claimed this 41 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
--posix should disable the GNU regular expression escapes (\? \+ \| \w \s)Possibly taken @LoukasPap claimed this 43 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
s/// replacement: implement the \U \L \u \l \E case-conversion escapesPossibly taken @dedsec-terminal claimed this 33 days ago. Opengood first issue
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
area:desktop priority:p2 type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
fritzprix/libr-agent#2165 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:ecosystem bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Chelis-Lang/chelis#3942 ·
Maintainers usually reply within 1 day