-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustc runs out of memory when compiling an invalid macro #37113
Comments
cc @TimNN, who I think has (had?) a fix for this |
I'm pretty sure this is a different issue (here, OOM occurs due to the error), my fix for empty repetitions has been merged. My guess is that this is somehow related to parser recovery. |
This was referenced Oct 18, 2016
goffrie
added a commit
to goffrie/rust
that referenced
this issue
Oct 27, 2016
If we encounter a syntax error inside of a braced block, then we should fail by consuming the rest of the block if possible. This implements such recovery for enums and structs. Fixes rust-lang#37113.
goffrie
added a commit
to goffrie/rust
that referenced
this issue
Oct 27, 2016
If we can't make progress when parsing a macro expansion as a statement then we should just bail. This alleviates the symptoms shown in e.g. rust-lang#37113 but it doesn't fix the problem that parsing invalid enum bodies (and others) leaves the parser in a crappy state.
bors
added a commit
that referenced
this issue
Oct 27, 2016
Recover out of an enum or struct's braced block. If we encounter a syntax error inside of a braced block, then we should fail by consuming the rest of the block if possible. This implements such recovery for enums and structs. Fixes #37113.
bors
added a commit
that referenced
this issue
Nov 11, 2016
Don't spin expanding stmt macros. If we can't make progress when parsing a macro expansion as a statement then we should just bail. This alleviates the symptoms shown in e.g. #37113 and #37234 but it doesn't fix the problem that parsing invalid enum bodies (and others) leaves the parser in a crappy state. I'm not sold on this strategy (checking `tokens_consumed`), so if anyone has a better idea, I'm all ears!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiling this invalid macro code with rustc causes all system memory to be used up until the process is killed.
I expected rustc to display an error message and return immediately. Instead, an error message is reported and then rustc hangs and eats up all available system memory.
I tried both stable and nightly:
I think this might be related to #33136.
The text was updated successfully, but these errors were encountered: