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

Miri subtree update #125286

Merged
merged 45 commits into from
May 19, 2024
Merged

Miri subtree update #125286

merged 45 commits into from
May 19, 2024

Conversation

RalfJung
Copy link
Member

r? @ghost

bend-n and others added 30 commits May 11, 2024 17:13
Use non-null pointer for size 0 posix memalign

Fixes rust-lang#3576
Don't print unnecessary sysroot messages

Currently, when running `cargo miri setup`, we always print that a sysroot is being prepared, even if we just bail out of building after checking the hash. So that message is wrong; we didn't actually prepare a sysroot.

We also always print the preparing message for `cargo miri run`, even if no sysroot is prepared.

With this PR, `cargo miri run` prints no sysroot messages when an existing one is reused, and when a redundant `cargo miri setup` is requested, we print:
```
A sysroot for Miri is already available in `/home/ben/.cache/miri`.
```
fixing part of `miri test alloc/hashmap`.
intrinsics: just panic when they get used incorrectly

This is already what we do most of the time, so do it consistently.
Rustup, aligned heap-allocations on wasm

Pulls in rust-lang#125003 so allocation tests should now work on wasm.
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
Adjust Allocation Bytes used by Miri to custom MiriAllocBytes

Previously, the `MiriMachine` used `type Bytes = Box<[u8]>` for its allocations.
This PR swaps this out for a custom `MiriAllocBytes` type implemented in `alloc_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#124492
Give `FileDescription::{read, write}` access to the `MiriInterpCx `

fixes rust-lang#3572
Ignore the Helix configuration directory

For us Helix users.
bors and others added 15 commits May 19, 2024 08:42
properly print error in 'cargo miri setup --print-sysroot'

Based on rustc-build-sysroot now putting the stderr into the error message.
test wasm32-wasip2 instead of the deprecated wasm32-wasi target
use a little arg-parsing helper for miri-script
Windows still needs the old custom ABI as SEH unwinding isn't supported
by miri. Unlike DWARF unwinding it preserves all stack frames until
right after the do_catch function has executed. Because of this
panic_unwind stack allocates the exception object. Miri can't currently
model unwinding without destroying stack frames and as such will report
a use-after-free of the exception object.
- share implementation with miri_starting_unwind
- make test use a custom unwinding class
- extend comments
- use NeedsUnwind more consistently
Directly implement native exception raise methods in miri

This implements the `_Unwind_RaiseException` function used on pretty much every unix system for starting unwinding. This allows removing the miri special case from libpanic_unwind for unix.

Windows still needs `miri_start_unwind` as SEH unwinding isn't supported by miri. Unlike DWARF unwinding, SEH preserves all stack frames until right after the do_catch function has executed. Because of this panic_unwind stack allocates the exception object. Miri can't currently model unwinding without destroying stack frames and as such will report a use-after-free of the exception object.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 19, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 19, 2024

The Miri subtree was changed

cc @rust-lang/miri

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@RalfJung
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented May 19, 2024

📌 Commit e93268e has been approved by RalfJung

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 19, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 19, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#124948 (chore: Remove repeated words (extension of rust-lang#124924))
 - rust-lang#124992 (Add example to IsTerminal::is_terminal)
 - rust-lang#125279 (make `Debug` impl for `Term` simpler)
 - rust-lang#125286 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7a45322 into rust-lang:master May 19, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 19, 2024
Rollup merge of rust-lang#125286 - RalfJung:miri-sync, r=RalfJung

Miri subtree update

r? `@ghost`
@rustbot rustbot added this to the 1.80.0 milestone May 19, 2024
@RalfJung RalfJung deleted the miri-sync branch May 21, 2024 05:57
bors added a commit to rust-lang-ci/rust that referenced this pull request May 30, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#124948 (chore: Remove repeated words (extension of rust-lang#124924))
 - rust-lang#124992 (Add example to IsTerminal::is_terminal)
 - rust-lang#125279 (make `Debug` impl for `Term` simpler)
 - rust-lang#125286 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet