-
Notifications
You must be signed in to change notification settings - Fork 343
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
Adjust Allocation Bytes used by Miri to custom MiriAllocBytes #3526
Conversation
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.
Thanks, this is a good start!
This comment was marked as outdated.
This comment was marked as outdated.
Preparing for merge from rustc Unblocks #3526.
If you rebase over the latest Miri master, you should get the updated rustc that includes your PR, so that this one can finally build. :) |
Preparing for merge from rustc Unblocks rust-lang/miri#3526.
Preparing for merge from rustc Unblocks rust-lang/miri#3526.
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
Looks good, thanks! Please squash this into a single commit. |
attempt changing Bytes in MiriMachine to MiriAllocBytes rename miri_alloc_bytes to alloc_bytes generalize impl VisitProvenance for Allocation for any Bytes: AllocBytes mend MiriAllocBytes -> Self::Bytes fix Invariant documentation and bugs (drop), impl Clone Update MiriAllocBytes description Co-authored-by: Ralf Jung <post@ralfj.de> Rephrase MiriAllocBytes ptr invariant Co-authored-by: Ralf Jung <post@ralfj.de> Update MiriAllocBytes ptr documentation Co-authored-by: Ralf Jung <post@ralfj.de> fix safety comment in MiriAllocBytes::clone fix safety comment in MiriAllocBytes::from_bytes try implementing clone without unsafe remove derive(PartialEq,Eq,Hash), fix fmt move ptr.is_null() check inside only necessary branch use std::ptr::without_provenance_mut, requiring feature(strict_provenance) align.bytes_usize() instead of align.bytes().try_into().unwrap() Update src/provenance_gc.rs Co-authored-by: Ralf Jung <post@ralfj.de> fix clippy error on deref
Thanks! Force-pushes do not always trigger a notification on github, so you have to let the reviewer know that the PR is ready again. In Rust we have the @bors r+ |
☀️ Test successful - checks-actions |
Bugfix `MiriAllocBytes` to guarantee different addresses Fix in `alloc_bytes.rs` following #3526 Currently when an allocation of `size == 0` is requested we return a `std::ptr::without_provenance_mut(align)`, but this means returned `ptr`s may overlap, which breaks things.
Bugfix `MiriAllocBytes` to guarantee different addresses Fix in `alloc_bytes.rs` following rust-lang/miri#3526 Currently when an allocation of `size == 0` is requested we return a `std::ptr::without_provenance_mut(align)`, but this means returned `ptr`s may overlap, which breaks things.
Bugfix `MiriAllocBytes` to guarantee different addresses Fix in `alloc_bytes.rs` following rust-lang/miri#3526 Currently when an allocation of `size == 0` is requested we return a `std::ptr::without_provenance_mut(align)`, but this means returned `ptr`s may overlap, which breaks things.
Previously, the
MiriMachine
usedtype Bytes = Box<[u8]>
for its allocations.This PR swaps this out for a custom
MiriAllocBytes
type implemented inalloc_bytes.rs
.This is in anticipation of an extension to Miri's FFI, which will require its allocations to take care of alignment (the methods in
impl AllocBytes for Box<[u8]>
ignore this_align: Align
argument).Needs rust-lang/rust#124492