-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Show the offset, length and memory of uninit read errors #142673
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
base: master
Are you sure you want to change the base?
Conversation
throw_ub!(InvalidUninitBytes(None)); | ||
throw_ub!(InvalidUninitBytes(match op.to_op(self)?.as_mplace_or_imm() { | ||
Left(mplace) => mplace.ptr().provenance.and_then(|prov| { | ||
let start = mplace.ptr().into_parts().1; | ||
let size = op.layout().size; | ||
let range = alloc_range(start, size); | ||
Some((prov.get_alloc_id()?, BadBytesAccess { access: range, bad: range })) | ||
}), | ||
Right(_) => None, | ||
})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't show up in diagnostics, but it seemed good to change it, too
This comment has been minimized.
This comment has been minimized.
grml. I haven't been able to run miri's dep tests in-tree in forever. Always sth about libc not found. Will try to bless the others and hope none of these need blessing |
The Miri subtree was changed cc @rust-lang/miri |
r? @RalfJung
I want to improve memory dumps in general. Not sure yet how to do so best within rust diagnostics, but in a perfect world I could generate a dummy in-memory file (that contains the rendered memory dump) that we then can then provide regular rustc
Span
s to. So we'd basically report normal diagnostics for them with squiggly lines and everything.