miri: ICE on invalid terminators#69830
Conversation
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
They get lowered by the generator transform, so if you run before that you'll still encounter them. If you run after it they should all be gone though. |
|
Yeah we definitely run after that. |
|
|
|
@matthewjasper Ah! Here's a Miri reproducer then: #![feature(unwind_attributes)]
#[unwind(aborts)]
fn panic_abort() { panic!() }
fn main() {
panic_abort();
} |
|
All right, I think this is ready now. |
This comment has been minimized.
This comment has been minimized.
6587938 to
8a8870f
Compare
|
Shouldn't the abort intrinsic also forward to this new machine hook? You can probably run your miri repro under unleash, too. |
So far the core Miri engine knows nothing about the abort intrinsic. You want to see it added to
Yeah but we don't actually support aborting in CTFE so I am not entirely sure about the point of that...^^ |
|
I added the abort intrinsic. At some point we should probably just move all the intrinsics from Miri to here... well, all except atomics and those requiring host floating point maybe. |
|
@bors r+ |
|
📌 Commit 911c75f has been approved by |
…=oli-obk miri: ICE on invalid terminators We've run a lot of MIR in Miri (including some generators) and never seen these. @tmandry is it correct that `Yield` and `GeneratorDrop` get lowered away? @eddyb @oli-obk what's with this `Abort` that does not seem to ever actually exist? Codegen *does* seem to handle it, so I wonder why Miri can get away without that. In fact, codegen handles it twice: https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/block.rs#L796 https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/mod.rs#L296
…=oli-obk miri: ICE on invalid terminators We've run a lot of MIR in Miri (including some generators) and never seen these. @tmandry is it correct that `Yield` and `GeneratorDrop` get lowered away? @eddyb @oli-obk what's with this `Abort` that does not seem to ever actually exist? Codegen *does* seem to handle it, so I wonder why Miri can get away without that. In fact, codegen handles it twice: https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/block.rs#L796 https://github.com/rust-lang/rust/blob/1d5241c96208ca7d925442b1a5fa45ad18717a6f/src/librustc_codegen_ssa/mir/mod.rs#L296
Rollup of 10 pull requests Successful merges: - #68899 (Add Display and Error impls for proc_macro::LexError) - #69011 (Document unsafe blocks in core::fmt) - #69674 (Rename DefKind::Method and TraitItemKind::Method ) - #69705 (Toolstate: remove redundant beta-week check.) - #69722 (Tweak output for invalid negative impl AST errors) - #69747 (Rename rustc guide) - #69792 (Implement Error for TryReserveError) - #69830 (miri: ICE on invalid terminators) - #69921 (rustdoc: remove unused import) - #69945 (update outdated comment) Failed merges: r? @ghost
miri engine: fix treatment of abort intrinsic I screwed up in rust-lang#69830 and added `abort` to the wrong block of intrinsics, namely the one that actually has a return place. So that branch was never actually reached. r? @oli-obk
We've run a lot of MIR in Miri (including some generators) and never seen these.
@tmandry is it correct that
YieldandGeneratorDropget lowered away?@eddyb @oli-obk what's with this
Abortthat does not seem to ever actually exist? Codegen does seem to handle it, so I wonder why Miri can get away without that. In fact, codegen handles it twice:rust/src/librustc_codegen_ssa/mir/block.rs
Line 796 in 1d5241c
rust/src/librustc_codegen_ssa/mir/mod.rs
Line 296 in 1d5241c