mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-07 05:15:02 +00:00
Clean up implementation, deduplicate in errors
This commit is contained in:
parent
749b2b077d
commit
c2f459ca74
@ -358,15 +358,9 @@ impl MemoryCellClocks {
|
||||
index: VectorIdx,
|
||||
) -> Result<(), DataRace> {
|
||||
log::trace!("Atomic read with vectors: {:#?} :: {:#?}", self, clocks);
|
||||
if self.write <= clocks.clock[self.write_index] {
|
||||
let atomic = self.atomic_mut();
|
||||
atomic.read_vector.set_at_index(&clocks.clock, index);
|
||||
Ok(())
|
||||
} else {
|
||||
let atomic = self.atomic_mut();
|
||||
atomic.read_vector.set_at_index(&clocks.clock, index);
|
||||
Err(DataRace)
|
||||
}
|
||||
let atomic = self.atomic_mut();
|
||||
atomic.read_vector.set_at_index(&clocks.clock, index);
|
||||
if self.write <= clocks.clock[self.write_index] { Ok(()) } else { Err(DataRace) }
|
||||
}
|
||||
|
||||
/// Detect data-races with an atomic write, either with a non-atomic read or with
|
||||
@ -377,13 +371,11 @@ impl MemoryCellClocks {
|
||||
index: VectorIdx,
|
||||
) -> Result<(), DataRace> {
|
||||
log::trace!("Atomic write with vectors: {:#?} :: {:#?}", self, clocks);
|
||||
let atomic = self.atomic_mut();
|
||||
atomic.write_vector.set_at_index(&clocks.clock, index);
|
||||
if self.write <= clocks.clock[self.write_index] && self.read <= clocks.clock {
|
||||
let atomic = self.atomic_mut();
|
||||
atomic.write_vector.set_at_index(&clocks.clock, index);
|
||||
Ok(())
|
||||
} else {
|
||||
let atomic = self.atomic_mut();
|
||||
atomic.write_vector.set_at_index(&clocks.clock, index);
|
||||
Err(DataRace)
|
||||
}
|
||||
}
|
||||
@ -635,6 +627,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
||||
if let Some(data_race) = &mut this.machine.data_race {
|
||||
data_race.maybe_perform_sync_operation(
|
||||
&this.machine.threads,
|
||||
current_span,
|
||||
|index, mut clocks| {
|
||||
log::trace!("Atomic fence on {:?} with ordering {:?}", index, atomic);
|
||||
|
||||
@ -658,7 +651,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
||||
// Increment timestamp in case of release semantics.
|
||||
Ok(atomic != AtomicFenceOrd::Acquire)
|
||||
},
|
||||
current_span,
|
||||
)
|
||||
} else {
|
||||
Ok(())
|
||||
@ -721,7 +713,7 @@ impl VClockAlloc {
|
||||
| MiriMemoryKind::ExternStatic
|
||||
| MiriMemoryKind::Tls,
|
||||
)
|
||||
| MemoryKind::CallerLocation => (VTimestamp::NONE, VectorIdx::MAX_INDEX),
|
||||
| MemoryKind::CallerLocation => (VTimestamp::ZERO, VectorIdx::MAX_INDEX),
|
||||
};
|
||||
VClockAlloc {
|
||||
alloc_ranges: RefCell::new(RangeMap::new(
|
||||
@ -752,7 +744,7 @@ impl VClockAlloc {
|
||||
let idx = l_remainder_slice
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find_map(|(idx, &r)| if r == VTimestamp::NONE { None } else { Some(idx) })
|
||||
.find_map(|(idx, &r)| if r == VTimestamp::ZERO { None } else { Some(idx) })
|
||||
.expect("Invalid VClock Invariant");
|
||||
Some(idx + r_slice.len())
|
||||
} else {
|
||||
@ -1132,6 +1124,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
||||
// Perform the atomic operation.
|
||||
data_race.maybe_perform_sync_operation(
|
||||
&this.machine.threads,
|
||||
current_span,
|
||||
|index, mut clocks| {
|
||||
for (offset, range) in
|
||||
alloc_meta.alloc_ranges.borrow_mut().iter_mut(base_offset, size)
|
||||
@ -1153,7 +1146,6 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
|
||||
// This conservatively assumes all operations have release semantics
|
||||
Ok(true)
|
||||
},
|
||||
current_span,
|
||||
)?;
|
||||
|
||||
// Log changes to atomic memory.
|
||||
@ -1497,8 +1489,8 @@ impl GlobalState {
|
||||
fn maybe_perform_sync_operation<'tcx>(
|
||||
&self,
|
||||
thread_mgr: &ThreadManager<'_, '_>,
|
||||
op: impl FnOnce(VectorIdx, RefMut<'_, ThreadClockSet>) -> InterpResult<'tcx, bool>,
|
||||
current_span: Span,
|
||||
op: impl FnOnce(VectorIdx, RefMut<'_, ThreadClockSet>) -> InterpResult<'tcx, bool>,
|
||||
) -> InterpResult<'tcx> {
|
||||
if self.multi_threaded.get() {
|
||||
let (index, clocks) = self.current_thread_state_mut(thread_mgr);
|
||||
|
@ -48,14 +48,14 @@ const SMALL_VECTOR: usize = 4;
|
||||
/// The time-stamps recorded in the data-race detector consist of both
|
||||
/// a 32-bit unsigned integer which is the actual timestamp, and a `Span`
|
||||
/// so that diagnostics can report what code was responsible for an operation.
|
||||
#[derive(Clone, Copy, Debug, Eq)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct VTimestamp {
|
||||
time: u32,
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
impl VTimestamp {
|
||||
pub const NONE: VTimestamp = VTimestamp { time: 0, span: DUMMY_SP };
|
||||
pub const ZERO: VTimestamp = VTimestamp { time: 0, span: DUMMY_SP };
|
||||
|
||||
pub fn span_data(&self) -> SpanData {
|
||||
self.span.data()
|
||||
@ -68,6 +68,8 @@ impl PartialEq for VTimestamp {
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for VTimestamp {}
|
||||
|
||||
impl PartialOrd for VTimestamp {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
|
||||
Some(self.cmp(other))
|
||||
@ -98,7 +100,7 @@ impl VClock {
|
||||
/// for a value at the given index
|
||||
pub fn new_with_index(index: VectorIdx, timestamp: VTimestamp) -> VClock {
|
||||
let len = index.index() + 1;
|
||||
let mut vec = smallvec::smallvec![VTimestamp::NONE; len];
|
||||
let mut vec = smallvec::smallvec![VTimestamp::ZERO; len];
|
||||
vec[index.index()] = timestamp;
|
||||
VClock(vec)
|
||||
}
|
||||
@ -115,7 +117,7 @@ impl VClock {
|
||||
#[inline]
|
||||
fn get_mut_with_min_len(&mut self, min_len: usize) -> &mut [VTimestamp] {
|
||||
if self.0.len() < min_len {
|
||||
self.0.resize(min_len, VTimestamp::NONE);
|
||||
self.0.resize(min_len, VTimestamp::ZERO);
|
||||
}
|
||||
assert!(self.0.len() >= min_len);
|
||||
self.0.as_mut_slice()
|
||||
@ -361,7 +363,7 @@ impl Index<VectorIdx> for VClock {
|
||||
|
||||
#[inline]
|
||||
fn index(&self, index: VectorIdx) -> &VTimestamp {
|
||||
self.as_slice().get(index.to_u32() as usize).unwrap_or(&VTimestamp::NONE)
|
||||
self.as_slice().get(index.to_u32() as usize).unwrap_or(&VTimestamp::ZERO)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ impl<'mir, 'tcx: 'mir> StoreBuffer {
|
||||
// The thread index and timestamp of the initialisation write
|
||||
// are never meaningfully used, so it's fine to leave them as 0
|
||||
store_index: VectorIdx::from(0),
|
||||
timestamp: VTimestamp::NONE,
|
||||
timestamp: VTimestamp::ZERO,
|
||||
val: init,
|
||||
is_seqcst: false,
|
||||
load_info: RefCell::new(LoadInfo::default()),
|
||||
|
@ -69,8 +69,8 @@ impl fmt::Display for TerminationInfo {
|
||||
DataRace { ptr, op1, op2 } =>
|
||||
write!(
|
||||
f,
|
||||
"Data race detected between {} on {} and {} on {} at {:?}",
|
||||
op1.action, op1.thread_info, op2.action, op2.thread_info, ptr,
|
||||
"Data race detected between {} on {} and {} on {} at {:?}. The {} is here",
|
||||
op1.action, op1.thread_info, op2.action, op2.thread_info, ptr, op1.action
|
||||
),
|
||||
}
|
||||
}
|
||||
@ -222,10 +222,9 @@ pub fn report_error<'tcx, 'mir>(
|
||||
vec![(Some(*span), format!("the `{link_name}` symbol is defined here"))],
|
||||
Int2PtrWithStrictProvenance =>
|
||||
vec![(None, format!("use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead"))],
|
||||
DataRace { ptr: _, op1, op2 } =>
|
||||
DataRace { op2, .. } =>
|
||||
vec![
|
||||
(Some(op1.span), format!("The {} on {} is here", op1.action, op1.thread_info)),
|
||||
(Some(op2.span), format!("The {} on {} is here", op2.action, op2.thread_info)),
|
||||
(Some(op2.span), format!("and {} on {}, which is here", op2.action, op2.thread_info)),
|
||||
(None, format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior")),
|
||||
(None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")),
|
||||
],
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/alloc_read_race.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Relaxed)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/alloc_read_race.rs:LL:CC
|
||||
|
|
||||
LL | ... *pointer.load(Ordering::Relaxed)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Allocate on thread `<unnamed>` is here
|
||||
help: and Allocate on thread `<unnamed>`, which is here
|
||||
--> $DIR/alloc_read_race.rs:LL:CC
|
||||
|
|
||||
LL | pointer.store(Box::into_raw(Box::new_uninit()), Ordering::Relaxed);
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/alloc_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Relaxed) = 2;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/alloc_write_race.rs:LL:CC
|
||||
|
|
||||
LL | ... *pointer.load(Ordering::Relaxed) = 2;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Allocate on thread `<unnamed>` is here
|
||||
help: and Allocate on thread `<unnamed>`, which is here
|
||||
--> $DIR/alloc_write_race.rs:LL:CC
|
||||
|
|
||||
LL | .store(Box::into_raw(Box::<usize>::new_uninit()) as *mut usize, Ordering::Relaxed);
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Load is here
|
||||
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | (&*c.0).load(Ordering::SeqCst)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Load is here
|
||||
|
|
||||
help: The Atomic Load on thread `<unnamed>` is here
|
||||
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | ... (&*c.0).load(Ordering::SeqCst)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | *(c.0 as *mut usize) = 32;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut() = 32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | ... *atomic_ref.get_mut() = 32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Atomic Load on thread `<unnamed>` is here
|
||||
help: and Atomic Load on thread `<unnamed>`, which is here
|
||||
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | atomic_ref.load(Ordering::SeqCst)
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Atomic Store on thread `<unnamed>` is here
|
||||
help: and Atomic Store on thread `<unnamed>`, which is here
|
||||
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | atomic_ref.store(32, Ordering::SeqCst)
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Atomic Store is here
|
||||
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
|
||||
|
|
||||
LL | (&*c.0).store(32, Ordering::SeqCst);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Atomic Store is here
|
||||
|
|
||||
help: The Atomic Store on thread `<unnamed>` is here
|
||||
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
|
||||
|
|
||||
LL | ... (&*c.0).store(32, Ordering::SeqCst);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
help: and Read on thread `<unnamed>`, which is here
|
||||
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
|
||||
|
|
||||
LL | let _val = *(c.0 as *mut usize);
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Store is here
|
||||
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | (&*c.0).store(64, Ordering::SeqCst);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Store is here
|
||||
|
|
||||
help: The Atomic Store on thread `<unnamed>` is here
|
||||
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | ... (&*c.0).store(64, Ordering::SeqCst);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | *(c.0 as *mut usize) = 32;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut() = 32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | ... *atomic_ref.get_mut() = 32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: The Atomic Store on thread `<unnamed>` is here
|
||||
help: and Atomic Store on thread `<unnamed>`, which is here
|
||||
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | atomic_ref.store(64, Ordering::SeqCst);
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/dangling_thread_async_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/dangling_thread_async_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/dangling_thread_async_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 32;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/dangling_thread_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `main` is here
|
||||
--> $DIR/dangling_thread_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/dangling_thread_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 32;
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
--> $DIR/dealloc_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | / __rust_dealloc(
|
||||
@ -7,19 +7,9 @@ LL | | ptr.0 as *mut _,
|
||||
LL | | std::mem::size_of::<usize>(),
|
||||
LL | | std::mem::align_of::<usize>(),
|
||||
LL | | );
|
||||
| |_____________^ Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
| |_____________^ Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
|
|
||||
help: The Deallocate on thread `<unnamed>` is here
|
||||
--> $DIR/dealloc_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | / __rust_dealloc(
|
||||
LL | |
|
||||
LL | | ptr.0 as *mut _,
|
||||
LL | | std::mem::size_of::<usize>(),
|
||||
LL | | std::mem::align_of::<usize>(),
|
||||
LL | | );
|
||||
| |_____________^
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
help: and Read on thread `<unnamed>`, which is here
|
||||
--> $DIR/dealloc_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | let _val = *ptr.0;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
--> $DIR/dealloc_read_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^ Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
| ^ Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
|
|
||||
help: The Deallocate on thread `<unnamed>` is here
|
||||
--> $DIR/dealloc_read_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
help: and Read on thread `<unnamed>`, which is here
|
||||
--> $DIR/dealloc_read_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Acquire)
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
--> $DIR/dealloc_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | / __rust_dealloc(
|
||||
@ -7,19 +7,9 @@ LL | | ptr.0 as *mut _,
|
||||
LL | | std::mem::size_of::<usize>(),
|
||||
LL | | std::mem::align_of::<usize>(),
|
||||
LL | | );
|
||||
| |_____________^ Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| |_____________^ Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
|
|
||||
help: The Deallocate on thread `<unnamed>` is here
|
||||
--> $DIR/dealloc_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | / __rust_dealloc(
|
||||
LL | |
|
||||
LL | | ptr.0 as *mut _,
|
||||
LL | | std::mem::size_of::<usize>(),
|
||||
LL | | std::mem::align_of::<usize>(),
|
||||
LL | | );
|
||||
| |_____________^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/dealloc_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | *ptr.0 = 2;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
--> $DIR/dealloc_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^ Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^ Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
|
|
||||
help: The Deallocate on thread `<unnamed>` is here
|
||||
--> $DIR/dealloc_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/dealloc_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Acquire) = 3;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/enable_after_join_to_main.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/enable_after_join_to_main.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/enable_after_join_to_main.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 32;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/fence_after_load.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { V = 2 }
|
||||
| ^^^^^ Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^ Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `main` is here
|
||||
--> $DIR/fence_after_load.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { V = 2 }
|
||||
| ^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/fence_after_load.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { V = 1 }
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/read_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/read_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
help: and Read on thread `<unnamed>`, which is here
|
||||
--> $DIR/read_write_race.rs:LL:CC
|
||||
|
|
||||
LL | let _val = *c.0;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/read_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | stack_var
|
||||
| ^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/read_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | stack_var
|
||||
| ^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/read_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Acquire) = 3;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/relax_acquire_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/relax_acquire_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/relax_acquire_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 1;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/release_seq_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/release_seq_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/release_seq_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 1;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/release_seq_race_same_thread.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/release_seq_race_same_thread.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/release_seq_race_same_thread.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 1;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
--> $DIR/rmw_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^ Data race detected between Read on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Read is here
|
||||
|
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
--> $DIR/rmw_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/rmw_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 1;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `main` and Read on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Deallocate on thread `main` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
--> $DIR/stack_pop_race.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^ Data race detected between Deallocate on thread `main` and Read on thread `<unnamed>` at ALLOC
|
||||
| ^ Data race detected between Deallocate on thread `main` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
|
||||
|
|
||||
help: The Deallocate on thread `main` is here
|
||||
--> $DIR/stack_pop_race.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
help: and Read on thread `<unnamed>`, which is here
|
||||
--> $DIR/stack_pop_race.rs:LL:CC
|
||||
|
|
||||
LL | let _val = unsafe { *ptr.0 };
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/write_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/write_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/write_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 32;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/write_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | stack_var = 1usize;
|
||||
| ^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/write_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | stack_var = 1usize;
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/write_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Acquire) = 3;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/retag_data_race_read.rs:LL:CC
|
||||
|
|
||||
LL | *p = 5;
|
||||
| ^^^^^^ Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^ Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/retag_data_race_read.rs:LL:CC
|
||||
|
|
||||
LL | *p = 5;
|
||||
| ^^^^^^
|
||||
help: The Read on thread `<unnamed>` is here
|
||||
help: and Read on thread `<unnamed>`, which is here
|
||||
--> $DIR/retag_data_race_read.rs:LL:CC
|
||||
|
|
||||
LL | let _r = &*p;
|
||||
|
@ -1,15 +1,10 @@
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
--> $DIR/retag_data_race_write.rs:LL:CC
|
||||
|
|
||||
LL | *p = 5;
|
||||
| ^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC
|
||||
| ^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
|
||||
|
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
--> $DIR/retag_data_race_write.rs:LL:CC
|
||||
|
|
||||
LL | *p = 5;
|
||||
| ^^^^^^
|
||||
help: The Write on thread `<unnamed>` is here
|
||||
help: and Write on thread `<unnamed>`, which is here
|
||||
--> $DIR/retag_data_race_write.rs:LL:CC
|
||||
|
|
||||
LL | let _r = &mut *p;
|
||||
|
Loading…
Reference in New Issue
Block a user