Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Tables count error in Rust example (bad wasm?) #13

Closed
jkriss opened this issue Dec 27, 2019 · 4 comments
Closed

Tables count error in Rust example (bad wasm?) #13

jkriss opened this issue Dec 27, 2019 · 4 comments

Comments

@jkriss
Copy link

jkriss commented Dec 27, 2019

When running the Rust example, I get the following error:

$ cargo run
   Compiling markdown v0.1.0 (/Users/jkriss/Desktop/wasmtime-demos/rust)
    Finished dev [unoptimized + debuginfo] target(s) in 4.26s
     Running `target/debug/markdown`
Error: tables count must be at most 1 (at offset 405)

This is after cloning the repo, installing Rust nightly and wasm-pack, then:

cd markdown
export WASM_INTERFACE_TYPES=1
wasm-pack build
cd ../rust
cp ../markdown/pkg/markdown.wasm .

In the python example, I get:

$ python3 run.py 
Traceback (most recent call last):
  File "run.py", line 7, in <module>
    import markdown
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/usr/local/lib/python3.7/site-packages/wasmtime/__init__.py", line 46, in exec_module
    res = instantiate(data, imports)
Exception: Validation error: module did not validate

It seems that something's going wrong with the initial wasm generation. Any ideas? This is with 1.42.0-nightly and wasm-pack 0.8.1.

@alexcrichton
Copy link
Member

Thanks for the report! For now you should be able to get examples working using 0.2.55 of wasm-bindgen. The 0.2.56 version and later emit a version of the interface types format that wasmtime doesn't support yet, but I'm working on it!

@peterhuene
Copy link
Member

I think we should fix the markdown demo to be =0.2.55 until Wasmtime and the demos catch up to these changes.

@alexcrichton
Copy link
Member

👍 Sounds like a good plan to me!

@alexcrichton
Copy link
Member

I'm going to now that we've temporarily removed interface types support, but stay tuned to bytecodealliance/wasmtime#677 for future updates!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants