-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
memory leak in DiagnosticBuilder.into_diagnostic() #69600
Comments
We could avoid the leak and the let diagnostic = self.0.diagnostic.clone();
self.cancel(); or if we're concerned about performance here, we could maybe do something with |
Thanks for the report, I will measure the perf effects of the different alternatives. I'd like to know how you found this -- code inspection? Some kind of tool? |
I found it while running fuzz-rustc and noticing that I kept running out of memory. I turned on |
Another alternative could be to call |
Below is an example compiler input that triggers the leak: str// bass (FIXMoo {
}
) |
Simpler example that triggers the leak: just a single closing brace } |
…nto_diagnostic-leak, r=Centril Fix a leak in `DiagnosticBuilder::into_diagnostic`. Fixes rust-lang#69600. r? @Centril
…nto_diagnostic-leak, r=Centril Fix a leak in `DiagnosticBuilder::into_diagnostic`. Fixes rust-lang#69600. r? @Centril
This code leaks the
Box
atself.0
:rust/src/librustc_errors/diagnostic_builder.rs
Lines 141 to 144 in d3c7934
The leak was introduced in 2fcd870. cc @nnethercote
The text was updated successfully, but these errors were encountered: