Skip to content

Simple macro makes rustc use all CPU/memory #36715

New issue

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

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

Already on GitHub? # to your account

Closed
ctz opened this issue Sep 25, 2016 · 2 comments
Closed

Simple macro makes rustc use all CPU/memory #36715

ctz opened this issue Sep 25, 2016 · 2 comments

Comments

@ctz
Copy link
Contributor

ctz commented Sep 25, 2016

I was trying to write a macro which accepts any arguments and compiles to nothing.

My first try was:

macro_rules! warn ( ( $()* ) => () );

fn main() {
    warn!("This will never be printed!");
}

Experienced behaviour: rustc uses up all CPU and memory, then get killed by the kernel OOM killer.

Expected behaviour: either a program with no output, or an error explaining why this macro is invalid.

Versions:

$ rustc --version --verbose
rustc 1.11.0 (9b21dcd6a 2016-08-15)
binary: rustc
commit-hash: 9b21dcd6a89f38e8ceccb2ede8c9027cb409f6e3
commit-date: 2016-08-15
host: x86_64-unknown-linux-gnu
release: 1.11.0
@TimNN
Copy link
Contributor

TimNN commented Sep 25, 2016

Duplicate of #5067.

@TimNN
Copy link
Contributor

TimNN commented Sep 25, 2016

I'm going to close this, since it's a duplicate.

@TimNN TimNN closed this as completed Sep 25, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants