Skip to content

Commit 98f175b

Browse files
committed
Report the range of uninit bytes in CTFE errors
1 parent 3322654 commit 98f175b

29 files changed

+145
-29
lines changed

tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ fn main() {
1515
libc::pthread_cond_destroy(cond.as_mut_ptr());
1616

1717
libc::pthread_cond_destroy(cond.as_mut_ptr());
18-
//~^ ERROR: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
18+
//~^ ERROR: /Undefined Behavior: reading memory .*, but memory is uninitialized/
1919
}
2020
}

tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
1+
error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is uninitialized at [0x0..0x4], and this operation requires initialized memory
22
--> tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC
33
|
44
LL | libc::pthread_cond_destroy(cond.as_mut_ptr());
@@ -9,6 +9,13 @@ LL | libc::pthread_cond_destroy(cond.as_mut_ptr());
99
= note: BACKTRACE:
1010
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC
1111

12+
Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation:
13+
ALLOC (stack variable, size: 48, align: 8) {
14+
0x00 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
15+
0x10 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
16+
0x20 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
17+
}
18+
1219
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1320

1421
error: aborting due to 1 previous error

tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ fn main() {
1313
libc::pthread_condattr_destroy(attr.as_mut_ptr());
1414

1515
libc::pthread_condattr_destroy(attr.as_mut_ptr());
16-
//~^ ERROR: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
16+
//~^ ERROR: /Undefined Behavior: reading memory .*, but memory is uninitialized/
1717
}
1818
}

tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
1+
error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is uninitialized at [0x0..0x4], and this operation requires initialized memory
22
--> tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC
33
|
44
LL | libc::pthread_condattr_destroy(attr.as_mut_ptr());
@@ -9,6 +9,11 @@ LL | libc::pthread_condattr_destroy(attr.as_mut_ptr());
99
= note: BACKTRACE:
1010
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC
1111

12+
Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation:
13+
ALLOC (stack variable, size: 4, align: 4) {
14+
__ __ __ __ │ ░░░░
15+
}
16+
1217
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1318

1419
error: aborting due to 1 previous error

tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ fn main() {
1616
libc::pthread_mutex_destroy(mutex.as_mut_ptr());
1717

1818
libc::pthread_mutex_destroy(mutex.as_mut_ptr());
19-
//~^ ERROR: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
19+
//~^ ERROR: /Undefined Behavior: reading memory .*, but memory is uninitialized/
2020
}
2121
}

tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
1+
error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is uninitialized at [0x0..0x4], and this operation requires initialized memory
22
--> tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC
33
|
44
LL | libc::pthread_mutex_destroy(mutex.as_mut_ptr());
@@ -9,6 +9,13 @@ LL | libc::pthread_mutex_destroy(mutex.as_mut_ptr());
99
= note: BACKTRACE:
1010
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC
1111

12+
Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation:
13+
ALLOC (stack variable, size: 40, align: 8) {
14+
0x00 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
15+
0x10 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
16+
0x20 │ __ __ __ __ __ __ __ __ │ ░░░░░░░░
17+
}
18+
1219
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1320

1421
error: aborting due to 1 previous error

tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ fn main() {
1212
libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
1313

1414
libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
15-
//~^ ERROR: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
15+
//~^ ERROR: /Undefined Behavior: reading memory .*, but memory is uninitialized/
1616
}
1717
}

tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
1+
error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is uninitialized at [0x0..0x4], and this operation requires initialized memory
22
--> tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC
33
|
44
LL | libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
@@ -9,6 +9,11 @@ LL | libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
99
= note: BACKTRACE:
1010
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC
1111

12+
Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation:
13+
ALLOC (stack variable, size: 4, align: 4) {
14+
__ __ __ __ │ ░░░░
15+
}
16+
1217
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1318

1419
error: aborting due to 1 previous error

tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ fn main() {
99
libc::pthread_rwlock_destroy(&mut lock);
1010

1111
libc::pthread_rwlock_destroy(&mut lock);
12-
//~^ ERROR: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
12+
//~^ ERROR: /Undefined Behavior: reading memory .*, but memory is uninitialized/
1313
}
1414
}

tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
1+
error: Undefined Behavior: reading memory at ALLOC[0x0..0x4], but memory is uninitialized at [0x0..0x4], and this operation requires initialized memory
22
--> tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC
33
|
44
LL | libc::pthread_rwlock_destroy(&mut lock);
@@ -9,6 +9,14 @@ LL | libc::pthread_rwlock_destroy(&mut lock);
99
= note: BACKTRACE:
1010
= note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC
1111

12+
Uninitialized memory occurred at ALLOC[0x0..0x4], in this allocation:
13+
ALLOC (stack variable, size: 56, align: 8) {
14+
0x00 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
15+
0x10 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
16+
0x20 │ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
17+
0x30 │ __ __ __ __ __ __ __ __ │ ░░░░░░░░
18+
}
19+
1220
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1321

1422
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)