-
Notifications
You must be signed in to change notification settings - Fork 353
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
Throwing a panic via core::panic reports memory leak #1071
Comments
This can easily be reproduced by adjusting our |
#1073 contains some commented-out tests for this. |
If we create a stack allocation without putting it into a frame's locals list, it will get leaked |
The offending allocation is created here: |
That should be treated like a const, right? |
Not sure what you mean? Ideally it should probably be interned but I am not sure what the best way is to achieve that. |
I mean it should be treated like |
Yeah that would be achieved by interning the result. I went with rust-lang/rust#66844 instead as that seemed simpler; I was not sure how to best achieve interning here. |
…i-obk Miri: do not consider memory allocated by caller_location leaked Fixes rust-lang/miri#1071 r? @oli-obk I am not sure if this is the best approach, but it certainly is the easiest.
test more panics Add some tests for #1071. Blocked on rust-lang/rust#66844.
test more panics Add some tests for #1071. Blocked on rust-lang/rust#66844.
When a
#[should_panic]
test throws viacore::panic!
instead of (the default)std::panic!
, we have a memory leak: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
The text was updated successfully, but these errors were encountered: