Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 08bddfb

Browse files
committedDec 20, 2024·
Bless miri tests
1 parent 1dd2f56 commit 08bddfb

29 files changed

+336
-159
lines changed
 

‎library/alloc/src/alloc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ use core::ptr::{self, NonNull};
1212

1313
extern "Rust" {
1414
// These are the magic symbols to call the global allocator. rustc generates
15-
// them to call `__rg_alloc` etc. if there is a `#[global_allocator]` attribute
16-
// (the code expanding that attribute macro generates those functions), or to call
15+
// them to call `GLOBAL.alloc` etc. if there is a `#[global_allocator]` attribute
16+
// (the code expanding that attribute macro generates those functions), or if not
1717
// the default implementations in std (weak symbols in `library/std/src/alloc.rs`)
18-
// otherwise.
19-
// The rustc fork of LLVM 14 and earlier also special-cases these function names to be able to optimize them
20-
// like `malloc`, `realloc`, and `free`, respectively.
18+
// is used otherwise.
19+
// The rustc fork of LLVM 14 and earlier also special-cases these function names to
20+
// be able to optimize them like `malloc`, `realloc`, and `free`, respectively.
2121
#[rustc_allocator]
2222
#[rustc_nounwind]
2323
fn __rust_alloc(size: usize, align: usize) -> *mut u8;

‎src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | ABORT();
99
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1010
= note: inside `std::process::abort` at RUSTLIB/std/src/process.rs:LL:CC
1111
= note: inside `std::alloc::rust_oom` at RUSTLIB/std/src/alloc.rs:LL:CC
12-
= note: inside `std::alloc::_::__rg_oom` at RUSTLIB/std/src/alloc.rs:LL:CC
12+
= note: inside `std::alloc::_::__rust_alloc_error_handler` at RUSTLIB/std/src/alloc.rs:LL:CC
1313
= note: inside `std::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1414
= note: inside `std::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1515
note: inside `main`

‎src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | core::intrinsics::abort();
77
|
88
= note: BACKTRACE:
99
= note: inside `alloc_error_handler` at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
10-
note: inside `_::__rg_oom`
10+
note: inside `_::__rust_alloc_error_handler`
1111
--> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
1212
|
1313
LL | #[alloc_error_handler]

‎src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | core::intrinsics::abort();
99
|
1010
= note: BACKTRACE:
1111
= note: inside `panic_handler` at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC
12-
= note: inside `alloc::alloc::__alloc_error_handler::__rdl_oom` at RUSTLIB/alloc/src/alloc.rs:LL:CC
12+
= note: inside `alloc::alloc::__alloc_error_handler::__rust_alloc_error_handler` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1313
= note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1414
= note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1515
note: inside `start`

‎src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎src/tools/miri/tests/fail/alloc/deallocate-twice.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
2-
--> tests/fail/alloc/deallocate-twice.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
@@ -17,7 +17,13 @@ help: ALLOC was deallocated here:
1717
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
= note: BACKTRACE (of the first span):
20-
= note: inside `main` at tests/fail/alloc/deallocate-twice.rs:LL:CC
20+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
21+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
22+
note: inside `main`
23+
--> tests/fail/alloc/deallocate-twice.rs:LL:CC
24+
|
25+
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));
26+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2127

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

‎src/tools/miri/tests/fail/alloc/global_system_mixup.stderr

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
2-
--> tests/fail/alloc/reallocate-bad-size.rs:LL:CC
1+
error: memory leaked: ALLOC (C heap, size: 1, align: 1), allocated here:
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
4+
LL | unsafe { libc::realloc(ptr as *mut libc::c_void, new_size) as *mut u8 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8-
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
97
= note: BACKTRACE:
10-
= note: inside `main` at tests/fail/alloc/reallocate-bad-size.rs:LL:CC
8+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::realloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
9+
= note: inside `std::alloc::__default_lib_allocator::__rust_realloc` at RUSTLIB/std/src/alloc.rs:LL:CC
10+
note: inside `main`
11+
--> tests/fail/alloc/reallocate-bad-size.rs:LL:CC
12+
|
13+
LL | ... let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1115

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

18+
note: set `MIRIFLAGS=-Zmiri-ignore-leaks` to disable this check
19+
1420
error: aborting due to 1 previous error
1521

‎src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
2-
--> tests/fail/alloc/reallocate-dangling.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
4+
LL | unsafe { libc::realloc(ptr as *mut libc::c_void, new_size) as *mut u8 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
@@ -17,7 +17,13 @@ help: ALLOC was deallocated here:
1717
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));
1818
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
= note: BACKTRACE (of the first span):
20-
= note: inside `main` at tests/fail/alloc/reallocate-dangling.rs:LL:CC
20+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::realloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
21+
= note: inside `std::alloc::__default_lib_allocator::__rust_realloc` at RUSTLIB/std/src/alloc.rs:LL:CC
22+
note: inside `main`
23+
--> tests/fail/alloc/reallocate-dangling.rs:LL:CC
24+
|
25+
LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
26+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2127

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

