-
Notifications
You must be signed in to change notification settings - Fork 390
Closed
rust-lang/rust
#66844Labels
A-interpreterArea: affects the core interpreterArea: affects the core interpreterA-panicsArea: affects panics and unwindingArea: affects panics and unwindingC-bugCategory: This is a bug.Category: This is a bug.
Description
When a #[should_panic]
test throws via core::panic!
instead of (the default) std::panic!
, we have a memory leak:
Alloc 23790: 00 00 00 00 00 00 00 00 0d 00 00 00 00 00 00 00 35 00 00 00 05 00 00 00 (24 bytes, alignment 8) (stack)
└───────(23789)───────┘
Alloc 23789: 74 65 73 74 73 2f 74 65 73 74 2e 72 73 (13 bytes, alignment 1) (Static)
The 2nd allocation is the string tests/test.rs
and 0x35 is 53, the line with the panic statement; this looks like some kind of panic information struct.
The interesting question is, why does a stack allocation not get freed?
Cc @Aaron1011
Metadata
Metadata
Assignees
Labels
A-interpreterArea: affects the core interpreterArea: affects the core interpreterA-panicsArea: affects panics and unwindingArea: affects panics and unwindingC-bugCategory: This is a bug.Category: This is a bug.