Skip to content

Full system freeze on missing semicolon #34375

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
ghost opened this issue Jun 20, 2016 · 3 comments
Closed

Full system freeze on missing semicolon #34375

ghost opened this issue Jun 20, 2016 · 3 comments
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

Comments

@ghost
Copy link

ghost commented Jun 20, 2016

I've been experiencing a complete system freeze when I compile the following code:

    macro_rules! test_macro {
        () => {{
            use std::env;
            let e = env::var("_")
        }}
    }

    #[cfg(test)]
    mod tests {
        #[test]
        fn it_works() {
            test_macro!();
        }
    }

Note the missing semicolon at the end of the assignment statement. I have been reliably able to reproduce this issue on Ubuntu 14.04.x and 16.04. The issue doesn't seem to be caused by OOM conditions as the freeze is instantaneous and no heavy swapping occurs (swap is enabled), but I may be mistaken.

Rust version: 1.9
Arch: x86_64

@nagisa
Copy link
Member

nagisa commented Jun 20, 2016

Both stable and nightly result in OOM here:

> ~/.cargo/bin/rustup run stable rustc test.rs --test
test.rs:5:5: 5:6 error: expected one of `.`, `;`, or an operator, found `}`
test.rs:5     }}
              ^
fatal runtime error: out of memory
> ~/.cargo/bin/rustup run nightly rustc test.rs --test
test.rs:5:5: 5:6 error: expected one of `.`, `;`, `?`, or an operator, found `}`
test.rs:5     }}
              ^
fatal runtime error: out of memory

EDIT: non-swap system here. In my experience its exactly the swap which is the primary cause of weird system freezes as the OS is working hard on shuffling memory around.

@nrc nrc added the A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) label Jun 29, 2016
@jseyfried
Copy link
Contributor

jseyfried commented Jun 29, 2016

c.f. #34543 (possibly related)

@goffrie
Copy link
Contributor

goffrie commented Jan 10, 2017

I believe this was fixed by #37246.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Projects
None yet
Development

No branches or pull requests

6 participants