‎src/tools/miri/tests/fail/alloc/stack_free.stderr

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
error: Undefined Behavior: deallocating ALLOC, which is stack variable memory, using Rust heap deallocation operation
2-
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
1+
error: Undefined Behavior: deallocating ALLOC, which is stack variable memory, using C heap deallocation operation
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | self.1.deallocate(From::from(ptr.cast()), layout);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating ALLOC, which is stack variable memory, using Rust heap deallocation operation
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating ALLOC, which is stack variable memory, using C heap deallocation operation
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
10+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
11+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
1012
= note: inside `<std::boxed::Box<i32> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC
1113
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
1214
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC

‎src/tools/miri/tests/fail/alloc/too_large.stderr

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
error: Undefined Behavior: creating an allocation larger than half the address space
2-
--> tests/fail/alloc/too_large.rs:LL:CC
1+
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
2+
unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4+
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
5+
thread caused non-unwinding panic. aborting.
6+
error: abnormal termination: the program aborted execution
7+
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
38
|
4-
LL | __rust_alloc(bytes, 1);
5-
| ^^^^^^^^^^^^^^^^^^^^^^ creating an allocation larger than half the address space
9+
LL | unsafe { libc::abort() }
10+
| ^^^^^^^^^^^^^ the program aborted execution
611
|
7-
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8-
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
912
= note: BACKTRACE:
10-
= note: inside `main` at tests/fail/alloc/too_large.rs:LL:CC
13+
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
14+
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
15+
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
16+
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
17+
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
18+
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
19+
= note: inside `std::alloc::Layout::from_size_align_unchecked::precondition_check` at RUSTLIB/core/src/ub_checks.rs:LL:CC
20+
= note: inside `std::alloc::Layout::from_size_align_unchecked` at RUSTLIB/core/src/ub_checks.rs:LL:CC
21+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
22+
note: inside `main`
23+
--> tests/fail/alloc/too_large.rs:LL:CC
24+
|
25+
LL | __rust_alloc(bytes, 1);
26+
| ^^^^^^^^^^^^^^^^^^^^^^
1127

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

Lines changed: 134 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,138 @@
1-
error: unsupported operation: creating allocation with alignment ALIGN exceeding rustc's maximum supported value
2-
--> tests/fail/alloc/unsupported_big_alignment.rs:LL:CC
1+
thread 'rustc' panicked at src/tools/miri/src/shims/alloc.rs:LL:CC:
2+
called `Result::unwrap()` on an `Err` value: `1073741824` is too large
3+
stack backtrace:
4+
0: rust_begin_unwind
5+
at RUSTLIB/std/src/panicking.rs:LL:CC
6+
1: core::panicking::panic_fmt
7+
at RUSTLIB/core/src/panicking.rs:LL:CC
8+
2: core::result::unwrap_failed
9+
at RUSTLIB/core/src/result.rs:LL:CC
10+
3: <core::result::Result<rustc_abi::Align, rustc_abi::AlignFromBytesError>>::unwrap
11+
at RUSTLIB/core/src/result.rs:LL:CC
12+
4: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::alloc::EvalContextExt>::posix_memalign
13+
at ./src/shims/alloc.rs:LL:CC
14+
5: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::unix::foreign_items::EvalContextExt>::emulate_foreign_item_inner
15+
at ./src/shims/unix/foreign_items.rs:LL:CC
16+
6: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::foreign_items::EvalContextExtPriv>::emulate_foreign_item_inner
17+
at ./src/shims/foreign_items.rs:LL:CC
18+
7: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::shims::foreign_items::EvalContextExt>::emulate_foreign_item
19+
at ./src/shims/foreign_items.rs:LL:CC
20+
8: <miri::machine::MiriMachine as rustc_const_eval::interpret::machine::Machine>::find_mir_or_eval_fn
21+
at ./src/machine.rs:LL:CC
22+
9: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine>>::init_fn_call
23+
at /home/gh-bjorn3/rust/compiler/rustc_const_eval/src/interpret/call.rs:LL:CC
24+
10: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine>>::eval_terminator
25+
at /home/gh-bjorn3/rust/compiler/rustc_const_eval/src/interpret/step.rs:LL:CC
26+
11: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine>>::step
27+
at /home/gh-bjorn3/rust/compiler/rustc_const_eval/src/interpret/step.rs:LL:CC
28+
12: <rustc_const_eval::interpret::eval_context::InterpCx<miri::machine::MiriMachine> as miri::concurrency::thread::EvalContextExt>::run_threads
29+
at ./src/concurrency/thread.rs:LL:CC
30+
13: miri::eval::eval_entry::{closure#0}
31+
at ./src/eval.rs:LL:CC
32+
14: <miri::eval::eval_entry::{closure#0} as core::ops::function::FnOnce<()>>::call_once
33+
at RUSTLIB/core/src/ops/function.rs:LL:CC
34+
15: <core::panic::unwind_safe::AssertUnwindSafe<miri::eval::eval_entry::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
35+
at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
36+
16: std::panicking::try::do_call
37+
at RUSTLIB/std/src/panicking.rs:LL:CC
38+
17: std::panicking::try
39+
at RUSTLIB/std/src/panicking.rs:LL:CC
40+
18: std::panic::catch_unwind
41+
at RUSTLIB/std/src/panic.rs:LL:CC
42+
19: miri::eval::eval_entry
43+
at ./src/eval.rs:LL:CC
44+
20: <miri::MiriCompilerCalls as rustc_driver_impl::Callbacks>::after_analysis
45+
at ./src/bin/miri.rs:LL:CC
46+
21: rustc_driver_impl::run_compiler::{closure#0}::{closure#2}
47+
at /home/gh-bjorn3/rust/compiler/rustc_driver_impl/src/lib.rs:LL:CC
48+
22: rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure#0}
49+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/passes.rs:LL:CC
50+
23: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::{closure#3}
51+
at /home/gh-bjorn3/rust/compiler/rustc_middle/src/ty/context.rs:LL:CC
52+
24: rustc_middle::ty::context::tls::enter_context::{closure#0}
53+
at /home/gh-bjorn3/rust/compiler/rustc_middle/src/ty/context/tls.rs:LL:CC
54+
25: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::try_with
55+
at RUSTLIB/std/src/thread/local.rs:LL:CC
56+
26: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with
57+
at RUSTLIB/std/src/thread/local.rs:LL:CC
58+
27: rustc_middle::ty::context::tls::enter_context
59+
at /home/gh-bjorn3/rust/compiler/rustc_middle/src/ty/context/tls.rs:LL:CC
60+
28: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt
61+
at /home/gh-bjorn3/rust/compiler/rustc_middle/src/ty/context.rs:LL:CC
62+
29: rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}
63+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/passes.rs:LL:CC
64+
30: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_interface::interface::Compiler, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
65+
at RUSTLIB/core/src/ops/function.rs:LL:CC
66+
31: <alloc::boxed::Box<dyn for<'a> core::ops::function::FnOnce<(&'a rustc_interface::interface::Compiler, &'a std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena<'a>>, &'a rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena<'a>>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}), Output = core::option::Option<rustc_interface::queries::Linker>>> as core::ops::function::FnOnce<(&rustc_interface::interface::Compiler, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once
67+
at RUSTLIB/alloc/src/boxed.rs:LL:CC
68+
32: rustc_interface::passes::create_and_enter_global_ctxt
69+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/passes.rs:LL:CC
70+
33: rustc_driver_impl::run_compiler::{closure#0}
71+
at /home/gh-bjorn3/rust/compiler/rustc_driver_impl/src/lib.rs:LL:CC
72+
34: rustc_interface::interface::run_compiler::{closure#1}::{closure#0}
73+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/interface.rs:LL:CC
74+
35: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
75+
at RUSTLIB/core/src/panic/unwind_safe.rs:LL:CC
76+
36: std::panicking::try::do_call
77+
at RUSTLIB/std/src/panicking.rs:LL:CC
78+
37: std::panicking::try
79+
at RUSTLIB/std/src/panicking.rs:LL:CC
80+
38: std::panic::catch_unwind
81+
at RUSTLIB/std/src/panic.rs:LL:CC
82+
39: rustc_interface::interface::run_compiler::{closure#1}
83+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/interface.rs:LL:CC
84+
40: rustc_interface::util::run_in_thread_pool_with_globals::{closure#0}
85+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/util.rs:LL:CC
86+
41: rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure#0}
87+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/util.rs:LL:CC
88+
42: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set
89+
at CARGO_REGISTRY/.../lib.rs:LL:CC
90+
43: rustc_span::create_session_globals_then
91+
at /home/gh-bjorn3/rust/compiler/rustc_span/src/lib.rs:LL:CC
92+
44: rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}
93+
at /home/gh-bjorn3/rust/compiler/rustc_interface/src/util.rs:LL:CC
94+
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
95+
96+
error: the compiler unexpectedly panicked. this is a bug.
97+
98+
note: we would appreciate a bug report: https://github.com/rust-lang/miri/issues/new
99+
100+
note: please make sure that you have updated to the latest nightly
101+
102+
note: please attach the file at `/home/gh-bjorn3/rust/src/tools/miri/rustc-ice-2024-12-20T10_31_46-710436.txt` to your bug report
103+
104+
note: compiler flags: -Z ui-testing
105+
106+
query stack during panic:
107+
end of query stack
108+
109+
Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
110+
note: the place in the program where the ICE was triggered
111+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
3112
|
4-
LL | __rust_alloc(1, 1 << 30);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^ creating allocation with alignment ALIGN exceeding rustc's maximum supported value
113+
LL | let ret = unsafe { libc::posix_memalign(&mut out, align, layout.size()) };
114+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6115
|
7-
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
8116
= note: BACKTRACE:
9-
= note: inside `main` at tests/fail/alloc/unsupported_big_alignment.rs:LL:CC
10-
11-
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
12-
13-
error: aborting due to 1 previous error
117+
= note: inside `std::sys::alloc::unix::aligned_malloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
118+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::alloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
119+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
120+
note: inside `main`
121+
--> tests/fail/alloc/unsupported_big_alignment.rs:LL:CC
122+
|
123+
LL | __rust_alloc(1, 1 << 30);
124+
| ^^^^^^^^^^^^^^^^^^^^^^^^
125+
= note: inside `<fn() as std::ops::FnOnce<()>>::call_once - shim(fn())` at RUSTLIB/core/src/ops/function.rs:LL:CC
126+
= note: inside `std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
127+
= note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
128+
= note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at RUSTLIB/core/src/ops/function.rs:LL:CC
129+
= note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
130+
= note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
131+
= note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panic.rs:LL:CC
132+
= note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
133+
= note: inside `std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#1}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
134+
= note: inside `std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#1}}>` at RUSTLIB/std/src/panicking.rs:LL:CC
135+
= note: inside `std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#1}}, isize>` at RUSTLIB/std/src/panic.rs:LL:CC
136+
= note: inside `std::rt::lang_start_internal` at RUSTLIB/std/src/rt.rs:LL:CC
137+
= note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC
14138

‎src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
error: Undefined Behavior: creating allocation with non-power-of-two alignment ALIGN
2-
--> tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC
1+
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
2+
unsafe precondition(s) violated: Layout::from_size_align_unchecked requires that align is a power of 2 and the rounded-up allocation size does not exceed isize::MAX
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4+
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
5+
thread caused non-unwinding panic. aborting.
6+
error: abnormal termination: the program aborted execution
7+
--> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
38
|
4-
LL | __rust_alloc(1, 3);
5-
| ^^^^^^^^^^^^^^^^^^ creating allocation with non-power-of-two alignment ALIGN
9+
LL | unsafe { libc::abort() }
10+
| ^^^^^^^^^^^^^ the program aborted execution
611
|
7-
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8-
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
912
= note: BACKTRACE:
10-
= note: inside `main` at tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC
13+
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
14+
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
15+
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
16+
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
17+
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
18+
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
19+
= note: inside `std::alloc::Layout::from_size_align_unchecked::precondition_check` at RUSTLIB/core/src/ub_checks.rs:LL:CC
20+
= note: inside `std::alloc::Layout::from_size_align_unchecked` at RUSTLIB/core/src/ub_checks.rs:LL:CC
21+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
22+
note: inside `main`
23+
--> tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC
24+
|
25+
LL | __rust_alloc(1, 3);
26+
| ^^^^^^^^^^^^^^^^^^
1127

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

