Skip to content

rustc hanging indefinitely and using more and more memory #32572

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

Closed
yberreby opened this issue Mar 29, 2016 · 2 comments
Closed

rustc hanging indefinitely and using more and more memory #32572

yberreby opened this issue Mar 29, 2016 · 2 comments

Comments

@yberreby
Copy link

When compiling a particular piece of code, rustc hangs and keeps allocating memory indefinitely. I noticed this because my computer suddenly started swapping, and I found out rustc was using around 6GB of memory and growing.

Here's the code that triggered the bug:

pub enum PrimaryExpr {
    Indexing(PrimaryExpr, Expression),
    Slicing(PrimaryExpr, Slice),
}

Yes, nothing else - no dependencies, no modules, nothing.

Trying to compile it triggers the bug (src/lib.rs contains only the above snippet):

$ cat src/lib.rs
pub enum PrimaryExpr {
    Indexing(PrimaryExpr, Expression),
    Slicing(PrimaryExpr, Slice),
}

$ rustc src/lib.rs
src/lib.rs:2:27: 2:37 error: type name `Expression` is undefined or not in scope [E0412]
src/lib.rs:2     Indexing(PrimaryExpr, Expression),
                                       ^~~~~~~~~~
src/lib.rs:2:27: 2:37 help: run `rustc --explain E0412` to see a detailed explanation
src/lib.rs:2:27: 2:37 help: no candidates by the name of `Expression` found in your project; maybe you misspelled the name or forgot to import an external crate?
src/lib.rs:3:26: 3:31 error: type name `Slice` is undefined or not in scope [E0412]
src/lib.rs:3     Slicing(PrimaryExpr, Slice),
                                      ^~~~~
src/lib.rs:3:26: 3:31 help: run `rustc --explain E0412` to see a detailed explanation
src/lib.rs:3:26: 3:31 help: you can import it into scope: `use std::raw::Slice;`.
error: main function not found

rustc reports the error normally, but instead of exiting afterward it stays alive and keeps allocating more memory until I manually kill it.

Meta

$ rustc --version -v
rustc 1.9.0-nightly (d5a91e6 2016-03-26)
binary: rustc
commit-hash: d5a91e6
commit-date: 2016-03-26
host: x86_64-apple-darwin
release: 1.9.0-nightly

@jonas-schievink
Copy link
Contributor

Duplicate of #32326

@yberreby
Copy link
Author

@jonas-schievink Indeed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants