Stream: git-wasmtime

Topic: wasmtime / issue #4656 Cranelift: Misscompilation when en...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 14:10):

afonso360 labeled issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 14:10):

afonso360 labeled issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 14:10):

afonso360 opened issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 14:10):

afonso360 edited issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 14:11):

afonso360 edited issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

Extra info

There is the possibility of this being an interpreter issue. I don't see how, but let me know if it is, and I'll try to chase that down.

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 15:04):

afonso360 edited issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

Extra info

Disassembly of generated code:

cargo run -- compile --target x86_64 -D .\lmao.clif

Disassembly of 25 bytes:
   0:   31 c0                   xor     eax, eax
   2:   48 89 ec                mov     rsp, rbp
   5:   5d                      pop     rbp
   6:   c3                      ret
   7:   55                      push    rbp
   8:   48 89 e5                mov     rbp, rsp
   b:   66 39 d2                cmp     dx, dx
   e:   0f 84 ec ff ff ff       je      0
  14:   e9 e7 ff ff ff          jmp     0

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 17:38):

cfallin commented on issue #4656:

Thanks! I think it makes the most sense to disallow this case -- done in #4659.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 18:52):

cfallin closed issue #4656:

:wave: Hey,

The clif fuzzer found this in #4654.

.clif Test Case

test interpret
test run
set enable_llvm_abi_extensions=true
target x86_64
target aarch64
target s390x

function %a(i8, i16, i8) -> b1 {
block0(v0: i8, v1: i16, v2: i8) cold:
    v3 = bconst.b1 false
    v12 -> v3
    v4 = bconst.b1 false
    v5 = bconst.b1 false
    v6 = iconst.i8 0
    v7 = iconst.i128 0
    v8 = iconst.i64 0
    v9 = iconst.i32 0
    v10 = iconst.i16 0
    v11 = iconst.i8 0
    br_icmp eq v1, v1, block1
    jump block1

block1:
    return v12
}
; run: %a(-83, 1536, 0) == false
; run: %a(0, 0, 0) == false

Steps to Reproduce

Expected Results

All tests should return false.

Actual Results

The run tests return true for the first input:

     Running `C:\Users\Afonso\CLionProjects\wasmtime\target\debug\clif-util.exe test .\lmao.clif`
 ERROR cranelift_filetests::concurrent > FAIL: run
FAIL .\lmao.clif: run

Caused by:
    Failed test: run: %a(-83, 1536, 0) == false, actual: true
1 tests
Error: 1 failure

Versions and Environment

Cranelift version or commit: main
Operating system: Windows (or Linux since the fuzzer found this)
Architecture: x86_64

Extra info

Disassembly of generated code:

cargo run -- compile --target x86_64 -D .\lmao.clif

Disassembly of 25 bytes:
   0:   31 c0                   xor     eax, eax
   2:   48 89 ec                mov     rsp, rbp
   5:   5d                      pop     rbp
   6:   c3                      ret
   7:   55                      push    rbp
   8:   48 89 e5                mov     rbp, rsp
   b:   66 39 d2                cmp     dx, dx
   e:   0f 84 ec ff ff ff       je      0
  14:   e9 e7 ff ff ff          jmp     0

cc: @cfallin
cc: @mchesser (not sure if you are interested in this issue or not! Feel free to ignore if not)


Last updated: Dec 23 2024 at 12:05 UTC