Skip to content

Segmentation Fault in iwasm for struct.get with v128 field #4782

@akldc

Description

@akldc

Test case

(module
  (type $S (struct (field (mut v128))))
  (type $ft0 (func (result v128)))
  (export "main" (func 0))
  (func $0
    (type $ft0)
    (struct.new_default $S)
    (struct.get $S 0)
  )
)

Describe the bug
When running the module with iwasm, the runtime crashes with a segmentation fault instead of returning the expected v128 zero value. The execution terminates with:

$ iwasm -f main test1.wasm
unhandled SIGSEGV, si_addr: (nil)
Aborted

$ iwasm --llvm-jit -f main test1.wasm
unhandled SIGSEGV, si_addr: (nil)
Aborted

Other runtimes such as wasmtime and WasmEdge execute the same module correctly and return a v128 value of 0. This suggests a possible bug in iwasm when handling struct.get on a struct field of type v128.

Version
iwasm 2.4.4
ubuntu 20.04

To Reproduce
Steps to reproduce the behavior:

  1. Compile iwasm with flags like '-DWAMR_BUILD_JIT=1 -DWAMR_BUILD_TAIL_CALL=1 -DWAMR_BUILD_GC=1'
  2. Run iwasm with CLI options like 'iwasm -f main test1.wasm'
  3. See error

Expected behavior
0

Actual Result
unhandled SIGSEGV, si_addr: (nil)
Aborted

Desktop (please complete the following information):

  • Arch x86_64
  • OS ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions