SyntaxSuggest 3.0.0 leaks raw invalid bytes into stderr when source has invalid encoding
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 350
- Forks
- 17
- Avg merge
- 48m
- Merged PRs (30d)
- 5
Description
Since 3.0.0 removed CleanDocument#clean_sweep, sources that contain bytes invalid in their encoding are no longer rejected internally — the raw bytes end up in the annotation. Previously clean_sweep raised ArgumentError and the rescue in core_ext.rb produced a clean fallback.
Under LC_ALL=C, captured error output becomes a US-ASCII string with invalid bytes — any regex match on it raises ArgumentError: invalid byte sequence in US-ASCII. This broke spec/ruby/language/source_encoding_spec.rb on three Ruby CI platforms:
- https://rubyci.s3.amazonaws.com/debian/ruby-master/log/20260420T003003Z.fail.html.gz
- https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20260419T230004Z.fail.html.gz
- https://rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20260419T233005Z.fail.html.gz
I added workaround for this at https://github.com/ruby/ruby/commit/f45bb9ba36cff72eff1bf0c0817a023843a1be34
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by tracing invalid-encoding handling around CleanDocument#clean_sweep and the rescue in core_ext.rb. Reproduce the issue under LC_ALL=C with a source containing invalid bytes, then inspect spec/ruby/language/source_encoding_spec.rb and the linked Ruby CI failures. Done means raw invalid bytes no longer reach the annotation or captured stderr and the affected encoding behavior is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100