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

No error report? #713

Open
orangeC23 opened this issue Apr 10, 2023 · 0 comments
Open

No error report? #713

orangeC23 opened this issue Apr 10, 2023 · 0 comments
Labels
🐞 bug Something isn't working

Comments

@orangeC23
Copy link

Describe the bug

This wasm file is to test whether a wasm runtime could deal with the error of index out of bounds errors when import_global_index is greeter than imports.globals length.
The wasm file is :
C2-1-wasm.txt
The python file is :

import os

from wasmer import engine, wat2wasm, Store, Module, Instance, wasi
# from wasmer_compiler_cranelift import Compiler
# from wasmer_compiler_llvm import Compiler
from wasmer_compiler_singlepass import Compiler

engine = engine.Universal(Compiler)

# Create a store, that holds the engine.
store = Store(engine)

# Let's compile the Wasm module with the Cranelift compiler.
__dir__ = os.path.dirname(os.path.realpath(__file__))
module = Module(Store(), open(__dir__ + './tmp.wasm', 'rb').read())

instance = Instance(module)

Steps to reproduce

python tmp.py

Expected behavior

Report index out of bounds error.

Actual behavior

The output of wasmer is:
│ 1: module instantiation failed (engine: universal, compiler: cranelift)
╰─▶ 2: Validation error: constant expression required: global.get of locally defined global (at offset 18)

However, wasmer python print nothing.

@orangeC23 orangeC23 added the 🐞 bug Something isn't working label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant