-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Compilation Exhausts Memory Instead of Detecting Potential Syntax Error #117080
Labels
A-parser
Area: The parsing of Rust source code to an AST
C-bug
Category: This is a bug.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Oct 23, 2023
Noratrieb
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
A-parser
Area: The parsing of Rust source code to an AST
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Oct 23, 2023
The problem is introduced by |
estebank
added a commit
to estebank/rust
that referenced
this issue
Oct 24, 2023
When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism. Fix rust-lang#117080.
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 24, 2023
Avoid unbounded O(n^2) when parsing nested type args When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism. Fix rust-lang#117080.
estebank
added a commit
to estebank/rust
that referenced
this issue
Oct 24, 2023
When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism. Fix rust-lang#117080.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Oct 26, 2023
Avoid unbounded O(n^2) when parsing nested type args When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism. Fix rust-lang#117080, fix rust-lang#115414.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 26, 2023
Rollup merge of rust-lang#117143 - estebank:issue-117080, r=wesleywiser Avoid unbounded O(n^2) when parsing nested type args When encountering code like `f::<f::<f::<f::<f::<f::<f::<f::<...` with unmatched closing angle brackets, add a linear check that avoids the exponential behavior of the parse recovery mechanism. Fix rust-lang#117080, fix rust-lang#115414.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-parser
Area: The parsing of Rust source code to an AST
C-bug
Category: This is a bug.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code():
I expected to see this happen: the compiler to recognize a potential syntax error and provide an error report.
Instead, this happened: the compiler consumes all available memory and exits.
This code contains obvious syntax errors, so it doesn't seem reasonable for it to be compiled for a long time.
Meta
rustc --version --verbose
:The same problem is reproduced on the stable version(1.73 cc66ad4 2023-10-03)
Backtrace
The text was updated successfully, but these errors were encountered: