Stream: git-wasmtime

Topic: wasmtime / issue #11545 single-pass regalloc: Corruption ...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2025 at 19:39):

alexcrichton opened issue #11545:

This currently fails on main:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Osignals-based-traps=n -Wexceptions=y
...
Error: failed to run script file '/home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast'

Caused by:
    0: failed directive on /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast:49
    1: error while executing at wasm backtrace:
           0:    0x120 - <unknown>!<wasm function 7>
    2: wasm trap: wasm `unreachable` instruction executed

Removing -Osignals-based-traps=n yields a panic:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Wexceptions=y
...

thread 'main' panicked at /home/alex/code/wasmtime/crates/unwinder/src/exception_table.rs:168:25:
Wasmtime exception unwind info only supports dynamic contexts on the stack
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2025 at 19:40):

alexcrichton commented on issue #11545:

cc https://github.com/bytecodealliance/wasmtime/pull/11533 and @d-sonuga

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2025 at 19:40):

alexcrichton added the fuzz-bug label to Issue #11545.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 26 2025 at 19:40):

alexcrichton added the cranelift:area:regalloc label to Issue #11545.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 06 2025 at 21:30):

d-sonuga commented on issue #11545:

I see that the issue happens because of the following scenario:

branch inst: def v0 (fixed: p0). succs: [block1(v0)]

The single-pass relies on moving branch args (v0 in the case above) to expected spillslots of the successor blocks before branch instructions. That's not possible here because the vreg used as the branch arg is defined in the branch instruction.

Before I change that to account for this scenario, I need to know, can these vregs have any of the possible kinds of constraints?
I mean, is it possible for v0 in the above scenario to also be an any-reg constraint, or stack-only or no constraint?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 08 2025 at 15:38):

cfallin commented on issue #11545:

Ah, yes, indeed, the try_call defines its return values and is also a terminator. The retvals' constraints will either be fixed-reg or any; the latter hppens when there are more return values than the ABI puts in registers. In practice we shouldn't see stack or reg, so if it's much more work to support those on terminators too, then no need at the moment.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2025 at 20:16):

cfallin closed issue #11545:

This currently fails on main:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Osignals-based-traps=n -Wexceptions=y
...
Error: failed to run script file '/home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast'

Caused by:
    0: failed directive on /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast:49
    1: error while executing at wasm backtrace:
           0:    0x120 - <unknown>!<wasm function 7>
    2: wasm trap: wasm `unreachable` instruction executed

Removing -Osignals-based-traps=n yields a panic:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Wexceptions=y
...

thread 'main' panicked at /home/alex/code/wasmtime/crates/unwinder/src/exception_table.rs:168:25:
Wasmtime exception unwind info only supports dynamic contexts on the stack
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2025 at 20:22):

cfallin reopened issue #11545:

This currently fails on main:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Osignals-based-traps=n -Wexceptions=y
...
Error: failed to run script file '/home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast'

Caused by:
    0: failed directive on /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast:49
    1: error while executing at wasm backtrace:
           0:    0x120 - <unknown>!<wasm function 7>
    2: wasm trap: wasm `unreachable` instruction executed

Removing -Osignals-based-traps=n yields a panic:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Wexceptions=y
...

thread 'main' panicked at /home/alex/code/wasmtime/crates/unwinder/src/exception_table.rs:168:25:
Wasmtime exception unwind info only supports dynamic contexts on the stack
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2025 at 20:22):

cfallin commented on issue #11545:

(I'll keep this issue open until we do a release in RA2 and pull the new version over, but thanks to Demilade for addressing the actual issue in the regalloc!)

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2025 at 23:42):

abrown closed issue #11545:

This currently fails on main:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Osignals-based-traps=n -Wexceptions=y
...
Error: failed to run script file '/home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast'

Caused by:
    0: failed directive on /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast:49
    1: error while executing at wasm backtrace:
           0:    0x120 - <unknown>!<wasm function 7>
    2: wasm trap: wasm `unreachable` instruction executed

Removing -Osignals-based-traps=n yields a panic:

$ cargo run wast /home/alex/code/wasmtime/tests/spec_testsuite/proposals/wasm-3.0/throw.wast --target x86_64-unknown-linux-gnu -Oregalloc-algorithm=single-pass -Wexceptions=y
...

thread 'main' panicked at /home/alex/code/wasmtime/crates/unwinder/src/exception_table.rs:168:25:
Wasmtime exception unwind info only supports dynamic contexts on the stack
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


Last updated: Dec 06 2025 at 07:03 UTC