WasmEdge / WasmEdge

WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications. It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.

Home Page:https://WasmEdge.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Unexpected behavior

erxiaozhou opened this issue · comments

Summary

When executing a valid test case, WasmEdge raises an exception.

Current State

terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoll
Aborted

Expected State

output -1 or 4294967295

Reproduction steps

  1. Build with command: cmake -DCMAKE_INSTALL_PREFIX="$install_dir" -DCMAKE_PREFIX_PATH="/usr/lib/llvm-12" -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF ..
  2. Execute with command: wasmedge run --reactor <test_case> "to_test"
    i32.gt_s_54_485_17118920438119833.zip

Screenshots

DESCRIPTION

Any logs you want to share for showing the specific issue

No response

Components

CLI

WasmEdge Version or Commit you used

a5e6f2d

Operating system information

Ubuntu 20.04

Hardware Architecture

x86_64

Compiler flags and options

cmake -DCMAKE_INSTALL_PREFIX="$install_dir" -DCMAKE_PREFIX_PATH="/usr/lib/llvm-12" -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=OFF ..

You may use the wrong command.
This WASM exports the "_start" function, so that you can run with the WASI mode with the command:

$ wasmedge run i32.gt_s_54_485_17118920438119833.wasm
4294967295

And this WASM also exports the "to_test" function, which is the same as the "_start" function, so you can also run with the reactor mode:

$ wasmedge run --reactor i32.gt_s_54_485_17118920438119833.wasm to_test
4294967295

Please notice the ordering of options and arguments:

./wasmedge [SUBCOMMANDS] [OPTIONS] [--] WASM_OR_SO [ARG ...]