Stream: git-wasmtime

Topic: wasmtime / issue #14939 aarch64: Wrong unwind info and pa...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 22 2026 at 16:49):

alexcrichton added the cranelift label to Issue #14939.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 22 2026 at 16:49):

alexcrichton added the cranelift:area:aarch64 label to Issue #14939.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 22 2026 at 16:50):

alexcrichton added the bug label to Issue #14939.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 22 2026 at 16:50):

alexcrichton opened issue #14939:

This test:

test unwind
set unwind_info
target aarch64-pc-windows-msvc

function %f() preserve_all {
    fn0 = %g()

block0:
    call fn0()
    return
}

fails with:

$ cargo run -p cranelift-tools -- test preserve-all.clif

thread 'worker #N' panicked at cranelift/codegen/src/isa/unwind/winarm64.rs:263:33:
Can't save registers before X19
FAIL preserve-all.clif: panicked in worker #N: Can't save registers before X19
1 tests
Error: 1 failure

This module:

(module
  (type $t (func (param i32) (result i32)))
  (table funcref (elem $g))
  (func $g (type $t) local.get 0 i32.const 1 i32.add)
  (func (export "f") (param i32) (result i32)
    local.get 0
    i32.const 0
    return_call_indirect (type $t)))

fails with guest debugging enabled:

$ cargo run --features all-arch -- compile --target aarch64-pc-windows-msvc -D guest-debug=y retcall_ind.wat

thread '<unnamed>' panicked at cranelift/codegen/src/isa/unwind/winarm64.rs:263:33:
Can't save registers before X19

Without guest debugging it compiles, but its unwind info is wrong:

$ cargo run --features all-arch -- compile --target aarch64-pc-windows-msvc retcall_ind.wat
$ aarch64-linux-gnu-objdump -d retcall_ind.cwasm
0000000000000020 <wasm[0]::function[1]>:
      20:   a9bf7bfd    stp x29, x30, [sp, #-16]!
      24:   910003fd    mov x29, sp
      28:   f8408050    ldur    x16, [x2, #8]
      2c:   f8418210    ldur    x16, [x16, #24]
      30:   91008210    add x16, x16, #0x20
      34:   eb3063ff    cmp sp, x16
      38:   54000363    b.cc    a4 <wasm[0]::function[1]+0x84>
      3c:   a9bf6bf3    stp x19, x26, [sp, #-16]!
      ...
$ aarch64-linux-gnu-objcopy -O binary --only-section=.xdata retcall_ind.cwasm retcall_ind.xdata
$ xxd -g1 retcall_ind.xdata | head -2
00000000: 05 00 00 08 e1 81 00 00 23 00 00 08 cc 01 e1 81  ........#.......
00000010: 3a 00 00 30 01 da 01 da 81 db 01 db 81 cc 01 cc  :..0............

The .xdata entry for function[1] is at offset 0x8, and its unwind codes
are cc 01 e1 81:

<details>
<summary>LLM summary, if helpful</summary>

All three are in cranelift/codegen/src/isa/unwind/winarm64.rs:

</details>


Last updated: Oct 31 2026 at 23:03 UTC