Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Behavior in JIT Mode #3165

Closed
erxiaozhou opened this issue Feb 18, 2024 · 4 comments
Closed

Unexpected Behavior in JIT Mode #3165

erxiaozhou opened this issue Feb 18, 2024 · 4 comments

Comments

@erxiaozhou
Copy link

Build commands

I compile the code with commit id 8b8c595.
Platform: Ubuntu 20.04
CPU: amd64
compile:

export CC=/usr/lib/llvm-16/bin/clang
export CXX=/usr/lib/llvm-16/bin/clang++
cd product-mini/platforms/linux/;rm -rf build
cmake  -DWASM_ENABLE_AOT=1 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_FAST_JIT=0   -DCMAKE_INSTALL_PREFIX="xxx" -DWAMR_BUILD_REF_TYPES=1 -DCMAKE_BUILD_TYPE=Release  -DWASM_ENABLE_BULK_MEMORY=1 -DWAMR_BUILD_LIBC_WASI=0 -DWAMR_BUILD_LIBC_BUILTIN=1 -DWAMR_BUILD_SIMD=1 -Bbuild

execute:

iwasm --heap-size=0 --llvm-jit -f to_test <tc_name>

Cases

iwasm_jit_select_exception.zip

(module
  (type (;0;) (func (result funcref)))
  (func (;0;) (type 0) (result funcref)
    ref.func 0
    ref.null func
    memory.size
    br_if 0 (;@0;)
    i32.const 1
    select (result funcref))
  (memory (;0;) 1 5)
  (export "_start" (func 0))
  (export "to_test" (func 0)))

Actual behavior:

No exception

func:ref.null

Expected behavior:

Exception

WASM module load failed: Error: invalid stack values with different type
@TianlongLiang
Copy link
Contributor

Hi, I think this bug is because of spec update, I used the low version wabt and there is the same exception. I will look into it.

@erxiaozhou
Copy link
Author

erxiaozhou commented Feb 19, 2024

Hi, I think this bug is because of spec update, I used the low version wabt and there is the same exception. I will look into it.

@TianlongLiang Wamr on different modes (e.g., interpreter mode, fast JIT mode) will not raise this exception.

@wenyongh
Copy link
Contributor

@erxiaozhou the issue was fixed with #3169, please try again. Thanks for spotting the issue!

@wenyongh
Copy link
Contributor

wenyongh commented Mar 1, 2024

Close the issue since it had been fixed.

@wenyongh wenyongh closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants