Rustc hangs infinitely and consumes increasingly more memory on specific macro expansion #123848
Labels
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
C-bug
Category: This is a bug.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-hang
Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Coming here from rust-lang/rust-clippy#12414.
I found a very specific macro that causes the Rust compiler to hang infinitely while doing
cargo check
and consumes increasingly more memory over time, going into the 100s of gigabytes sometimes (it is put in swap then of course). This already caused my computer to crash multiple times...The problematic function is most likely rustc_expand::mbe::transcribe::transcribe.
A related issue is #95698, where the compiler also hangs during macro expansion.
Meta
rustc --version --verbose
:Backtrace (using
/usr/bin/sample
)The text was updated successfully, but these errors were encountered: