Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Back-references are rejected in byte (C locale) mode

Open
#543 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Omkar-Wagholikar is already working on this.

Since Oct 14, 2026.

  • #545 by @lKolabrodl — closed without merging
  • #602 by @Omkar-Wagholikar — open

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

good first issue

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/sed

All issues in uutils/sed

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.