-
Notifications
You must be signed in to change notification settings - Fork 352
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
regression tests for pointer invalidation in core library slice methods #1816
Conversation
Yeah, it is expected that some tests fail. In particular, those that cast integers to pointers cannot work with this flag. That will explain some of the test failures, though possibly not all of them.
Sure, if you want to audit these and make sure they are all due to int-to-ptr casts, that would be great. :) |
Thanks for the PR comments @RalfJung! I will address these.
Sounds good! In case the failures are all due to int-to-ptr casts, would it be helpful if I can rewrite the test cases without casting pointers to integers, while keeping the same functionality? Thanks! p.s. I'm going on a short trip tomorrow, so it may take me until after the weekend to get back with more updates. |
I think (almost) all of these tests are explicitly about testing int-to-ptr casts, so changing them would defeat their purpose. We do want to continue supporting int-to-ptr casts, and there is a reason that
Sure, no worries. |
☔ The latest upstream changes (presumably #1812) made this pull request unmergeable. Please resolve the merge conflicts. |
ce5afab
to
c6dbe5c
Compare
Hi @RalfJung, thank you for your patience while I was away! I have just pushed a new version which resolves the PR comments. I also rebased with the master branch upstream, due to a merge conflict in the |
Looking great, thanks a lot @Pointerbender :) |
📌 Commit e21dae7 has been approved by |
☀️ Test successful - checks-actions |
A fix for a pointer invalidation bug in
<[T]>::copy_within
has landed on the Rust master branch. This PR updates therust-version
file to the latest master commit hash and adds extra tests to the Miri test suite to ensure that regressions of this type of bug can be detected for various slice methods with the-Zmiri-track-raw-pointers
flag.I took the liberty of adding 2 extra
#![feature]
attributes at the top ofslices.rs
, since there already was one unstable feature. I hope this is okay 😄One thing I noticed when running the entire Miri test suite with
MIRIFLAGS="-Zmiri-track-raw-pointers" ./miri test
is that there are currently failing tests on the master branch:These failures were not fixed in this PR and already existed prior to this PR. I haven't investigated these yet, but am interested in helping out if possible!
Thanks!