Skip to content

Commit 37b677a

Browse files
authored
Merge pull request #4303 from RalfJung/determinism
add -Zmiri-deterministic-concurrency flag and use it for concurrency tests
2 parents 26d3a02 + 6217a13 commit 37b677a

File tree

75 files changed

+129
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+129
-156
lines changed

README.md

+33-19
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,15 @@ Try running `cargo miri clean`.
277277
Miri adds its own set of `-Z` flags, which are usually set via the `MIRIFLAGS`
278278
environment variable. We first document the most relevant and most commonly used flags:
279279

280-
* `-Zmiri-address-reuse-rate=<rate>` changes the probability that a freed *non-stack* allocation
281-
will be added to the pool for address reuse, and the probability that a new *non-stack* allocation
282-
will be taken from the pool. Stack allocations never get added to or taken from the pool. The
283-
default is `0.5`.
284-
* `-Zmiri-address-reuse-cross-thread-rate=<rate>` changes the probability that an allocation which
285-
attempts to reuse a previously freed block of memory will also consider blocks freed by *other
286-
threads*. The default is `0.1`, which means by default, in 90% of the cases where an address reuse
287-
attempt is made, only addresses from the same thread will be considered. Reusing an address from
288-
another thread induces synchronization between those threads, which can mask data races and weak
289-
memory bugs.
290-
* `-Zmiri-compare-exchange-weak-failure-rate=<rate>` changes the failure rate of
291-
`compare_exchange_weak` operations. The default is `0.8` (so 4 out of 5 weak ops will fail).
292-
You can change it to any value between `0.0` and `1.0`, where `1.0` means it
293-
will always fail and `0.0` means it will never fail. Note that setting it to
294-
`1.0` will likely cause hangs, since it means programs using
295-
`compare_exchange_weak` cannot make progress.
280+
* `-Zmiri-deterministic-concurrency` makes Miri's concurrency-related behavior fully deterministic.
281+
Strictly speaking, Miri is always fully deterministic when isolation is enabled (the default
282+
mode), but this determinism is achieved by using an RNG with a fixed seed. Seemingly harmless
283+
changes to the program, or just running it for a different target architecture, can thus lead to
284+
completely different program behavior down the line. This flag disables the use of an RNG for
285+
concurrency-related decisions. Therefore, Miri cannot find bugs that only occur under some
286+
specific circumstances, but Miri's behavior will also be more stable across versions and targets.
287+
This is equivalent to `-Zmiri-fixed-schedule -Zmiri-compare-exchange-weak-failure-rate=0.0
288+
-Zmiri-address-reuse-cross-thread-rate=0.0 -Zmiri-disable-weak-memory-emulation`.
296289
* `-Zmiri-disable-isolation` disables host isolation. As a consequence,
297290
the program has access to host resources such as environment variables, file
298291
systems, and randomness.
@@ -334,9 +327,6 @@ environment variable. We first document the most relevant and most commonly used
334327
This will necessarily miss some bugs as those operations are not efficiently and accurately
335328
implementable in a sanitizer, but it will only miss bugs that concern memory/pointers which is
336329
subject to these operations.
337-
* `-Zmiri-preemption-rate` configures the probability that at the end of a basic block, the active
338-
thread will be preempted. The default is `0.01` (i.e., 1%). Setting this to `0` disables
339-
preemption.
340330
* `-Zmiri-report-progress` makes Miri print the current stacktrace every now and then, so you can
341331
tell what it is doing when a program just keeps running. You can customize how frequently the
342332
report is printed via `-Zmiri-report-progress=<blocks>`, which prints the report every N basic
@@ -365,6 +355,22 @@ The remaining flags are for advanced use only, and more likely to change or be r
365355
Some of these are **unsound**, which means they can lead
366356
to Miri failing to detect cases of undefined behavior in a program.
367357

