-
Notifications
You must be signed in to change notification settings - Fork 349
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
Leaking a heap allocation of pointer results in confusing output #2812
Comments
(my comment is directed at everyone else, not OP) The fact that the leak report also says But more importantly: Why are we even mentioning that |
Hmm... I thought it to be strictly better to tell the user about all the things their leaked alloc references, but it was definitely not based on any data |
This is not the first time I've seen a newcomer be bewildered by the amount of text that gets written to the screen and just ignore most of it. It is of course possible to puzzle through this report, but the fact that it has so much information and dense notation and a lot of these IDs I think causes people to skim over it way too often. It wouldn't hurt to link people to something like a glossary or the rustc error index. But in this case specifically, I think unless we can explain how a user would use the
to debug their leak, not outputting that sounds like a better option. |
In that case, maybe we should change the
|
I think Miri prints |
FWIW, what happens here is that |
Take the code:
Running
cargo miri run
produces the following output:It is not immediately clear why alloc1657 is shown or the relation between alloc1673 and alloc1657. If alloc1657 were not deallocated it would be possible to interpret alloc1657 as leaked memory.
One suggestion would be to explicitly mention that the leaked memory contains alloc1657 and expand a1657 to alloc1657 for clarity.
The text was updated successfully, but these errors were encountered: