Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d2731d8e9338d8fe844e19d3fbb39617753e65f4
09db05762b283bed62d4f92729cfee4646519833
8 changes: 4 additions & 4 deletions tests/compile-fail/data_race/dealloc_read_race_stack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0
// With optimizations (in particular #78360), the span becomes much worse, so we disable them.

use std::thread::{spawn, sleep};
use std::ptr::null_mut;
Expand Down Expand Up @@ -27,9 +28,6 @@ pub fn main() {
// 3. stack-deallocate
unsafe {
let j1 = spawn(move || {
// Concurrent allocate the memory.
// Uses relaxed semantics to not generate
// a release sequence.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JCTyblaidd these comments seem to be wrong here; there is no allocation and also nothing relaxed anywhere nearby...

let pointer = &*ptr.0;
{
let mut stack_var = 0usize;
Expand All @@ -38,6 +36,8 @@ pub fn main() {

sleep(Duration::from_millis(200));

// Now `stack_var` gets deallocated.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JCTyblaidd I think this is right, would be good to check.


} //~ ERROR Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2)
});

Expand Down
52 changes: 0 additions & 52 deletions tests/compile-fail/data_race/dealloc_read_race_stack_drop.rs

This file was deleted.

8 changes: 4 additions & 4 deletions tests/compile-fail/data_race/dealloc_write_race_stack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-disable-isolation
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0
// With optimizations (in particular #78360), the span becomes much worse, so we disable them.

use std::thread::{spawn, sleep};
use std::ptr::null_mut;
Expand Down Expand Up @@ -27,9 +28,6 @@ pub fn main() {
// 3. stack-deallocate
unsafe {
let j1 = spawn(move || {
// Concurrent allocate the memory.
// Uses relaxed semantics to not generate
// a release sequence.
let pointer = &*ptr.0;
{
let mut stack_var = 0usize;
Expand All @@ -38,6 +36,8 @@ pub fn main() {

sleep(Duration::from_millis(200));

// Now `stack_var` gets deallocated.

} //~ ERROR Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2)
});

Expand Down
53 changes: 0 additions & 53 deletions tests/compile-fail/data_race/dealloc_write_race_stack_drop.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ignore-windows: No libc on Windows
// error-pattern: deadlock

#![feature(rustc_private)]

Expand All @@ -8,6 +9,6 @@ fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
assert_eq!(libc::pthread_rwlock_rdlock(rw.get()), 0);
libc::pthread_rwlock_wrlock(rw.get()); //~ ERROR: deadlock
libc::pthread_rwlock_wrlock(rw.get());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ignore-windows: No libc on Windows
// error-pattern: deadlock

#![feature(rustc_private)]

Expand All @@ -8,6 +9,6 @@ fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
assert_eq!(libc::pthread_rwlock_wrlock(rw.get()), 0);
libc::pthread_rwlock_rdlock(rw.get()); //~ ERROR: deadlock
libc::pthread_rwlock_rdlock(rw.get());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// ignore-windows: No libc on Windows
// error-pattern: deadlock

#![feature(rustc_private)]

Expand All @@ -8,6 +9,6 @@ fn main() {
let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
unsafe {
assert_eq!(libc::pthread_rwlock_wrlock(rw.get()), 0);
libc::pthread_rwlock_wrlock(rw.get()); //~ ERROR: deadlock
libc::pthread_rwlock_wrlock(rw.get());
}
}