358+
* `-Zmiri-address-reuse-rate=<rate>` changes the probability that a freed *non-stack* allocation
359+
will be added to the pool for address reuse, and the probability that a new *non-stack* allocation
360+
will be taken from the pool. Stack allocations never get added to or taken from the pool. The
361+
default is `0.5`.
362+
* `-Zmiri-address-reuse-cross-thread-rate=<rate>` changes the probability that an allocation which
363+
attempts to reuse a previously freed block of memory will also consider blocks freed by *other
364+
threads*. The default is `0.1`, which means by default, in 90% of the cases where an address reuse
365+
attempt is made, only addresses from the same thread will be considered. Reusing an address from
366+
another thread induces synchronization between those threads, which can mask data races and weak
367+
memory bugs.
368+
* `-Zmiri-compare-exchange-weak-failure-rate=<rate>` changes the failure rate of
369+
`compare_exchange_weak` operations. The default is `0.8` (so 4 out of 5 weak ops will fail).
370+
You can change it to any value between `0.0` and `1.0`, where `1.0` means it
371+
will always fail and `0.0` means it will never fail. Note that setting it to
372+
`1.0` will likely cause hangs, since it means programs using
373+
`compare_exchange_weak` cannot make progress.
368374
* `-Zmiri-disable-alignment-check` disables checking pointer alignment, so you
369375
can focus on other failures, but it means Miri can miss bugs in your program.
370376
Using this flag is **unsound**.
@@ -383,6 +389,10 @@ to Miri failing to detect cases of undefined behavior in a program.
383389
this flag is **unsound**.
384390
* `-Zmiri-disable-weak-memory-emulation` disables the emulation of some C++11 weak
385391
memory effects.
392+
* `-Zmiri-fixed-schedule` disables preemption (like `-Zmiri-preemption-rate=0.0`) and furthermore
393+
disables the randomization of the next thread to be picked, instead fixing a round-robin schedule.
394+
Note however that other aspects of Miri's concurrency behavior are still randomize; use
395+
`-Zmiri-deterministic-concurrency` to disable them all.
386396
* `-Zmiri-native-lib=<path to a shared object file>` is an experimental flag for providing support
387397
for calling native functions from inside the interpreter via FFI. The flag is supported only on
388398
Unix systems. Functions not provided by that file are still executed via the usual Miri shims.
@@ -412,6 +422,10 @@ to Miri failing to detect cases of undefined behavior in a program.
412422
without an explicit value), `none` means it never recurses, `scalar` means it only recurses for
413423
types where we would also emit `noalias` annotations in the generated LLVM IR (types passed as
414424
individual scalars or pairs of scalars). Setting this to `none` is **unsound**.
425+
* `-Zmiri-preemption-rate` configures the probability that at the end of a basic block, the active
426+
thread will be preempted. The default is `0.01` (i.e., 1%). Setting this to `0` disables
427+
preemption. Note that even without preemption, the schedule is still non-deterministic:
428+
if a thread blocks or yields, the next thread is chosen randomly.
415429
* `-Zmiri-provenance-gc=<blocks>` configures how often the pointer provenance garbage collector runs.
416430
The default is to search for and remove unreachable provenance once every `10000` basic blocks. Setting
417431
this to `0` disables the garbage collector, which causes some programs to have explosive memory

src/bin/miri.rs

+5
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,11 @@ fn main() {
575575
miri_config.retag_fields = RetagFields::Yes;
576576
} else if arg == "-Zmiri-fixed-schedule" {
577577
miri_config.fixed_scheduling = true;
578+
} else if arg == "-Zmiri-deterministic-concurrency" {
579+
miri_config.fixed_scheduling = true;
580+
miri_config.address_reuse_cross_thread_rate = 0.0;
581+
miri_config.cmpxchg_weak_failure_rate = 0.0;
582+
miri_config.weak_memory_emulation = false;
578583
} else if let Some(retag_fields) = arg.strip_prefix("-Zmiri-retag-fields=") {
579584
miri_config.retag_fields = match retag_fields {
580585
"all" => RetagFields::Yes,

tests/fail-dep/concurrency/libc_pthread_join_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ignore-target: windows # No pthreads on Windows
22
// We are making scheduler assumptions here.
3-
//@compile-flags: -Zmiri-fixed-schedule
3+
//@compile-flags: -Zmiri-deterministic-concurrency
44

55
// Joining itself is undefined behavior.
66

tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ignore-target: windows # No pthreads on Windows
22
//@error-in-other-file: deadlock
3+
// We are making scheduler assumptions here.
4+
//@compile-flags: -Zmiri-deterministic-concurrency
35

46
use std::cell::UnsafeCell;
57
use std::sync::Arc;

tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ignore-target: windows # No pthreads on Windows
22
//@error-in-other-file: deadlock
3+
// We are making scheduler assumptions here.
4+
//@compile-flags: -Zmiri-deterministic-concurrency
35

46
use std::cell::UnsafeCell;
57
use std::sync::Arc;

tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ignore-target: windows # No pthreads on Windows
22
//@error-in-other-file: deadlock
3+
// We are making scheduler assumptions here.
4+
//@compile-flags: -Zmiri-deterministic-concurrency
35

46
use std::cell::UnsafeCell;
57
use std::sync::Arc;

tests/fail-dep/concurrency/windows_join_main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@only-target: windows # Uses win32 api functions
22
// We are making scheduler assumptions here.
3-
//@compile-flags: -Zmiri-fixed-schedule
3+
//@compile-flags: -Zmiri-deterministic-concurrency
44
//@error-in-other-file: deadlock
55

66
// On windows, joining main is not UB, but it will block a thread forever.

tests/fail-dep/concurrency/windows_join_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@only-target: windows # Uses win32 api functions
22
// We are making scheduler assumptions here.
3-
//@compile-flags: -Zmiri-fixed-schedule
3+
//@compile-flags: -Zmiri-deterministic-concurrency
44
//@error-in-other-file: deadlock
55

66
// On windows, a thread joining itself is not UB, but it will deadlock.

tests/fail-dep/libc/env-set_var-data-race.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@compile-flags: -Zmiri-disable-isolation -Zmiri-fixed-schedule
1+
//@compile-flags: -Zmiri-disable-isolation -Zmiri-deterministic-concurrency
22
//@ignore-target: windows # No libc env support on Windows
33

44
use std::{env, thread};

tests/fail-dep/libc/eventfd_block_read_twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@only-target: linux android illumos
22
//~^ERROR: deadlocked
33
//~^^ERROR: deadlocked
4-
//@compile-flags: -Zmiri-fixed-schedule
4+
//@compile-flags: -Zmiri-deterministic-concurrency
55
//@error-in-other-file: deadlock
66

77
use std::thread;

tests/fail-dep/libc/eventfd_block_write_twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@only-target: linux android illumos
22
//~^ERROR: deadlocked
33
//~^^ERROR: deadlocked
4-
//@compile-flags: -Zmiri-fixed-schedule
4+
//@compile-flags: -Zmiri-deterministic-concurrency
55
//@error-in-other-file: deadlock
66

77
use std::thread;

tests/fail-dep/libc/libc-epoll-data-race.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! to be considered synchronized.
55
//@only-target: linux android illumos
66
// ensure deterministic schedule
7-
//@compile-flags: -Zmiri-fixed-schedule
7+
//@compile-flags: -Zmiri-deterministic-concurrency
88

99
use std::convert::TryInto;
1010
use std::thread;

tests/fail-dep/libc/libc_epoll_block_two_thread.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@compile-flags: -Zmiri-fixed-schedule
1+
//@compile-flags: -Zmiri-deterministic-concurrency
22
//~^ERROR: deadlocked
33
//~^^ERROR: deadlocked
44
//@only-target: linux android illumos

tests/fail-dep/libc/socketpair-close-while-blocked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! faulty logic around `release_clock` that led to this code not reporting a data race.
33
//~^^ERROR: deadlock
44
//@ignore-target: windows # no libc socketpair on Windows
5-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-address-reuse-rate=0
5+
//@compile-flags: -Zmiri-deterministic-concurrency
66
//@error-in-other-file: deadlock
77
use std::thread;
88

tests/fail-dep/libc/socketpair-data-race.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This is a regression test for <https://github.com/rust-lang/miri/issues/3947>: we had some
22
//! faulty logic around `release_clock` that led to this code not reporting a data race.
33
//@ignore-target: windows # no libc socketpair on Windows
4-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-address-reuse-rate=0
4+
//@compile-flags: -Zmiri-deterministic-concurrency
55
use std::thread;
66

77
fn main() {

tests/fail-dep/libc/socketpair_block_read_twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//~^ERROR: deadlocked
33
//~^^ERROR: deadlocked
44
// test_race depends on a deterministic schedule.
5-
//@compile-flags: -Zmiri-fixed-schedule
5+
//@compile-flags: -Zmiri-deterministic-concurrency
66
//@error-in-other-file: deadlock
77

88
use std::thread;

tests/fail-dep/libc/socketpair_block_write_twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//~^ERROR: deadlocked
33
//~^^ERROR: deadlocked
44
// test_race depends on a deterministic schedule.
5-
//@compile-flags: -Zmiri-fixed-schedule
5+
//@compile-flags: -Zmiri-deterministic-concurrency
66
//@error-in-other-file: deadlock
77

88
use std::thread;

tests/fail/both_borrows/retag_data_race_write.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Make sure that a retag acts like a write for the data race model.
22
//@revisions: stack tree
3-
//@compile-flags: -Zmiri-fixed-schedule
4-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
5-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
3+
//@compile-flags: -Zmiri-deterministic-concurrency
64
//@[tree]compile-flags: -Zmiri-tree-borrows
75
#[derive(Copy, Clone)]
86
struct SendPtr(*mut u8);

tests/fail/data_race/alloc_read_race.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
2-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
3-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
1+
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
43

54
use std::mem::MaybeUninit;
65
use std::ptr::null_mut;

tests/fail/data_race/alloc_write_race.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
2-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
3-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
1+
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
43

54
use std::ptr::null_mut;
65
use std::sync::atomic::{AtomicPtr, Ordering};

tests/fail/data_race/atomic_read_na_write_race1.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::sync::atomic::{AtomicUsize, Ordering};
75
use std::thread::spawn;

tests/fail/data_race/atomic_read_na_write_race2.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::sync::atomic::{AtomicUsize, Ordering};
75
use std::thread::spawn;

tests/fail/data_race/atomic_write_na_read_race1.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::sync::atomic::{AtomicUsize, Ordering};
75
use std::thread::spawn;

tests/fail/data_race/atomic_write_na_read_race2.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::sync::atomic::{AtomicUsize, Ordering};
75
use std::thread::spawn;

tests/fail/data_race/atomic_write_na_write_race1.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::sync::atomic::{AtomicUsize, Ordering};
75
use std::thread::spawn;

tests/fail/data_race/atomic_write_na_write_race2.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::sync::atomic::{AtomicUsize, Ordering};
75
use std::thread::spawn;

tests/fail/data_race/dangling_thread_async_race.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::mem;
75
use std::thread::{sleep, spawn};

tests/fail/data_race/dangling_thread_race.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::mem;
75
use std::thread::{sleep, spawn};

tests/fail/data_race/dealloc_read_race1.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
#![feature(rustc_attrs)]
75

tests/fail/data_race/dealloc_read_race2.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
#![feature(rustc_attrs)]
75

tests/fail/data_race/dealloc_read_race_stack.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
2-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
3-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
1+
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
43

54
use std::ptr::null_mut;
65
use std::sync::atomic::{AtomicPtr, Ordering};

tests/fail/data_race/dealloc_write_race1.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
#![feature(rustc_attrs)]
75

tests/fail/data_race/dealloc_write_race2.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
#![feature(rustc_attrs)]
75

tests/fail/data_race/dealloc_write_race_stack.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@compile-flags: -Zmiri-disable-weak-memory-emulation -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
2-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
3-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
1+
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
43

54
use std::ptr::null_mut;
65
use std::sync::atomic::{AtomicPtr, Ordering};

tests/fail/data_race/enable_after_join_to_main.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// We want to control preemption here. Stacked borrows interferes by having its own accesses.
2-
//@compile-flags: -Zmiri-fixed-schedule -Zmiri-disable-stacked-borrows
3-
// Avoid accidental synchronization via address reuse inside `thread::spawn`.
4-
//@compile-flags: -Zmiri-address-reuse-cross-thread-rate=0
2+
//@compile-flags: -Zmiri-deterministic-concurrency -Zmiri-disable-stacked-borrows
53

64
use std::thread::spawn;
75

0 commit comments

Comments
 (0)