Initializing wrapper struct private field blows up system memory. #119631
Labels
C-bug
Category: This is a bug.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried initializing a private field from a wrapper struct
pub struct Foo(/*private fields*/)
that is defined in another crate, and Rust started to eat all my system memory, until I was forced to restart the computer.Unfortunately the code that caused this from my side is closed source, but I was trying to initialize the
Extensions
struct like this:I expected to see this happen:
Either a compiler crash or just the compiler giving me an error saying that you can't do that!
Instead, this happened:
System memory usage kept going up and up, until it crashed my pc. Limiting
cargo check
memory usage just meant that the process was killed, so no error messages either.Meta
rustc --version --verbose
:I've also tried (and got the same results)
nightly-2024-01-05
.We got this issue in 3 different systems, 2 being linux x64 and one being macos (with the m1/2 arch, whatever that is called).
Backtrace
No backtrace, rust didn't produce any error output, it just got stuck in
checking {crate-name}
forever.The text was updated successfully, but these errors were encountered: