Stream: git-wasmtime

Topic: wasmtime / issue #12317 Cranelift: Pulley ISA exception_p...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 11 2026 at 22:54):

zzjas opened issue #12317:

.clif Test Case

test compile
target pulley64

function %trigger_bug(i32) -> i32 {
    sig0 = (i32) -> i32 winch
    fn0 = %callee(i32) -> i32 winch

    block0(v0: i32):
        ; try_call triggers the bug by invoking exception handling codegen
        ; Note: We omit exn0 because exception_payload_types is empty
        try_call fn0(v0), sig0, block1(ret0), [ default: block2 ]

    block1(v1: i32):
        return v1

    block2:
        v3 = iconst.i32 -1
        return v3
}

Steps to Reproduce

RUST_BACKTRACE=1 cargo run -p cranelift-tools --bin clif-util -- compile --target pulley64 -p test.clif

Expected Results

No assertion failure

Actual Results

thread 'main' (138509) panicked at cranelift/codegen/src/machinst/abi.rs:2041:13:
assertion `left == right` failed
  left: 0
 right: 2

Versions and Environment

Cranelift version or commit: 67ce1ef23b8a5fb8ab293828cd719402b83d5b5b

Operating system: Ubuntu 22.04.5

Architecture: x86_64

Extra Info

Pulley exception_payload_regs unconditionally returns 2 registers:

https://github.com/bytecodealliance/wasmtime/blob/67ce1ef23b8a5fb8ab293828cd719402b83d5b5b/cranelift/codegen/src/isa/pulley_shared/abi.rs#L563-L569

Other ISAs (x64, aarch64, s390x, riscv64) match on call_conv and return &[] for unsupported conventions like Winch. When try_call is compiled with Winch convention on Pulley, exception_payload_types(Winch) returns 0 elements while exception_payload_regs() returns 2, triggering the assertion at abi.rs:2041.

Thanks for looking into this and please let us know if we missed anything or if you have any feedback!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 11 2026 at 22:54):

zzjas added the bug label to Issue #12317.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 11 2026 at 22:54):

zzjas added the cranelift label to Issue #12317.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 21:56):

fitzgen commented on issue #12317:

Thanks for the report! Fix in https://github.com/bytecodealliance/wasmtime/pull/12325

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 22:43):

fitzgen closed issue #12317:

.clif Test Case

test compile
target pulley64

function %trigger_bug(i32) -> i32 {
    sig0 = (i32) -> i32 winch
    fn0 = %callee(i32) -> i32 winch

    block0(v0: i32):
        ; try_call triggers the bug by invoking exception handling codegen
        ; Note: We omit exn0 because exception_payload_types is empty
        try_call fn0(v0), sig0, block1(ret0), [ default: block2 ]

    block1(v1: i32):
        return v1

    block2:
        v3 = iconst.i32 -1
        return v3
}

Steps to Reproduce

RUST_BACKTRACE=1 cargo run -p cranelift-tools --bin clif-util -- compile --target pulley64 -p test.clif

Expected Results

No assertion failure

Actual Results

thread 'main' (138509) panicked at cranelift/codegen/src/machinst/abi.rs:2041:13:
assertion `left == right` failed
  left: 0
 right: 2

Versions and Environment

Cranelift version or commit: 67ce1ef23b8a5fb8ab293828cd719402b83d5b5b

Operating system: Ubuntu 22.04.5

Architecture: x86_64

Extra Info

Pulley exception_payload_regs unconditionally returns 2 registers:

https://github.com/bytecodealliance/wasmtime/blob/67ce1ef23b8a5fb8ab293828cd719402b83d5b5b/cranelift/codegen/src/isa/pulley_shared/abi.rs#L563-L569

Other ISAs (x64, aarch64, s390x, riscv64) match on call_conv and return &[] for unsupported conventions like Winch. When try_call is compiled with Winch convention on Pulley, exception_payload_types(Winch) returns 0 elements while exception_payload_regs() returns 2, triggering the assertion at abi.rs:2041.

Thanks for looking into this and please let us know if we missed anything or if you have any feedback!


Last updated: Jan 29 2026 at 13:25 UTC