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

update Miri #113151

Merged
merged 64 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
13c20f2
deref shim arguments with actual ty instead of declared ty
beepster4096 Nov 9, 2022
9d1d651
add deref_pointer_as
beepster4096 Jun 2, 2023
7380a4d
explain windows sync layouts
beepster4096 Jun 3, 2023
580e2b3
Select more TB fail tests
Vanille-N May 10, 2023
9667886
Auto merge of #2887 - Vanille-N:tb-mut-transmute, r=RalfJung
bors Jun 3, 2023
7444a50
use as_os_str_bytes
RalfJung Jun 3, 2023
c1a7783
Auto merge of #2915 - RalfJung:as_os_str_bytes, r=RalfJung
bors Jun 3, 2023
53187d7
Remove rustc-workspace-hack
ehuss Jun 4, 2023
5d01a6b
Auto merge of #2916 - ehuss:remove-workspace-hack, r=RalfJung
bors Jun 4, 2023
7a1cdf7
Differentiate between explicit accesses and accesses inserted by TB
Vanille-N Jun 5, 2023
98c5fce
Auto merge of #2918 - Vanille-N:tb-diags, r=RalfJung
bors Jun 5, 2023
c87f6d9
Revert error in doc comment
Vanille-N Jun 5, 2023
634c21f
Auto merge of #2919 - Vanille-N:tb-diags, r=RalfJung
bors Jun 5, 2023
be5f6b2
box_exclusive_violation
Vanille-N Jun 10, 2023
85533a3
Auto merge of #2922 - Vanille-N:tb-tests, r=RalfJung
bors Jun 11, 2023
6147833
Preparing for merge from rustc
RalfJung Jun 11, 2023
6ab7af4
Merge from rustc
RalfJung Jun 11, 2023
15a6362
Auto merge of #2924 - RalfJung:rustup, r=RalfJung
bors Jun 12, 2023
36e0c42
Preparing for merge from rustc
oli-obk Jun 15, 2023
24595f5
Merge from rustc
oli-obk Jun 15, 2023
52036f5
Auto merge of #2928 - oli-obk:rustup, r=oli-obk
bors Jun 15, 2023
b4b7cd6
Auto merge of #2661 - DrMeepster:deref_operand_as, r=oli-obk
bors Jun 15, 2023
8e930fd
Preparing for merge from rustc
RalfJung Jun 16, 2023
508675b
Merge from rustc
RalfJung Jun 16, 2023
c853744
Auto merge of #2930 - RalfJung:rustup, r=RalfJung
bors Jun 16, 2023
e2d2266
add tests for panicky drop in thread_local destructor
RalfJung Jun 16, 2023
f3b52fd
make test work cross-platform
RalfJung Jun 16, 2023
6f771c8
Auto merge of #2929 - RalfJung:tls-panic, r=RalfJung
bors Jun 16, 2023
5c9ad8b
comment tweaks
RalfJung Jun 16, 2023
20a2a24
Auto merge of #2932 - RalfJung:comment, r=RalfJung
bors Jun 16, 2023
dfd5037
Preparing for merge from rustc
RalfJung Jun 17, 2023
14155e9
Merge from rustc
RalfJung Jun 17, 2023
5f81d83
Auto merge of #2933 - RalfJung:rustup, r=RalfJung
bors Jun 17, 2023
e696299
Preparing for merge from rustc
RalfJung Jun 18, 2023
7cef286
Merge from rustc
RalfJung Jun 18, 2023
6ea5035
bless new tests
RalfJung Jun 19, 2023
f769045
Auto merge of #2935 - RalfJung:rustup, r=RalfJung
bors Jun 19, 2023
a004056
mmap/munmap/mremamp shims
saethlin Aug 13, 2022
69dc735
Make munmap throw unsup errors instead of trying to work
saethlin Jun 16, 2023
8fc8f13
Improve organization
saethlin Jun 17, 2023
b621c4d
Auto merge of #2520 - saethlin:mmap-shim, r=RalfJung
bors Jun 20, 2023
2bd9ade
Preparing for merge from rustc
RalfJung Jun 22, 2023
940cd59
Merge from rustc
RalfJung Jun 22, 2023
878c6ae
Auto merge of #2938 - RalfJung:rustup, r=RalfJung
bors Jun 22, 2023
65d60f9
drop perform_read_access (always read) in favor of zero_size
Vanille-N Jun 19, 2023
732f127
Update ui test crate
oli-obk Jun 26, 2023
3917774
Auto merge of #2941 - oli-obk:ui_test_bump, r=oli-obk
bors Jun 26, 2023
0ba4cdb
Make `--quiet` actually do something
oli-obk Jun 27, 2023
b567773
Auto merge of #2942 - oli-obk:ui_test_bump, r=RalfJung
bors Jun 27, 2023
c91fb78
Add trophy
cbeuw Jun 27, 2023
662388e
Auto merge of #2943 - cbeuw:patch-1, r=oli-obk
bors Jun 27, 2023
48294e4
Preparing for merge from rustc
oli-obk Jun 28, 2023
c10656e
Merge from rustc
oli-obk Jun 28, 2023
de9dc59
fmt
oli-obk Jun 28, 2023
984d29d
Auto merge of #2944 - oli-obk:rustup, r=oli-obk
bors Jun 28, 2023
e1b2951
Try running a sync automatically
oli-obk Jun 28, 2023
1ffe627
Auto merge of #2945 - oli-obk:gha_mk_pr, r=RalfJung
bors Jun 28, 2023
0671f14
Unique gets special treatment when -Zmiri-unique-is-unique
Vanille-N Jun 19, 2023
cec5ec4
Auto merge of #2936 - Vanille-N:unique, r=RalfJung
bors Jun 28, 2023
8d4b2bd
Preparing for merge from rustc
RalfJung Jun 29, 2023
cca0c81
Merge from rustc
RalfJung Jun 29, 2023
feed376
Auto merge of #2946 - RalfJung:rustup, r=RalfJung
bors Jun 29, 2023
a3cea7f
update lockfile
RalfJung Jun 29, 2023
78f58f9
Use a valid `target` directory in miri ui tests
oli-obk Jun 29, 2023
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
12 changes: 2 additions & 10 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ dependencies = [
"cargo_metadata",
"directories",
"rustc-build-sysroot",
"rustc-workspace-hack",
"rustc_tools_util",
"rustc_version",
"serde",
Expand Down Expand Up @@ -2191,7 +2190,6 @@ dependencies = [
"measureme",
"rand",
"regex",
"rustc-workspace-hack",
"rustc_version",
"smallvec",
"ui_test",
Expand Down Expand Up @@ -2920,12 +2918,6 @@ dependencies = [
"std",
]

[[package]]
name = "rustc-workspace-hack"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb"

[[package]]
name = "rustc_abi"
version = "0.0.0"
Expand Down Expand Up @@ -5096,9 +5088,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"

[[package]]
name = "ui_test"
version = "0.10.0"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "191a442639ea102fa62671026047e51d574bfda44b7fdf32151d7314624c1cd2"
checksum = "24a2e70adc9d18b9b4dd80ea57aeec447103c6fbb354a07c080adad451c645e1"
dependencies = [
"bstr",
"cargo-platform",
Expand Down
26 changes: 25 additions & 1 deletion src/tools/miri/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ jobs:
- name: mark the job as a failure
run: exit 1

# Send a Zulip notification when a cron job fails
cron-fail-notify:
name: cronjob failure notification
runs-on: ubuntu-latest
needs: [build, style]
if: github.event_name == 'schedule' && (failure() || cancelled())
steps:
# Send a Zulip notification
- name: Install zulip-send
run: pip3 install zulip
- name: Send Zulip notification
Expand All @@ -185,3 +185,27 @@ jobs:
Sincerely,
The Miri Cronjobs Bot' \
--user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com
# Attempt to auto-sync with rustc
- name: install josh-proxy
run: cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r22.12.06
- name: start josh-proxy
run: josh-proxy --local=$HOME/.cache/josh --remote=https://github.com --no-background &
- name: setup bot git name and email
run: |
git config --global user.name 'The Miri Conjob Bot'
git config --global user.email 'miri@cron.bot'
- name: get changes from rustc
run: ./miri rustc-pull
- name: format changes (if any)
run: |
./miri toolchain
./miri fmt --check || (./miri fmt && git commit -am "fmt")
- name: Push changes to a branch
run: |
git switch -c "rustup$(date -u +%Y-%m)"
git push
- name: Create Pull Request
run: gh pr create -B master --title 'Automatic sync from rustc' --body ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

11 changes: 2 additions & 9 deletions src/tools/miri/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ dependencies = [
"measureme",
"rand",
"regex",
"rustc-workspace-hack",
"rustc_version",
"smallvec",
"ui_test",
Expand Down Expand Up @@ -628,12 +627,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustc-workspace-hack"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb"

[[package]]
name = "rustc_version"
version = "0.4.0"
Expand Down Expand Up @@ -849,9 +842,9 @@ dependencies = [

[[package]]
name = "ui_test"
version = "0.10.0"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "191a442639ea102fa62671026047e51d574bfda44b7fdf32151d7314624c1cd2"
checksum = "24a2e70adc9d18b9b4dd80ea57aeec447103c6fbb354a07c080adad451c645e1"
dependencies = [
"bstr",
"cargo-platform",
Expand Down
6 changes: 1 addition & 5 deletions src/tools/miri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ log = "0.4"
rand = "0.8"
smallvec = "1.7"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
# for more information.
rustc-workspace-hack = "1.0.0"
measureme = "10.0.0"
ctrlc = "3.2.5"

Expand All @@ -40,7 +36,7 @@ libloading = "0.7"

[dev-dependencies]
colored = "2"
ui_test = "0.10"
ui_test = "0.11.6"
rustc_version = "0.4"
# Features chosen to match those required by env_logger, to avoid rebuilds
regex = { version = "1.5.5", default-features = false, features = ["perf", "std"] }
Expand Down
4 changes: 4 additions & 0 deletions src/tools/miri/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ to Miri failing to detect cases of undefined behavior in a program.
so with this flag.
* `-Zmiri-force-page-size=<num>` overrides the default page size for an architecture, in multiples of 1k.
`4` is default for most targets. This value should always be a power of 2 and nonzero.
* `-Zmiri-unique-is-unique` performs additional aliasing checks for `core::ptr::Unique` to ensure
that it could theoretically be considered `noalias`. This flag is experimental and has
an effect only when used with `-Zmiri-tree-borrows`.

[function ABI]: https://doc.rust-lang.org/reference/items/functions.html#extern-function-qualifier

Expand Down Expand Up @@ -575,6 +578,7 @@ Definite bugs found:
* [`crossbeam-epoch` calling `assume_init` on a partly-initialized `MaybeUninit`](https://github.com/crossbeam-rs/crossbeam/pull/779)
* [`integer-encoding` dereferencing a misaligned pointer](https://github.com/dermesser/integer-encoding-rs/pull/23)
* [`rkyv` constructing a `Box<[u8]>` from an overaligned allocation](https://github.com/rkyv/rkyv/commit/a9417193a34757e12e24263178be8b2eebb72456)
* [Data race in `arc-swap`](https://github.com/vorner/arc-swap/issues/76)
* [Data race in `thread::scope`](https://github.com/rust-lang/rust/issues/98498)
* [`regex` incorrectly handling unaligned `Vec<u8>` buffers](https://www.reddit.com/r/rust/comments/vq3mmu/comment/ienc7t0?context=3)
* [Incorrect use of `compare_exchange_weak` in `once_cell`](https://github.com/matklad/once_cell/issues/186)
Expand Down
7 changes: 0 additions & 7 deletions src/tools/miri/cargo-miri/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ dependencies = [
"cargo_metadata",
"directories",
"rustc-build-sysroot",
"rustc-workspace-hack",
"rustc_tools_util",
"rustc_version",
"serde",
Expand Down Expand Up @@ -235,12 +234,6 @@ dependencies = [
"tempfile",
]

[[package]]
name = "rustc-workspace-hack"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb"

[[package]]
name = "rustc_tools_util"
version = "0.3.0"
Expand Down
5 changes: 0 additions & 5 deletions src/tools/miri/cargo-miri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ serde_json = "1.0.40"
cargo_metadata = "0.15.0"
rustc-build-sysroot = "0.4.1"

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
# for more information.
rustc-workspace-hack = "1.0.0"

# Enable some feature flags that dev-dependencies need but dependencies
# do not. This makes `./miri install` after `./miri build` faster.
serde = { version = "*", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
33c3d101280c8eb3cd8af421bfb56a8afcc3881d
75726cae37317c7262b69d3e9fd11a3496a88d04
14 changes: 12 additions & 2 deletions src/tools/miri/src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ use rustc_middle::{
query::{ExternProviders, LocalCrate},
ty::TyCtxt,
};
use rustc_session::{EarlyErrorHandler, CtfeBacktrace};
use rustc_session::config::{OptLevel, CrateType, ErrorOutputType};
use rustc_session::config::{CrateType, ErrorOutputType, OptLevel};
use rustc_session::search_paths::PathKind;
use rustc_session::{CtfeBacktrace, EarlyErrorHandler};

use miri::{BacktraceStyle, BorrowTrackerMethod, ProvenanceMode, RetagFields};

Expand Down Expand Up @@ -343,6 +343,8 @@ fn main() {
miri_config.borrow_tracker = None;
} else if arg == "-Zmiri-tree-borrows" {
miri_config.borrow_tracker = Some(BorrowTrackerMethod::TreeBorrows);
} else if arg == "-Zmiri-unique-is-unique" {
miri_config.unique_is_unique = true;
} else if arg == "-Zmiri-disable-data-race-detector" {
miri_config.data_race_detector = false;
miri_config.weak_memory_emulation = false;
Expand Down Expand Up @@ -560,6 +562,14 @@ fn main() {
rustc_args.push(arg);
}
}
// `-Zmiri-unique-is-unique` should only be used with `-Zmiri-tree-borrows`
if miri_config.unique_is_unique
&& !matches!(miri_config.borrow_tracker, Some(BorrowTrackerMethod::TreeBorrows))
{
show_error!(
"-Zmiri-unique-is-unique only has an effect when -Zmiri-tree-borrows is also used"
);
}

debug!("rustc arguments: {:?}", rustc_args);
debug!("crate arguments: {:?}", miri_config.args);
Expand Down
5 changes: 5 additions & 0 deletions src/tools/miri/src/borrow_tracker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ pub struct GlobalStateInner {
pub tracked_call_ids: FxHashSet<CallId>,
/// Whether to recurse into datatypes when searching for pointers to retag.
pub retag_fields: RetagFields,
/// Whether `core::ptr::Unique` gets special (`Box`-like) handling.
pub unique_is_unique: bool,
}

impl VisitTags for GlobalStateInner {
Expand Down Expand Up @@ -170,6 +172,7 @@ impl GlobalStateInner {
tracked_pointer_tags: FxHashSet<BorTag>,
tracked_call_ids: FxHashSet<CallId>,
retag_fields: RetagFields,
unique_is_unique: bool,
) -> Self {
GlobalStateInner {
borrow_tracker_method,
Expand All @@ -180,6 +183,7 @@ impl GlobalStateInner {
tracked_pointer_tags,
tracked_call_ids,
retag_fields,
unique_is_unique,
}
}

Expand Down Expand Up @@ -244,6 +248,7 @@ impl BorrowTrackerMethod {
config.tracked_pointer_tags.clone(),
config.tracked_call_ids.clone(),
config.retag_fields,
config.unique_is_unique,
))
}
}
Expand Down
Loading