Stream: git-wasmtime

Topic: wasmtime / issue #11012 Inconsistent error types and retu...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 12:43):

akldc opened issue #11012:

.clif Test Case

test optimize
    set opt_level=none
    set preserve_frame_pointers=true
    set enable_multi_ret_implicit_sret=true

function %main() -> i32 fast {

block0():
    v2 = iconst.i32 0
    v16 = srem v2, v2
    return v16
}

; print: %main()

Run this test case on four architectures.

[x86    ] Floating point exception
return code: -8

[aarch64] qemu: uncaught target signal 4 (Illegal instruction) - core dumped
[aarch64] Illegal instruction
return code: -4

[riscv64] Illegal instruction
return code: -4

[s390x  ] qemu: uncaught target signal 8 (Floating point exception) - core dumped
[s390x  ] Illegal instruction
return code: -8

When running srem with operands 0 and 0, the error types and return values are inconsistent among the four architectures.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 12:43):

akldc added the bug label to Issue #11012.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 12:43):

akldc added the cranelift label to Issue #11012.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 13:39):

bjorn3 commented on issue #11012:

This is expected. On some architectures division by zero emits SIGFPE, on others SIGILL.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 14:13):

akldc commented on issue #11012:

@bjorn3
Ok,thanks

view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2025 at 14:13):

akldc closed issue #11012:

.clif Test Case

test optimize
    set opt_level=none
    set preserve_frame_pointers=true
    set enable_multi_ret_implicit_sret=true

function %main() -> i32 fast {

block0():
    v2 = iconst.i32 0
    v16 = srem v2, v2
    return v16
}

; print: %main()

Run this test case on four architectures.

[x86    ] Floating point exception
return code: -8

[aarch64] qemu: uncaught target signal 4 (Illegal instruction) - core dumped
[aarch64] Illegal instruction
return code: -4

[riscv64] Illegal instruction
return code: -4

[s390x  ] qemu: uncaught target signal 8 (Floating point exception) - core dumped
[s390x  ] Illegal instruction
return code: -8

When running srem with operands 0 and 0, the error types and return values are inconsistent among the four architectures.


Last updated: Jan 09 2026 at 13:15 UTC