Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: repair explosive memory leak in GritQL parser #5033

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

morgante
Copy link
Contributor

@morgante morgante commented Feb 4, 2025

Summary

Fixes #5032 to prevent the parser from consuming infinite memory.

We previously only consumed new-lines in debug builds: https://github.com/biomejs/biome/pull/5033/files#diff-15e627641974e3cc1e6efc62bdc4b632ca41315fa8cc7b5bf3dd50c40df65d3eL183

This of course is very problematic when trying to use the parser in a released build.

Test Plan

Since this behavior only shows up in release builds, I don't have a simple way to run the tests unless we want to switch CI to use the --release profile for running tests.

@github-actions github-actions bot added A-Parser Area: parser L-Grit Language: GritQL labels Feb 4, 2025
Copy link

codspeed-hq bot commented Feb 4, 2025

CodSpeed Performance Report

Merging #5033 will not alter performance

Comparing morgante:explosive-memory (dce2004) with next (a00d6d5)

Summary

✅ 94 untouched benchmarks

@morgante morgante marked this pull request as ready for review February 4, 2025 17:48
crates/biome_grit_parser/src/lexer/mod.rs Outdated Show resolved Hide resolved
@dyc3 dyc3 merged commit 48eab5b into biomejs:next Feb 4, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Parser Area: parser L-Grit Language: GritQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants