gramseyer opened issue #12423:
Test Case
This test, when compiled to webassembly, succeeds with cranelift and fails on winch. (both succeed on x86). The compiled wasm is attached.
#![no_std] use sha2::Digest; use hex_literal::hex; #[unsafe(export_name = "FFFFFFFFFFFFFFFF")] pub extern "C" fn test_hello() -> () { let hash = sha2::Sha256::digest(b"hello"); let expect : [u8;32] = hex!("2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824"); assert_eq!(hash, expect.into()); }Steps to Reproduce
wasmtime run --codegen compiler=winch --invoke FFFFFFFFFFFFFFFF hash_bug.wasm
wasmtime run --codegen compiler=cranelift --invoke FFFFFFFFFFFFFFFF hash_bug.wasmExpected Results
Both commands should run the wasm function and exit 0.
Actual Results
Cranelift succeeds, winch fails.
% wasmtime run --codegen compiler=cranelift --invoke FFFFFFFFFFFFFFFF hash_bug.wat % wasmtime run --codegen compiler=winch --invoke FFFFFFFFFFFFFFFF hash_bug.wat Error: failed to run main module `hash_bug.wat` Caused by: 0: failed to invoke `FFFFFFFFFFFFFFFF` 1: error while executing at wasm backtrace: 0: 0x7a4 - hash_bug.wasm!FFFFFFFFFFFFFFFF 2: wasm trap: wasm `unreachable` instruction executedVersions and Environment
Wasmtime: 41.0.0 (bug also present on 40.0.0. I have not tested earlier versions)
Operating system: MacOS Tahoe 26.2
Architecture: Aarch64
Extra Info
I attach the compiled wasm module below (as a WAT, renamed to a .txt; github won't allow a .wat or .wasm upload).
alexcrichton added the winch label to Issue #12423.
alexcrichton added the bug label to Issue #12423.
alexcrichton commented on issue #12423:
cc @saulecabrera @jeffcharles
saulecabrera commented on issue #12423:
Thanks for the report, taking a look.
primoly commented on issue #12423:
Looks like
i32.rotlandi64.rotlare broken on AArch64 Winch.Shrunken demo based on @gramseyer’s original module:
(module (func i32.const 23520 i32.const 26 i32.rotl i32.const 2147484015 i32.ne if unreachable end ) (export "FFFFFFFFFFFFFFFF" (func 0)) )Simpler example:
(module (func i32.const 1 i32.const 1 i32.rotl i32.const 2 i32.ne if unreachable end ) (export "a" (func 0)) )
Last updated: Jan 29 2026 at 13:25 UTC