‎src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: deallocation through <TAG> at ALLOC[0x0] is forbidden
2-
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | self.1.deallocate(From::from(ptr.cast()), layout);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
@@ -25,6 +25,8 @@ LL | || drop(Box::from_raw(ptr)),
2525
| ^^^^^^^^^^^^^^^^^^
2626
= help: this transition corresponds to a temporary loss of write permissions until function exit
2727
= note: BACKTRACE (of the first span):
28+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
29+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
2830
= note: inside `<std::boxed::Box<i32> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC
2931
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
3032
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC

‎src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: deallocation through <TAG> at ALLOC[0x0] is forbidden
2-
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | self.1.deallocate(From::from(ptr.cast()), layout);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
@@ -25,6 +25,8 @@ LL | || drop(Box::from_raw(ptr)),
2525
| ^^^^^^^^^^^^^^^^^^
2626
= help: this transition corresponds to a temporary loss of write permissions until function exit
2727
= note: BACKTRACE (of the first span):
28+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
29+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
2830
= note: inside `<std::boxed::Box<i32> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC
2931
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
3032
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC

‎src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: deallocation through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
2-
--> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | unsafe { dealloc(ptr, l) };
5-
| ^^^^^^^^^^^^^^^ deallocation through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the allocation of the accessed tag <TAG> (root of the allocation) also contains the strongly protected tag <TAG>
@@ -18,7 +18,13 @@ help: the strongly protected tag <TAG> was created here, in the initial state Re
1818
LL | fn test(_x: &mut (), ptr: *mut u8, l: Layout) {
1919
| ^^
2020
= note: BACKTRACE (of the first span):
21-
= note: inside `test` at tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
21+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
22+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
23+
note: inside `test`
24+
--> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
25+
|
26+
LL | unsafe { dealloc(ptr, l) };
27+
| ^^^^^^^^^^^^^^^
2228
note: inside `main`
2329
--> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
2430
|

‎src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
2-
--> tests/fail/data_race/dealloc_read_race1.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | / __rust_dealloc(
5-
LL | |
6-
LL | | ptr.0 as *mut _,
7-
LL | | std::mem::size_of::<usize>(),
8-
LL | | std::mem::align_of::<usize>(),
9-
LL | | );
10-
| |_____________^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
116
|
127
help: and (1) occurred earlier here
138
--> tests/fail/data_race/dealloc_read_race1.rs:LL:CC
@@ -17,7 +12,18 @@ LL | let _val = *ptr.0;
1712
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1813
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1914
= note: BACKTRACE (of the first span) on thread `unnamed-ID`:
20-
= note: inside closure at tests/fail/data_race/dealloc_read_race1.rs:LL:CC
15+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
16+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
17+
note: inside closure
18+
--> tests/fail/data_race/dealloc_read_race1.rs:LL:CC
19+
|
20+
LL | / __rust_dealloc(
21+
LL | |
22+
LL | | ptr.0 as *mut _,
23+
LL | | std::mem::size_of::<usize>(),
24+
LL | | std::mem::align_of::<usize>(),
25+
LL | | );
26+
| |_____________^
2127

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

‎src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
2-
--> tests/fail/data_race/dealloc_write_race1.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | / __rust_dealloc(
5-
LL | |
6-
LL | | ptr.0 as *mut _,
7-
LL | | std::mem::size_of::<usize>(),
8-
LL | | std::mem::align_of::<usize>(),
9-
LL | | );
10-
| |_____________^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
116
|
127
help: and (1) occurred earlier here
138
--> tests/fail/data_race/dealloc_write_race1.rs:LL:CC
@@ -17,7 +12,18 @@ LL | *ptr.0 = 2;
1712
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1813
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1914
= note: BACKTRACE (of the first span) on thread `unnamed-ID`:
20-
= note: inside closure at tests/fail/data_race/dealloc_write_race1.rs:LL:CC
15+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
16+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
17+
note: inside closure
18+
--> tests/fail/data_race/dealloc_write_race1.rs:LL:CC
19+
|
20+
LL | / __rust_dealloc(
21+
LL | |
22+
LL | | ptr.0 as *mut _,
23+
LL | | std::mem::size_of::<usize>(),
24+
LL | | std::mem::align_of::<usize>(),
25+
LL | | );
26+
| |_____________^
2127

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

‎src/tools/miri/tests/fail/memleak.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here:
1+
error: memory leaked: ALLOC (C heap, size: 4, align: 4), allocated here:
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
3+
|
4+
LL | unsafe { libc::malloc(layout.size()) as *mut u8 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: BACKTRACE:
8+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::alloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
9+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
10+
note: inside `main`
211
--> tests/fail/memleak.rs:LL:CC
312
|
413
LL | std::mem::forget(Box::new(42));
514
| ^^^^^^^^^^^^
6-
|
7-
= note: BACKTRACE:
8-
= note: inside `main` at tests/fail/memleak.rs:LL:CC
915

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

‎src/tools/miri/tests/fail/memleak_no_backtrace.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: memory leaked: ALLOC (Rust heap, size: 4, align: 4)
1+
error: memory leaked: ALLOC (C heap, size: 4, align: 4)
22

33
note: set `MIRIFLAGS=-Zmiri-ignore-leaks` to disable this check
44

‎src/tools/miri/tests/fail/memleak_rc.stderr

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
error: memory leaked: ALLOC (Rust heap, SIZE, ALIGN), allocated here:
2-
--> RUSTLIB/alloc/src/rc.rs:LL:CC
1+
error: memory leaked: ALLOC (C heap, size: 32, align: 16), allocated here:
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | Box::leak(Box::new(RcInner { strong: Cell::new(1), weak: Cell::new(1), value }))
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | unsafe { libc::malloc(layout.size()) as *mut u8 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: BACKTRACE:
8+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::alloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
9+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
810
= note: inside `std::rc::Rc::<std::cell::RefCell<std::option::Option<Dummy>>>::new` at RUSTLIB/alloc/src/rc.rs:LL:CC
911
note: inside `main`
1012
--> tests/fail/memleak_rc.rs:LL:CC

‎src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
error: Undefined Behavior: deallocating while item [Unique for <TAG>] is strongly protected
2-
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | self.1.deallocate(From::from(ptr.cast()), layout);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating while item [Unique for <TAG>] is strongly protected
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating while item [Unique for <TAG>] is strongly protected
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
88
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
99
= note: BACKTRACE:
10+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
11+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
1012
= note: inside `<std::boxed::Box<i32> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC
1113
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
1214
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC

‎src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
2-
--> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | dealloc(ptr2, Layout::from_size_align_unchecked(1, 1));
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
88
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
@@ -17,7 +17,13 @@ help: <TAG> was later invalidated at offsets [0x0..0x1] by a write access
1717
LL | ptr1.write(0);
1818
| ^^^^^^^^^^^^^
1919
= note: BACKTRACE (of the first span):
20-
= note: inside `main` at tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
20+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
21+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
22+
note: inside `main`
23+
--> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
24+
|
25+
LL | dealloc(ptr2, Layout::from_size_align_unchecked(1, 1));
26+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2127

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

‎src/tools/miri/tests/fail/tls_macro_leak.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here:
1+
error: memory leaked: ALLOC (C heap, size: 4, align: 4), allocated here:
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
3+
|
4+
LL | unsafe { libc::malloc(layout.size()) as *mut u8 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: BACKTRACE:
8+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::alloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
9+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
10+
note: inside closure
211
--> tests/fail/tls_macro_leak.rs:LL:CC
312
|
413
LL | cell.set(Some(Box::leak(Box::new(123))));
514
| ^^^^^^^^^^^^^
6-
|
7-
= note: BACKTRACE:
8-
= note: inside closure at tests/fail/tls_macro_leak.rs:LL:CC
915
= note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::try_with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC
1016
= note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC
1117
note: inside closure

‎src/tools/miri/tests/fail/tls_static_leak.stderr

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here:
1+
error: memory leaked: ALLOC (C heap, size: 4, align: 4), allocated here:
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
3+
|
4+
LL | unsafe { libc::malloc(layout.size()) as *mut u8 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: BACKTRACE:
8+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::alloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
9+
= note: inside `std::alloc::__default_lib_allocator::__rust_alloc` at RUSTLIB/std/src/alloc.rs:LL:CC
10+
note: inside closure
211
--> tests/fail/tls_static_leak.rs:LL:CC
312
|
413
LL | TLS.set(Some(Box::leak(Box::new(123))));
514
| ^^^^^^^^^^^^^
6-
|
7-
= note: BACKTRACE:
8-
= note: inside closure at tests/fail/tls_static_leak.rs:LL:CC
915

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

‎src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: deallocation through <TAG> at ALLOC[0x0] is forbidden
2-
--> RUSTLIB/alloc/src/boxed.rs:LL:CC
2+
--> RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
33
|
4-
LL | self.1.deallocate(From::from(ptr.cast()), layout);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
4+
LL | unsafe { libc::free(ptr as *mut libc::c_void) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the allocation of the accessed tag <TAG> also contains the strongly protected tag <TAG>
@@ -18,6 +18,8 @@ help: the strongly protected tag <TAG> was created here, in the initial state Re
1818
LL | fn inner(x: &mut i32, f: fn(*mut i32)) {
1919
| ^
2020
= note: BACKTRACE (of the first span):
21+
= note: inside `std::sys::alloc::unix::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/unix.rs:LL:CC
22+
= note: inside `std::alloc::__default_lib_allocator::__rust_dealloc` at RUSTLIB/std/src/alloc.rs:LL:CC
2123
= note: inside `<std::boxed::Box<i32> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/boxed.rs:LL:CC
2224
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
2325
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC

‎src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | drop(slice1.cmp(slice2));
1616
| ^^^^^^^^^^^^^^^^^^
1717

1818
Uninitialized memory occurred at ALLOC[0x4..0x10], in this allocation:
19-
ALLOC (Rust heap, size: 32, align: 8) {
19+
ALLOC (C heap, size: 32, align: 16) {
2020
0x00 │ 41 42 43 44 __ __ __ __ __ __ __ __ __ __ __ __ │ ABCD░░░░░░░░░░░░
2121
0x10 │ 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ .░░░░░░░░░░░░░░░
2222
}

‎src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | drop(slice1.cmp(slice2));
1616
| ^^^^^^^^^^^^^^^^^^
1717

1818
Uninitialized memory occurred at ALLOC[0x4..0x8], in this allocation:
19-
ALLOC (Rust heap, size: 16, align: 8) {
19+
ALLOC (C heap, size: 16, align: 16) {
2020
╾42[ALLOC]<TAG> (1 ptr byte)╼ 12 13 ╾43[ALLOC]<TAG> (1 ptr byte)╼ __ __ __ __ __ __ __ __ __ __ __ __ │ ━..━░░░░░░░░░░░░
2121
}
2222
ALLOC (global (static or const), size: 1, align: 1) {

0 commit comments

Comments
 (0)
Please sign in to comment.