-
Notifications
You must be signed in to change notification settings - Fork 389
Include the name of the created tag in TB's Reborrow events #4387
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
811e911
to
ab579e4
Compare
@@ -15,7 +15,7 @@ use crate::*; | |||
#[derive(Clone, Copy, Debug)] | |||
pub enum AccessCause { | |||
Explicit(AccessKind), | |||
Reborrow, | |||
Reborrow(BorTag), |
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.
Reborrow(BorTag), | |
/// The tag here is the one *newly created* by the reborrow that caused the access. | |
Reborrow(BorTag), |
@@ -1,11 +1,11 @@ | |||
error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden | |||
error: Undefined Behavior: reborrow to create <TAG> through <TAG> at ALLOC[0x0] is forbidden |
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.
The new tag doesn't matter here, does it? Creating it failed, so it can't possibly occur anywhere else in the state already.
@@ -21,7 +21,7 @@ help: the accessed tag <TAG> later transitioned to Active due to a child write a | |||
LL | *x = 1; | |||
| ^^^^^^ | |||
= help: this transition corresponds to the first write to a 2-phase borrowed mutable reference | |||
help: the accessed tag <TAG> later transitioned to Frozen due to a reborrow (acting as a foreign read access) at offsets [OFFSET] | |||
help: the accessed tag <TAG> later transitioned to Frozen due to a reborrow to create <TAG> (acting as a foreign read access) at offsets [OFFSET] |
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.
Is it clear that the newly created tag is always the more interesting one here, rather than the tag of the pointer that is the input to the reborrow?
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.
Yes, because it can be traced with -Zmiri-track-pointer-tag
(which tells you the parent tag), but you can't find the child tag from the parent.
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.
Yeah, that's why the alternative solution to the linked issue is to make tag tracking also log reborrows of the tracked tag. But I suspect that will be an unusable amount of information written to the terminal.
This fixes #4386 by recording and mentioning the created tag in a Reborrow event.