Skip to content

WAMR AOT and JIT modes hang indefinitely #4544

@teyahb8

Description

@teyahb8

Subject of the issue

I have generated a test case and executed it with different runtimes. Other runtimes like wasmtime, wasmer's cranelift backend, and wasmedge all output out of bounds exception. But, wamr's both AOT and JIT modes hang indefinitely. It might be worth noting issue #4481 where only the JIT mode wouldn't show out of bounds exception likely due to an optimization bug. But, with this test case, in addition to JIT mode, AOT mode also wouldn't show out of bounds exception.

Test case

wasm_testcase_file

(module
  (type (;0;) (func (result v128)))
  (type (;1;) (func (result v128)))
  (memory (;0;) 65536 65536)
  (export "main" (func 1))
  (func (;0;) (type 0) (result v128)
    unreachable
  )
  (func (;1;) (type 1) (result v128)
    (local v128)
    i32.const 0
    local.get 0
    v128.store64_lane offset=2437 align=1 1
    i32.const 0
    local.get 0
    v128.store offset=9865 align=1
    i32.const 1
    local.get 0
    v128.store16_lane offset=3276 align=1 1
    i32.const 0
    local.get 0
    v128.store offset=2908 align=1
    block ;; label = @1
      loop ;; label = @2
        i32.const 0
        br_if 1 (;@1;)
        i32.const 0
        local.get 0
        v128.store offset=1155 align=1
        block ;; label = @3
          block ;; label = @4
            i32.const 1
            br_if 0 (;@4;)
            br 1 (;@3;)
          end
          v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000
          local.set 0
          local.get 0
          local.get 0
          f32x4.div
          local.set 0
          local.get 0
          i16x8.extract_lane_s 1
          v128.load8x8_u offset=9759 align=1
          local.set 0
        end
        i32.const 0
        i8x16.splat
        local.set 0
        i32.const 0
        local.get 0
        v128.store16_lane offset=3254 align=1 0
        i32.const 0
        local.get 0
        v128.store64_lane offset=4332 align=1 1
        br 0 (;@2;)
      end
    end
    call 0
    i32.const 0
    local.get 0
    v128.store32_lane offset=9308 align=1 0
    local.get 0
    return
    local.get 0
    return
  )
)

Your environment

  • Host OS (Ubuntu 22.04)
  • WAMR version (2.3.1), platform (Linux), cpu architecture (x86_64), running mode (AOT/JIT), etc.

Steps to reproduce

  1. Convert wat to wasm or use the attached wasm file.
  2. Run: wamrc --bounds-checks=1 -o test.aot test.wasm
  3. Run: iwasm --heap-size=0 -f main test.aot
  4. Run: iwasm --heap-size=0 --llvm-jit -f main test.wasm

Expected behavior

Should output: out of bounds exception.

Actual behavior

Hangs indefinitely.

Extra Info

Can you please confirm? Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions