Skip to content
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

Extend track alloc id to show deallocations #1314

Closed
RustyYato opened this issue Apr 8, 2020 · 3 comments · Fixed by #1334
Closed

Extend track alloc id to show deallocations #1314

RustyYato opened this issue Apr 8, 2020 · 3 comments · Fixed by #1334
Labels
A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@RustyYato
Copy link
Contributor

Currently -Zmiri-track-alloc-id=<id> shows a stack trace of where some memory got allocated, but not where it was deallocated. It would be nice to show where it was deallocated in order to debug use-after-free bugs.

@RalfJung RalfJung added A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement E-medium labels Apr 9, 2020
@RalfJung
Copy link
Member

RalfJung commented Apr 9, 2020

That's a good idea, I like it. :)
Currently Miri does not necessarily know when memory gets deallocated, so this will require a new machine hook.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 10, 2020
…fJung

added machine hooks to track deallocations

This is part of rust-lang/miri#1314 in order to allow miri to show stack traces for on deallocation in order to debug use-after-free bugs
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 10, 2020
…fJung

added machine hooks to track deallocations

This is part of rust-lang/miri#1314 in order to allow miri to show stack traces for on deallocation in order to debug use-after-free bugs
Centril added a commit to Centril/rust that referenced this issue Apr 10, 2020
…fJung

added machine hooks to track deallocations

This is part of rust-lang/miri#1314 in order to allow miri to show stack traces for on deallocation in order to debug use-after-free bugs
@RalfJung
Copy link
Member

@KrishnaSannasi your rustc PR landed, do you plan to follow up on this with a Miri PR? Do you need any help with that?

@RustyYato
Copy link
Contributor Author

RustyYato commented Apr 14, 2020

@RalfJung yes, I will follow up with a miri PR, just was a little busy the last few days, I think I can figure this out, but if I need help I'll be sure to ping you. Thanks for all the help so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants