jyn514 opened Issue #1648:
- What are the steps to reproduce the issue? Can you include a CLIF test case,
ideally reduced with thebugpoint
clif-util command?(bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ /bin/cat crash.c void foo(void) { switch (1) { while(1) case 1:; case 0:; } } (bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ cargo run crash.c --debug-asm Finished dev [unoptimized + debuginfo] target(s) in 0.11s Running `/home/joshua/.local/lib/cargo/target/debug/rcc crash.c --debug-asm` function u0:0() system_v { ; function 0: foo jt0 = jump_table [block5, block6] block0: v0 = iconst.i64 1 ; dummy jump block1 block2: jump block4 block4: v1 = bconst.b1 true ; while ((1) != ((long)(0))) brz v1, block5 jump block6 ; case 1 block6: ; loop start jump block4 ; case 0 block5: ; end switch jump block3 block1: jump block7 block7: br_table.i64 v0, block3, jt0 block3: return } The application panicked (crashed). Message: assertion failed: !self.opcode().is_branch() Location: /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/ir/instructions.rs:254
- What do you expect to happen? What does actually happen? Does it panic, and
if so, with which assertion?I don't know why this code doesn't work. It all seems valid to me and the panic doesn't tell me which instruction isn't valid. The verifier reports no errors and the panic happens only when defining the function.
- Which Cranelift version / commit hash / branch are you using?
cranelift 0.63.0
- If relevant, can you include some extra information about your environment?
(Rust version, operating system, architecture...)target is
x86_64-unknown-linux-gnu
jyn514 labeled Issue #1648:
- What are the steps to reproduce the issue? Can you include a CLIF test case,
ideally reduced with thebugpoint
clif-util command?(bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ /bin/cat crash.c void foo(void) { switch (1) { while(1) case 1:; case 0:; } } (bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ cargo run crash.c --debug-asm Finished dev [unoptimized + debuginfo] target(s) in 0.11s Running `/home/joshua/.local/lib/cargo/target/debug/rcc crash.c --debug-asm` function u0:0() system_v { ; function 0: foo jt0 = jump_table [block5, block6] block0: v0 = iconst.i64 1 ; dummy jump block1 block2: jump block4 block4: v1 = bconst.b1 true ; while ((1) != ((long)(0))) brz v1, block5 jump block6 ; case 1 block6: ; loop start jump block4 ; case 0 block5: ; end switch jump block3 block1: jump block7 block7: br_table.i64 v0, block3, jt0 block3: return } The application panicked (crashed). Message: assertion failed: !self.opcode().is_branch() Location: /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/ir/instructions.rs:254
- What do you expect to happen? What does actually happen? Does it panic, and
if so, with which assertion?I don't know why this code doesn't work. It all seems valid to me and the panic doesn't tell me which instruction isn't valid. The verifier reports no errors and the panic happens only when defining the function.
- Which Cranelift version / commit hash / branch are you using?
cranelift 0.63.0
- If relevant, can you include some extra information about your environment?
(Rust version, operating system, architecture...)target is
x86_64-unknown-linux-gnu
jyn514 labeled Issue #1648:
- What are the steps to reproduce the issue? Can you include a CLIF test case,
ideally reduced with thebugpoint
clif-util command?(bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ /bin/cat crash.c void foo(void) { switch (1) { while(1) case 1:; case 0:; } } (bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ cargo run crash.c --debug-asm Finished dev [unoptimized + debuginfo] target(s) in 0.11s Running `/home/joshua/.local/lib/cargo/target/debug/rcc crash.c --debug-asm` function u0:0() system_v { ; function 0: foo jt0 = jump_table [block5, block6] block0: v0 = iconst.i64 1 ; dummy jump block1 block2: jump block4 block4: v1 = bconst.b1 true ; while ((1) != ((long)(0))) brz v1, block5 jump block6 ; case 1 block6: ; loop start jump block4 ; case 0 block5: ; end switch jump block3 block1: jump block7 block7: br_table.i64 v0, block3, jt0 block3: return } The application panicked (crashed). Message: assertion failed: !self.opcode().is_branch() Location: /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/ir/instructions.rs:254
- What do you expect to happen? What does actually happen? Does it panic, and
if so, with which assertion?I don't know why this code doesn't work. It all seems valid to me and the panic doesn't tell me which instruction isn't valid. The verifier reports no errors and the panic happens only when defining the function.
- Which Cranelift version / commit hash / branch are you using?
cranelift 0.63.0
- If relevant, can you include some extra information about your environment?
(Rust version, operating system, architecture...)target is
x86_64-unknown-linux-gnu
github-actions[bot] commented on Issue #1648:
Subscribe to Label Action
cc @bnjbvr
<details>
This issue or pull request has been labeled: "cranelift"Thus the following users have been cc'd because of the following labels:
- bnjbvr: cranelift
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
jyn514 commented on Issue #1648:
<details><summary>Backtrace:</summary>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (4 post panic frames hidden) 4: cranelift_codegen::ir::instructions::InstructionData::branch_destination_mut::h9c17c2f91d91745e at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/ir/instructions.rs:254 5: cranelift_codegen::ir::function::Function::change_branch_destination::h34e5352f443feafe at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/ir/function.rs:274 6: cranelift_codegen::licm::create_pre_header::hab6d32d679ed4469 at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/licm.rs:90 7: cranelift_codegen::licm::do_licm::h90460effb4852ea5 at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/licm.rs:43 8: cranelift_codegen::context::Context::licm::ha20bea3caf3883c0 at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/context.rs:362 9: cranelift_codegen::context::Context::compile::h2eb376d6ffad127b at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/context.rs:172 10: cranelift_module::module::Module<B>::define_function::h838f26fe37268a15 at /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-module-0.63.0/src/module.rs:584 11: rcc::ir::Compiler<B>::compile_func::h5e9229dbdff90a19 at /home/joshua/src/rust/rcc/src/ir/mod.rs:389
</details>
I cannot reproduce this crash with bugpoint.
(bash@joshua-ThinkPad-P51s) ~/.../rust/cranelift ▶️ git log --oneline | head -n 1 864cf98c8 Update release notes, wasmtime 0.16, cranelift 0.63. (bash@joshua-ThinkPad-P51s) ~/.../rust/cranelift ▶️ cargo run bugpoint crash.clif --target x86_64-unknown-linux-gnu Finished dev [unoptimized + debuginfo] target(s) in 0.08s Running `/home/joshua/.local/lib/cargo/target/debug/clif-util bugpoint crash.clif --target x86_64-unknown-linux-gnu` Warning: Given function compiled successfully or gave a verifier error.
bjorn3 commented on Issue #1648:
Did you set
opt_level=speed
? This is probably https://github.com/bytecodealliance/wasmtime/issues/1080.
jyn514 commented on Issue #1648:
I did set opt_level=speed. With that I can reproduce with bugpoint:
$ cargo run bugpoint crash.clif --target x86_64-unknown-linux-gnu --set opt_level=speed Crash message: assertion failed: !self.opcode().is_branch() function u0:0() system_v { jt0 = jump_table [block5, block6] block0: v0 = iconst.i64 1 br_table v0, block3, jt0 block6: v1 = bconst.b1 false jump block6 block5: trap user0 block3: return }
cfallin closed Issue #1648:
- What are the steps to reproduce the issue? Can you include a CLIF test case,
ideally reduced with thebugpoint
clif-util command?(bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ /bin/cat crash.c void foo(void) { switch (1) { while(1) case 1:; case 0:; } } (bash@joshua-ThinkPad-P51s) ~/.../rust/rcc ▶️ cargo run crash.c --debug-asm Finished dev [unoptimized + debuginfo] target(s) in 0.11s Running `/home/joshua/.local/lib/cargo/target/debug/rcc crash.c --debug-asm` function u0:0() system_v { ; function 0: foo jt0 = jump_table [block5, block6] block0: v0 = iconst.i64 1 ; dummy jump block1 block2: jump block4 block4: v1 = bconst.b1 true ; while ((1) != ((long)(0))) brz v1, block5 jump block6 ; case 1 block6: ; loop start jump block4 ; case 0 block5: ; end switch jump block3 block1: jump block7 block7: br_table.i64 v0, block3, jt0 block3: return } The application panicked (crashed). Message: assertion failed: !self.opcode().is_branch() Location: /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cranelift-codegen-0.63.0/src/ir/instructions.rs:254
- What do you expect to happen? What does actually happen? Does it panic, and
if so, with which assertion?I don't know why this code doesn't work. It all seems valid to me and the panic doesn't tell me which instruction isn't valid. The verifier reports no errors and the panic happens only when defining the function.
- Which Cranelift version / commit hash / branch are you using?
cranelift 0.63.0
- If relevant, can you include some extra information about your environment?
(Rust version, operating system, architecture...)target is
x86_64-unknown-linux-gnu
Last updated: Dec 23 2024 at 12:05 UTC