Skip to content

Commit

Permalink
Mention and number the components of a race in the order the interpre…
Browse files Browse the repository at this point in the history
…ter sees them
  • Loading branch information
saethlin committed Dec 23, 2022
1 parent def32e1 commit 60a100a
Show file tree
Hide file tree
Showing 53 changed files with 113 additions and 113 deletions.
10 changes: 5 additions & 5 deletions src/concurrency/data_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,15 +811,15 @@ impl VClockAlloc {
Err(err_machine_stop!(TerminationInfo::DataRace {
ptr: ptr_dbg,
op1: RacingOp {
action: action.to_string(),
thread_info: current_thread_info,
span: current_clocks.clock.as_slice()[current_index.index()].span_data(),
},
op2: RacingOp {
action: other_action.to_string(),
thread_info: other_thread_info,
span: other_clock.as_slice()[other_thread.index()].span_data(),
},
op2: RacingOp {
action: action.to_string(),
thread_info: current_thread_info,
span: current_clocks.clock.as_slice()[current_index.index()].span_data(),
},
}))?
}

Expand Down
6 changes: 3 additions & 3 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl fmt::Display for TerminationInfo {
DataRace { ptr, op1, op2 } =>
write!(
f,
"Data race detected between (1) {} on {} and (2) {} on {} at {ptr:?}. (1) just happened here",
"Data race detected between (1) {} on {} and (2) {} on {} at {ptr:?}. (2) just happened here",
op1.action, op1.thread_info, op2.action, op2.thread_info
),
}
Expand Down Expand Up @@ -222,9 +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 { op2, .. } =>
DataRace { op1, .. } =>
vec![
(Some(op2.span), format!("and (2) occurred earlier here")),
(Some(op1.span), format!("and (1) occurred earlier here")),
(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")),
],
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/alloc_read_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn main() {
let pointer = &*ptr.0;

// Note: could also error due to reading uninitialized memory, but the data-race detector triggers first.
*pointer.load(Ordering::Relaxed) //~ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Allocate on thread `<unnamed>`
*pointer.load(Ordering::Relaxed) //~ ERROR: Data race detected between (1) Allocate on thread `<unnamed>` and (2) Read on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/alloc_read_race.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Allocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/alloc_read_race.rs:LL:CC
|
LL | *pointer.load(Ordering::Relaxed)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Read on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Allocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/alloc_read_race.rs:LL:CC
|
LL | pointer.store(Box::into_raw(Box::new_uninit()), Ordering::Relaxed);
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/alloc_write_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn main() {

let j2 = spawn(move || {
let pointer = &*ptr.0;
*pointer.load(Ordering::Relaxed) = 2; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Allocate on thread `<unnamed>`
*pointer.load(Ordering::Relaxed) = 2; //~ ERROR: Data race detected between (1) Allocate on thread `<unnamed>` and (2) Write on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/alloc_write_race.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Allocate on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/alloc_write_race.rs:LL:CC
|
LL | *pointer.load(Ordering::Relaxed) = 2;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Allocate on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/alloc_write_race.rs:LL:CC
|
LL | .store(Box::into_raw(Box::<usize>::new_uninit()) as *mut usize, Ordering::Relaxed);
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/atomic_read_na_write_race1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn main() {
});

let j2 = spawn(move || {
(&*c.0).load(Ordering::SeqCst) //~ ERROR: Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>`
(&*c.0).load(Ordering::SeqCst) //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/atomic_read_na_write_race1.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
|
LL | (&*c.0).load(Ordering::SeqCst)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
|
LL | *(c.0 as *mut usize) = 32;
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/atomic_read_na_write_race2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn main() {

let j2 = spawn(move || {
let atomic_ref = &mut *c.0;
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>`
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/atomic_read_na_write_race2.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
|
LL | *atomic_ref.get_mut() = 32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
|
LL | atomic_ref.load(Ordering::SeqCst)
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/atomic_write_na_read_race1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn main() {

let j2 = spawn(move || {
let atomic_ref = &mut *c.0;
*atomic_ref.get_mut() //~ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>`
*atomic_ref.get_mut() //~ ERROR: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/atomic_write_na_read_race1.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
|
LL | *atomic_ref.get_mut()
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
|
LL | atomic_ref.store(32, Ordering::SeqCst)
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/atomic_write_na_read_race2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn main() {
});

let j2 = spawn(move || {
(&*c.0).store(32, Ordering::SeqCst); //~ ERROR: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>`
(&*c.0).store(32, Ordering::SeqCst); //~ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/atomic_write_na_read_race2.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
|
LL | (&*c.0).store(32, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
|
LL | let _val = *(c.0 as *mut usize);
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/atomic_write_na_write_race1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn main() {
});

let j2 = spawn(move || {
(&*c.0).store(64, Ordering::SeqCst); //~ ERROR: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>`
(&*c.0).store(64, Ordering::SeqCst); //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/atomic_write_na_write_race1.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
|
LL | (&*c.0).store(64, Ordering::SeqCst);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
|
LL | *(c.0 as *mut usize) = 32;
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/atomic_write_na_write_race2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn main() {

let j2 = spawn(move || {
let atomic_ref = &mut *c.0;
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>`
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>`
});

j1.join().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/atomic_write_na_write_race2.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
|
LL | *atomic_ref.get_mut() = 32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
|
LL | atomic_ref.store(64, Ordering::SeqCst);
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/dangling_thread_async_race.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/dangling_thread_async_race.rs:LL:CC
|
LL | *c.0 = 64;
| ^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/dangling_thread_async_race.rs:LL:CC
|
LL | *c.0 = 32;
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/dangling_thread_race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ fn main() {
spawn(|| ()).join().unwrap();

unsafe {
*c.0 = 64; //~ ERROR: Data race detected between (1) Write on thread `main` and (2) Write on thread `<unnamed>`
*c.0 = 64; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `main`
}
}
6 changes: 3 additions & 3 deletions tests/fail/data_race/dangling_thread_race.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Write on thread `main` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `main` at ALLOC. (2) just happened here
--> $DIR/dangling_thread_race.rs:LL:CC
|
LL | *c.0 = 64;
| ^^^^^^^^^ Data race detected between (1) Write on thread `main` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
| ^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `main` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/dangling_thread_race.rs:LL:CC
|
LL | *c.0 = 32;
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/dealloc_read_race1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn main() {

let j2 = spawn(move || {
__rust_dealloc(
//~^ ERROR: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>`
//~^ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>`
ptr.0 as *mut _,
std::mem::size_of::<usize>(),
std::mem::align_of::<usize>(),
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/dealloc_read_race1.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: Undefined Behavior: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/dealloc_read_race1.rs:LL:CC
|
LL | / __rust_dealloc(
Expand All @@ -7,9 +7,9 @@ LL | | ptr.0 as *mut _,
LL | | std::mem::size_of::<usize>(),
LL | | std::mem::align_of::<usize>(),
LL | | );
| |_____________^ Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
| |_____________^ Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/dealloc_read_race1.rs:LL:CC
|
LL | let _val = *ptr.0;
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/dealloc_read_race2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn main() {
});

let j2 = spawn(move || {
// Also an error of the form: Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>`
// Also an error of the form: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>`
// but the invalid allocation is detected first.
*ptr.0 //~ ERROR: dereferenced after this allocation got freed
});
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/dealloc_read_race_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn main() {
sleep(Duration::from_millis(200));

// Now `stack_var` gets deallocated.
} //~ ERROR: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>`
} //~ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>`
});

let j2 = spawn(move || {
Expand Down
6 changes: 3 additions & 3 deletions tests/fail/data_race/dealloc_read_race_stack.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: Undefined Behavior: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>` at ALLOC. (2) just happened here
--> $DIR/dealloc_read_race_stack.rs:LL:CC
|
LL | }
| ^ Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
| ^ Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>` at ALLOC. (2) just happened here
|
help: and (2) occurred earlier here
help: and (1) occurred earlier here
--> $DIR/dealloc_read_race_stack.rs:LL:CC
|
LL | *pointer.load(Ordering::Acquire)
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/data_race/dealloc_write_race1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn main() {

let j2 = spawn(move || {
__rust_dealloc(
//~^ ERROR: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Write on thread `<unnamed>`
//~^ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>`
ptr.0 as *mut _,
std::mem::size_of::<usize>(),
std::mem::align_of::<usize>(),
Expand Down
Loading

0 comments on commit 60a100a

Please sign in to comment.