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

out of memory #115414

Closed
matthiaskrgr opened this issue Aug 31, 2023 · 4 comments · Fixed by #117143
Closed

out of memory #115414

matthiaskrgr opened this issue Aug 31, 2023 · 4 comments · Fixed by #117143
Labels
C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Aug 31, 2023

I tried this code:
I found this code would make rustc eat more than 20 gb of memory until OOM killer stopped it

fn T<T>(x: &T::<T::<T::<T::<T::<T::<T::<x, HT::U<T::<T::<x, T::<T::<T::<T::<T::<T::<T::<T::<x, T::<T, T>>T::<x, HT::U<T::<T::<x, T::<T::<TT::<T::(<T::<T)::<x, )T>>, T>>, T::<T:T, T>>>>>, T>>, T>>>, T::<x, T::<T::<T::<>>, T

I expected to see this happen: explanation

Instead, this happened: explosion

Meta

rustc --version --verbose:

rustc 1.74.0-nightly (59a829484 2023-08-30)
binary: rustc
commit-hash: 59a8294849358a878a72358aa6d5fe5b9d312867
commit-date: 2023-08-30
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0
@matthiaskrgr matthiaskrgr added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. C-bug Category: This is a bug. labels Aug 31, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 31, 2023
@SteveLauC
Copy link
Contributor

I copied this line of code into Clion, and the whole OS immediately got stuck, then OOM, and all my apps were killed :>

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 1, 2023
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Sep 1, 2023

Hm this is actually a regression from 1.68 to 1.69 (not very nice!) 🤔 1.68 will show syntax error within <1s

@matthiaskrgr matthiaskrgr added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Sep 1, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Sep 1, 2023
@lqd lqd added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Sep 1, 2023
@lqd
Copy link
Member

lqd commented Sep 4, 2023

Bisects to nightly-2023-01-29.

@apiraino
Copy link
Contributor

apiraino commented Sep 4, 2023

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 4, 2023
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 4, 2023
@bors bors closed this as completed in 7eb0548 Oct 26, 2023
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
C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants