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 #122952

Merged
merged 30 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
96674fc
Preparing for merge from rustc
Mar 17, 2024
0dff16a
Merge from rustc
Mar 17, 2024
caa57dd
Auto merge of #3384 - rust-lang:rustup-2024-03-17, r=RalfJung
bors Mar 17, 2024
b4cb2ee
fix Zulip topic for PR-creation message
RalfJung Mar 17, 2024
dd5b4f5
Auto merge of #3386 - RalfJung:ci, r=RalfJung
bors Mar 17, 2024
a6f362f
make 'invalidate' benchmark shorter
RalfJung Mar 17, 2024
c99c314
add exposed-provenance example where we miss UB
RalfJung Mar 18, 2024
d7864d2
Auto merge of #3388 - RalfJung:exposed, r=RalfJung
bors Mar 18, 2024
311024c
rename 'invalidate' bench to something more clear
RalfJung Mar 18, 2024
b648a9a
Auto merge of #3387 - RalfJung:bench, r=RalfJung
bors Mar 18, 2024
74b68af
Preparing for merge from rustc
Mar 19, 2024
be6c170
Merge from rustc
Mar 19, 2024
bca5e2c
Auto merge of #3390 - rust-lang:rustup-2024-03-19, r=oli-obk
bors Mar 19, 2024
92a841d
remove duplicate test
RalfJung Mar 19, 2024
67966f3
Auto merge of #3391 - RalfJung:dedup, r=RalfJung
bors Mar 19, 2024
e539804
run full mono-item collection on all MIRI_BE_RUSTC=target builds
RalfJung Mar 19, 2024
6bcd9bc
Auto merge of #3392 - RalfJung:post-mono, r=oli-obk
bors Mar 20, 2024
89bc81f
Allow `llvm.x86.sse2.pause` instrinsic to be called without SSE2
eduardosm Mar 21, 2024
f61f45f
Auto merge of #3393 - eduardosm:x86-pause-without-sse2, r=RalfJung
bors Mar 21, 2024
5719d09
Preparing for merge from rustc
RalfJung Mar 22, 2024
ee57d2b
Merge from rustc
RalfJung Mar 22, 2024
2fae357
Auto merge of #3394 - RalfJung:rustup, r=RalfJung
bors Mar 22, 2024
0115f73
Preparing for merge from rustc
Mar 23, 2024
89b9b67
Merge from rustc
Mar 23, 2024
5039f8b
fmt
Mar 23, 2024
f0d864f
Auto merge of #3395 - rust-lang:rustup-2024-03-23, r=saethlin
bors Mar 23, 2024
c87ec61
add support for missing SIMD float intrinsics
RalfJung Mar 23, 2024
e19cc5e
Auto merge of #3396 - RalfJung:simd-float, r=RalfJung
bors Mar 23, 2024
2d610f7
Report retags as distinct from real memory accesses for data races
Zoxc Mar 17, 2024
59b2945
Auto merge of #3385 - Zoxc:read-types, r=RalfJung
bors Mar 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/miri/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
run: |
PR=$(gh pr create -B master --title 'Automatic Rustup' --body '')
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
--stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
--stream miri --subject "Miri Build Failure ($(date -u +%Y-%m))" \
--message "A PR doing a rustc-pull [has been automatically created]($PR) for your convenience."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
version = 3

[[package]]
name = "invalidate"
name = "range-iteration"
version = "0.1.0"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "invalidate"
name = "range-iteration"
version = "0.1.0"
edition = "2021"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! This generates a lot of work for the AllocId part of the GC.
fn main() {
// The end of the range is just chosen to make the benchmark run for a few seconds.
for _ in 0..200_000 {}
for _ in 0..50_000 {}
}
2 changes: 1 addition & 1 deletion src/tools/miri/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ee03c286cfdca26fa5b2a4ee40957625d2c826ff
c3b05c6e5b5b59613350b8c2875b0add67ed74df
20 changes: 20 additions & 0 deletions src/tools/miri/src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,26 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
});
}
}

fn after_analysis<'tcx>(
&mut self,
_: &rustc_interface::interface::Compiler,
queries: &'tcx rustc_interface::Queries<'tcx>,
) -> Compilation {
queries.global_ctxt().unwrap().enter(|tcx| {
if self.target_crate {
// cargo-miri has patched the compiler flags to make these into check-only builds,
// but we are still emulating regular rustc builds, which would perform post-mono
// const-eval during collection. So let's also do that here, even if we might be
// running with `--emit=metadata`. In particular this is needed to make
// `compile_fail` doc tests trigger post-mono errors.
// In general `collect_and_partition_mono_items` is not safe to call in check-only
// builds, but we are setting `-Zalways-encode-mir` which avoids those issues.
let _ = tcx.collect_and_partition_mono_items(());
}
});
Compilation::Continue
}
}

fn show_error(msg: &impl std::fmt::Display) -> ! {
Expand Down
17 changes: 15 additions & 2 deletions src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::borrow_tracker::{
stacked_borrows::diagnostics::{AllocHistory, DiagnosticCx, DiagnosticCxBuilder},
GlobalStateInner, ProtectorKind,
};
use crate::concurrency::data_race::{NaReadType, NaWriteType};
use crate::*;

use diagnostics::{RetagCause, RetagInfo};
Expand Down Expand Up @@ -751,7 +752,13 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
assert_eq!(access, AccessKind::Write);
// Make sure the data race model also knows about this.
if let Some(data_race) = alloc_extra.data_race.as_mut() {
data_race.write(alloc_id, range, machine)?;
data_race.write(
alloc_id,
range,
NaWriteType::Retag,
Some(place.layout.ty),
machine,
)?;
}
}
}
Expand Down Expand Up @@ -794,7 +801,13 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
assert_eq!(access, AccessKind::Read);
// Make sure the data race model also knows about this.
if let Some(data_race) = alloc_extra.data_race.as_ref() {
data_race.read(alloc_id, range, &this.machine)?;
data_race.read(
alloc_id,
range,
NaReadType::Retag,
Some(place.layout.ty),
&this.machine,
)?;
}
}
Ok(())
Expand Down
13 changes: 11 additions & 2 deletions src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ use rustc_middle::{
use rustc_span::def_id::DefId;
use rustc_target::abi::{Abi, Size};

use crate::borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind};
use crate::*;
use crate::{
borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind},
concurrency::data_race::NaReadType,
};

pub mod diagnostics;
mod perms;
Expand Down Expand Up @@ -312,7 +315,13 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
// Also inform the data race model (but only if any bytes are actually affected).
if range.size.bytes() > 0 {
if let Some(data_race) = alloc_extra.data_race.as_ref() {
data_race.read(alloc_id, range, &this.machine)?;
data_race.read(
alloc_id,
range,
NaReadType::Retag,
Some(place.layout.ty),
&this.machine,
)?;
}
}

Expand Down
Loading
Loading