Skip to content

Commit cf52f0e

Browse files
committed
Ignore alloc ids in some diagnostics
1 parent 7b22ee7 commit cf52f0e

16 files changed

+40
-32
lines changed

tests/compile-fail/data_race/dangling_thread_async_race.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
use std::thread::{spawn, sleep};
56
use std::time::Duration;

tests/compile-fail/data_race/dangling_thread_async_race.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1) at alloc1014 (current vector clock = VClock([36, 0, 18]), conflicting timestamp = VClock([0, 6]))
4-
--> $DIR/dangling_thread_async_race.rs:39:13
3+
error: Undefined Behavior: Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([36, 0, 18]), conflicting timestamp = VClock([0, 6]))
4+
--> $DIR/dangling_thread_async_race.rs:40:13
55
|
66
LL | *c.0 = 64; //~ ERROR Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1)
7-
| ^^^^^^^^^ Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1) at alloc1014 (current vector clock = VClock([36, 0, 18]), conflicting timestamp = VClock([0, 6]))
7+
| ^^^^^^^^^ Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([36, 0, 18]), conflicting timestamp = VClock([0, 6]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/dangling_thread_async_race.rs:39:13
12+
= note: inside closure at $DIR/dangling_thread_async_race.rs:40:13
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/dangling_thread_race.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
use std::thread::{spawn, sleep};
56
use std::time::Duration;

tests/compile-fail/data_race/dangling_thread_race.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1) at alloc1015 (current vector clock = VClock([25, 0, 11]), conflicting timestamp = VClock([0, 6]))
4-
--> $DIR/dangling_thread_race.rs:39:9
3+
error: Undefined Behavior: Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([25, 0, 11]), conflicting timestamp = VClock([0, 6]))
4+
--> $DIR/dangling_thread_race.rs:40:9
55
|
66
LL | *c.0 = 64; //~ ERROR Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1)
7-
| ^^^^^^^^^ Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1) at alloc1015 (current vector clock = VClock([25, 0, 11]), conflicting timestamp = VClock([0, 6]))
7+
| ^^^^^^^^^ Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([25, 0, 11]), conflicting timestamp = VClock([0, 6]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside `main` at $DIR/dangling_thread_race.rs:39:9
12+
= note: inside `main` at $DIR/dangling_thread_race.rs:40:9
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/dealloc_read_race_stack.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
use std::thread::{spawn, sleep};
56
use std::ptr::null_mut;

tests/compile-fail/data_race/dealloc_read_race_stack.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2) at alloc2613 (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
4-
--> $DIR/dealloc_read_race_stack.rs:40:13
3+
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2) at allocXXX (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
4+
--> $DIR/dealloc_read_race_stack.rs:41:13
55
|
66
LL | } //~ ERROR Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2)
7-
| ^ Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2) at alloc2613 (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
7+
| ^ Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2) at allocXXX (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/dealloc_read_race_stack.rs:40:13
12+
= note: inside closure at $DIR/dealloc_read_race_stack.rs:41:13
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/dealloc_write_race_stack.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
use std::thread::{spawn, sleep};
56
use std::ptr::null_mut;

tests/compile-fail/data_race/dealloc_write_race_stack.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2) at alloc2613 (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
4-
--> $DIR/dealloc_write_race_stack.rs:40:13
3+
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2) at allocXXX (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
4+
--> $DIR/dealloc_write_race_stack.rs:41:13
55
|
66
LL | } //~ ERROR Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2)
7-
| ^ Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2) at alloc2613 (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
7+
| ^ Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2) at allocXXX (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/dealloc_write_race_stack.rs:40:13
12+
= note: inside closure at $DIR/dealloc_write_race_stack.rs:41:13
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/read_write_race_stack.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
// Note: mir-opt-level set to 0 to prevent the read of stack_var in thread 1
56
// from being optimized away and preventing the detection of the data-race.

tests/compile-fail/data_race/read_write_race_stack.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2) at alloc2618 (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
4-
--> $DIR/read_write_race_stack.rs:46:13
3+
error: Undefined Behavior: Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2) at allocXXX (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
4+
--> $DIR/read_write_race_stack.rs:47:13
55
|
66
LL | stack_var //~ ERROR Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2)
7-
| ^^^^^^^^^ Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2) at alloc2618 (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
7+
| ^^^^^^^^^ Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2) at allocXXX (current vector clock = VClock([3, 7]), conflicting timestamp = VClock([0, 0, 7]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/read_write_race_stack.rs:46:13
12+
= note: inside closure at $DIR/read_write_race_stack.rs:47:13
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/release_seq_race.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
use std::thread::{spawn, sleep};
56
use std::sync::atomic::{AtomicUsize, Ordering};

tests/compile-fail/data_race/release_seq_race.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at alloc1019 (current vector clock = VClock([27, 0, 0, 7]), conflicting timestamp = VClock([0, 6]))
4-
--> $DIR/release_seq_race.rs:45:17
3+
error: Undefined Behavior: Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([27, 0, 0, 7]), conflicting timestamp = VClock([0, 6]))
4+
--> $DIR/release_seq_race.rs:46:17
55
|
66
LL | *c.0 //~ ERROR Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1)
7-
| ^^^^ Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at alloc1019 (current vector clock = VClock([27, 0, 0, 7]), conflicting timestamp = VClock([0, 6]))
7+
| ^^^^ Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([27, 0, 0, 7]), conflicting timestamp = VClock([0, 6]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/release_seq_race.rs:45:17
12+
= note: inside closure at $DIR/release_seq_race.rs:46:17
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/release_seq_race_same_thread.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
22
// compile-flags: -Zmiri-disable-isolation
3+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
34

45
use std::thread::spawn;
56
use std::sync::atomic::{AtomicUsize, Ordering};

tests/compile-fail/data_race/release_seq_race_same_thread.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1) at alloc1019 (current vector clock = VClock([15, 0, 7]), conflicting timestamp = VClock([0, 6]))
4-
--> $DIR/release_seq_race_same_thread.rs:41:17
3+
error: Undefined Behavior: Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([15, 0, 7]), conflicting timestamp = VClock([0, 6]))
4+
--> $DIR/release_seq_race_same_thread.rs:42:17
55
|
66
LL | *c.0 //~ ERROR Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1)
7-
| ^^^^ Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1) at alloc1019 (current vector clock = VClock([15, 0, 7]), conflicting timestamp = VClock([0, 6]))
7+
| ^^^^ Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([15, 0, 7]), conflicting timestamp = VClock([0, 6]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/release_seq_race_same_thread.rs:41:17
12+
= note: inside closure at $DIR/release_seq_race_same_thread.rs:42:17
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

tests/compile-fail/data_race/write_write_race.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
2+
// normalize-stderr-test: "alloc[0-9]+" -> "allocXXX"
23

34
use std::thread::spawn;
45

tests/compile-fail/data_race/write_write_race.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
22

3-
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1) at alloc954 (current vector clock = VClock([15, 0, 6]), conflicting timestamp = VClock([0, 6]))
4-
--> $DIR/write_write_race.rs:21:13
3+
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([15, 0, 6]), conflicting timestamp = VClock([0, 6]))
4+
--> $DIR/write_write_race.rs:22:13
55
|
66
LL | *c.0 = 64; //~ ERROR Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1)
7-
| ^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1) at alloc954 (current vector clock = VClock([15, 0, 6]), conflicting timestamp = VClock([0, 6]))
7+
| ^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1) at allocXXX (current vector clock = VClock([15, 0, 6]), conflicting timestamp = VClock([0, 6]))
88
|
99
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1010
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1111

12-
= note: inside closure at $DIR/write_write_race.rs:21:13
12+
= note: inside closure at $DIR/write_write_race.rs:22:13
1313

1414
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1515

0 commit comments

Comments
 (0)