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

add an option to track raw pointer tags in Stacked Borrows #1603

Merged
merged 5 commits into from
Oct 28, 2020

Conversation

RalfJung
Copy link
Member

Also make error messages more informative by printing the affected memory location

* `-Zmiri-track-call-id=<id>` shows a backtrace when the given call id is
assigned to a stack frame. This helps in debugging UB related to Stacked
Borrows "protectors".
* `-Zmiri-track-raw-pointers` makes Stacked Borrows track a pointer tag even for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you construct a test for both the false positive case as well as an example where we now detect latent aliasing where we didn't before? (I'm guessing under certain circumstances they could be one and the same test? we'd just detect the aliasing earlier now)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An example with a false positive caused by this flag is run-pass/box.rs, since it casts a ptr to an int and back.

I can add a test for a bug that would otherwise be missed (rust-lang/rust#78477 is the example that motivated this change).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added such a test.

@RalfJung
Copy link
Member Author

Argh, this fails on Windows because there are integer-pointer casts in the runtime there... is there a way with compiletest to pass a compile-flag only on linux? Otherwise we might just have to disable these tests on Windows (they do not test anything platform-specific so that seems okay).

@oli-obk
Copy link
Contributor

oli-obk commented Oct 28, 2020

is there a way with compiletest to pass a compile-flag only on linux?

no, all you can do is use revisions, not sure if we can do // [some_revision] only-linux

@RalfJung
Copy link
Member Author

I doubt the old compiletest in the stand-alone crate supports revisions...

@oli-obk
Copy link
Contributor

oli-obk commented Oct 28, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 28, 2020

📌 Commit bf54607 has been approved by oli-obk

@bors
Copy link
Collaborator

bors commented Oct 28, 2020

⌛ Testing commit bf54607 with merge 83f7657...

@bors
Copy link
Collaborator

bors commented Oct 28, 2020

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 83f7657 to master...

@bors bors merged commit 83f7657 into rust-lang:master Oct 28, 2020
@RalfJung RalfJung deleted the track-raw branch October 29, 2020 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants