Stream: git-wasmtime

Topic: wasmtime / issue #5882 Cranelift: `bus error` with unalig...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2023 at 14:57):

afonso360 labeled issue #5882:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64gc

function %a() -> i32 system_v {
    ss0 = explicit_slot 7

block0:
    v10 = iconst.i8 0
    v11 = iconst.i16 0
    v12 = iconst.i32 0
    v13 = iconst.i64 0
    v14 = uextend.i128 v13  ; v13 = 0
    stack_store v12, ss0  ; v12 = 0
    stack_store v11, ss0+4  ; v11 = 0
    stack_store v10, ss0+6  ; v10 = 0

    v22 = stack_addr.i64 ss0+3
    v24 = atomic_rmw.i32 and v22, v12
    return v24
}

; run: %a() == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

afonso@DESKTOP-VSTS4BC:~/git/wasmtime/cranelift$ cargo run --target=riscv64gc-unknown-linux-gnu -- test ./lmao.clif
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/afonso/git/qemu/qemu-7.2.0/build/qemu-riscv64 -cpu any,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zbkc=true,zbkx=true,zknd=true,zkne=true,zknh=true,zksed=true,zksh=true,zkr=true -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/afonso/git/wasmtime/target/riscv64gc-unknown-linux-gnu/debug/clif-util test ./lmao.clif`
Bus error

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: RISC-V 64

Extra Info

We've had a similar issue in the past with AArch64: #5483

We should restrict the current lowering to only if the target implements the Zam extension. Although that is not ratified yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2023 at 14:57):

afonso360 opened issue #5882:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64gc

function %a() -> i32 system_v {
    ss0 = explicit_slot 7

block0:
    v10 = iconst.i8 0
    v11 = iconst.i16 0
    v12 = iconst.i32 0
    v13 = iconst.i64 0
    v14 = uextend.i128 v13  ; v13 = 0
    stack_store v12, ss0  ; v12 = 0
    stack_store v11, ss0+4  ; v11 = 0
    stack_store v10, ss0+6  ; v10 = 0

    v22 = stack_addr.i64 ss0+3
    v24 = atomic_rmw.i32 and v22, v12
    return v24
}

; run: %a() == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

afonso@DESKTOP-VSTS4BC:~/git/wasmtime/cranelift$ cargo run --target=riscv64gc-unknown-linux-gnu -- test ./lmao.clif
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/afonso/git/qemu/qemu-7.2.0/build/qemu-riscv64 -cpu any,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zbkc=true,zbkx=true,zknd=true,zkne=true,zknh=true,zksed=true,zksh=true,zkr=true -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/afonso/git/wasmtime/target/riscv64gc-unknown-linux-gnu/debug/clif-util test ./lmao.clif`
Bus error

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: RISC-V 64

Extra Info

We've had a similar issue in the past with AArch64: #5483

We should restrict the current lowering to only if the target implements the Zam extension. Although that is not ratified yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2023 at 14:57):

afonso360 labeled issue #5882:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64gc

function %a() -> i32 system_v {
    ss0 = explicit_slot 7

block0:
    v10 = iconst.i8 0
    v11 = iconst.i16 0
    v12 = iconst.i32 0
    v13 = iconst.i64 0
    v14 = uextend.i128 v13  ; v13 = 0
    stack_store v12, ss0  ; v12 = 0
    stack_store v11, ss0+4  ; v11 = 0
    stack_store v10, ss0+6  ; v10 = 0

    v22 = stack_addr.i64 ss0+3
    v24 = atomic_rmw.i32 and v22, v12
    return v24
}

; run: %a() == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

afonso@DESKTOP-VSTS4BC:~/git/wasmtime/cranelift$ cargo run --target=riscv64gc-unknown-linux-gnu -- test ./lmao.clif
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/afonso/git/qemu/qemu-7.2.0/build/qemu-riscv64 -cpu any,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zbkc=true,zbkx=true,zknd=true,zkne=true,zknh=true,zksed=true,zksh=true,zkr=true -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/afonso/git/wasmtime/target/riscv64gc-unknown-linux-gnu/debug/clif-util test ./lmao.clif`
Bus error

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: RISC-V 64

Extra Info

We've had a similar issue in the past with AArch64: #5483

We should restrict the current lowering to only if the target implements the Zam extension. Although that is not ratified yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2023 at 14:58):

afonso360 labeled issue #5882:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64gc

function %a() -> i32 system_v {
    ss0 = explicit_slot 7

block0:
    v10 = iconst.i8 0
    v11 = iconst.i16 0
    v12 = iconst.i32 0
    v13 = iconst.i64 0
    v14 = uextend.i128 v13  ; v13 = 0
    stack_store v12, ss0  ; v12 = 0
    stack_store v11, ss0+4  ; v11 = 0
    stack_store v10, ss0+6  ; v10 = 0

    v22 = stack_addr.i64 ss0+3
    v24 = atomic_rmw.i32 and v22, v12
    return v24
}

; run: %a() == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

afonso@DESKTOP-VSTS4BC:~/git/wasmtime/cranelift$ cargo run --target=riscv64gc-unknown-linux-gnu -- test ./lmao.clif
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/afonso/git/qemu/qemu-7.2.0/build/qemu-riscv64 -cpu any,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zbkc=true,zbkx=true,zknd=true,zkne=true,zknh=true,zksed=true,zksh=true,zkr=true -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/afonso/git/wasmtime/target/riscv64gc-unknown-linux-gnu/debug/clif-util test ./lmao.clif`
Bus error

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: RISC-V 64

Extra Info

We've had a similar issue in the past with AArch64: #5483

We should restrict the current lowering to only if the target implements the Zam extension. Although that is not ratified yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2023 at 15:07):

afonso360 edited issue #5882:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64gc

function %a() -> i32 system_v {
    ss0 = explicit_slot 7

block0:
    v10 = iconst.i8 0
    v11 = iconst.i16 0
    v12 = iconst.i32 0
    v13 = iconst.i64 0
    v14 = uextend.i128 v13  ; v13 = 0
    stack_store v12, ss0  ; v12 = 0
    stack_store v11, ss0+4  ; v11 = 0
    stack_store v10, ss0+6  ; v10 = 0

    v22 = stack_addr.i64 ss0+3
    v24 = atomic_rmw.i32 and v22, v12
    return v24
}

; run: %a() == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

afonso@DESKTOP-VSTS4BC:~/git/wasmtime/cranelift$ cargo run --target=riscv64gc-unknown-linux-gnu -- test ./lmao.clif
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/afonso/git/qemu/qemu-7.2.0/build/qemu-riscv64 -cpu any,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zbkc=true,zbkx=true,zknd=true,zkne=true,zknh=true,zksed=true,zksh=true,zkr=true -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/afonso/git/wasmtime/target/riscv64gc-unknown-linux-gnu/debug/clif-util test ./lmao.clif`
Bus error

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: RISC-V 64

Extra Info

We've had a similar issue in the past with AArch64: #5483

We should restrict the current lowering to only if the memflags indicate it is aligned, or if target implements the Zam extension. Although that is not ratified yet.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 25 2023 at 15:07):

afonso360 edited issue #5882:

:wave: Hey,

.clif Test Case

test interpret
test run
target riscv64gc

function %a() -> i32 system_v {
    ss0 = explicit_slot 7

block0:
    v10 = iconst.i8 0
    v11 = iconst.i16 0
    v12 = iconst.i32 0
    v13 = iconst.i64 0
    v14 = uextend.i128 v13  ; v13 = 0
    stack_store v12, ss0  ; v12 = 0
    stack_store v11, ss0+4  ; v11 = 0
    stack_store v10, ss0+6  ; v10 = 0

    v22 = stack_addr.i64 ss0+3
    v24 = atomic_rmw.i32 and v22, v12
    return v24
}

; run: %a() == 0

Steps to Reproduce

Expected Results

The test to pass

Actual Results

afonso@DESKTOP-VSTS4BC:~/git/wasmtime/cranelift$ cargo run --target=riscv64gc-unknown-linux-gnu -- test ./lmao.clif
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `/home/afonso/git/qemu/qemu-7.2.0/build/qemu-riscv64 -cpu any,zba=true,zbb=true,zbc=true,zbs=true,zbkb=true,zbkc=true,zbkx=true,zknd=true,zkne=true,zknh=true,zksed=true,zksh=true,zkr=true -L /usr/riscv64-linux-gnu -E LD_LIBRARY_PATH=/usr/riscv64-linux-gnu/lib /home/afonso/git/wasmtime/target/riscv64gc-unknown-linux-gnu/debug/clif-util test ./lmao.clif`
Bus error

Versions and Environment

Cranelift version or commit: main

Operating system: Linux

Architecture: RISC-V 64

Extra Info

We've had a similar issue in the past with AArch64: #5483

We should restrict the current lowering to only if the memflags indicate it is aligned, or if the target implements the Zam extension. Although that is not ratified yet.


Last updated: Nov 22 2024 at 17:03 UTC