Closed
Description
Miri sometimes ICEs when printing the backtrace of a failure with mir-opt-level=2
:
RUST_BACKTRACE=1 ./miri run tests/compile-fail/deallocate-twice.rs -Zmir-opt-level=2
gives
15: core::panicking::panic_bounds_check
at src/libcore/panicking.rs:96
16: <usize as core::slice::SliceIndex<[T]>>::index
at /rustc/cba93685377bc74a2fde1eb8e7a086039b038e94/src/libcore/slice/mod.rs:2796
17: core::slice::<impl core::ops::index::Index<I> for [T]>::index
at /rustc/cba93685377bc74a2fde1eb8e7a086039b038e94/src/libcore/slice/mod.rs:2647
18: <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index
at /rustc/cba93685377bc74a2fde1eb8e7a086039b038e94/src/liballoc/vec.rs:1861
19: <rustc_index::vec::IndexVec<I,T> as core::ops::index::Index<I>>::index
at /rustc/cba93685377bc74a2fde1eb8e7a086039b038e94/src/librustc_index/vec.rs:740
20: rustc_mir::interpret::eval_context::InterpCx<M>::generate_stacktrace
at /rustc/cba93685377bc74a2fde1eb8e7a086039b038e94/src/librustc_mir/interpret/eval_context.rs:755
21: miri::eval::eval_main
at src/eval.rs:225
22: <miri::MiriCompilerCalls as rustc_driver::Callbacks>::after_analysis::{{closure}}
at src/bin/miri.rs:52
What happens here is that the following indexing operation is out-of-bounds:
This looks like broken MIR to me.
(This is not a new error, but somehow it seems I did not report it when this started happening quite a while ago.)