-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
CTFE: throw unsupported error when partially overwriting a pointer #87248
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @oli-obk |
3b4e57e
to
0624ccb
Compare
Ah turns out Miri really needs this:
|
0624ccb
to
4725c85
Compare
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 4725c8543fc218bcafef8c60a9f397019bc5e1aa with merge 3e59a8c2f14152ccc92a6c079f592dc2dc6fa93f... |
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
All of the regressions are spurious (some python network error and some file not found) |
Nice, that's what I hoped for. :) So how do we proceed here -- what are your thoughts on this PR, @oli-obk? |
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.
I like how this allows us to experiment on miri first!
lgtm modulo some tests
Co-authored-by: Oli Scherer <[email protected]>
6efe7fe
to
b7b5091
Compare
Added a test, please have a look. :) |
@bors r+ |
📌 Commit 2a9b44d has been approved by |
☀️ Test successful - checks-actions |
Tested on commit rust-lang/rust@3227e35. Direct link to PR: <rust-lang/rust#87248> 💔 miri on windows: test-pass → build-fail (cc @eddyb @RalfJung @oli-obk). 💔 miri on linux: test-pass → build-fail (cc @eddyb @RalfJung @oli-obk).
adjust for ERR_ON_PARTIAL_PTR_OVERWRITE The Miri side of rust-lang/rust#87248
Currently, during CTFE, when a write to memory would overwrite parts of a pointer, we make the remaining parts of that pointer "uninitialized". This is probably not what users expect, so if this ever happens they will be quite confused about why some of the data just vanishes for seemingly no good reason.
So I propose we change this to abort CTFE when that happens, to at last avoid silently doing the wrong thing.
Cc #87184
Our CTFE test suite still seems to pass. However, we should probably crater this, and I want to do some tests with Miri as well.