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

[Rust][WASM] WASM runtime example is broken. #6816

Closed
jroesch opened this issue Nov 2, 2020 · 5 comments
Closed

[Rust][WASM] WASM runtime example is broken. #6816

jroesch opened this issue Nov 2, 2020 · 5 comments
Labels
rust Related to TVM's Rust bindings status: need update need update based on feedbacks

Comments

@jroesch
Copy link
Member

jroesch commented Nov 2, 2020

Recent changes seemed to have broke the Rust WASM example. There is an issue executing the produced WASM code:

Error: failed to run main module `target/wasm32-wasi/debug/test-rt-wasm32.wasm`

Caused by:
    0: failed to instantiate "target/wasm32-wasi/debug/test-rt-wasm32.wasm"
    1: command export '__tvm_module_ctx' is not a function

cc @ehsanmok

@jroesch jroesch changed the title [Rust][WASM] [Rust][WASM] WASM runtime example is broken. Nov 2, 2020
@jroesch
Copy link
Member Author

jroesch commented Nov 2, 2020

cc @kazum I am not able to reproduce using current instructions on Linux, any thoughts?

@kazum
Copy link
Contributor

kazum commented Nov 5, 2020

I encountered a different error with the latest main branch.

$ wasmtime target/wasm32-wasi/debug/test-rt-wasm32.wasm
Error: failed to run main module `target/wasm32-wasi/debug/test-rt-wasm32.wasm`

Caused by:
    0: failed to invoke `_start`
    1: wasm trap: indirect call type mismatch
       wasm backtrace:
         0: 0x37569 - <unknown>!tvm_graph_rt::module::wrap_backend_packed_func::{{closure}}::hbee2f3ef4e32527e
         1: 0x1a36 - <unknown>!test_rt_wasm32::main::hbb4d387c03ac56d3
         2: 0xe06c - <unknown>!std::rt::lang_start::{{closure}}::h70a400566ab57956
         3: 0x92876 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::h6103d9a4666ac834
         4: 0x9373e - <unknown>!std::rt::lang_start_internal::ha1eb439644c595a0
         5: 0xe01e - <unknown>!std::rt::lang_start::h230ba3b222020488
         6: 0x1bcd - <unknown>!__original_main
         7: 0x13ae - <unknown>!_start
       

Anyway, I'll take a look.

@jroesch
Copy link
Member Author

jroesch commented Nov 5, 2020

@kazum I did a big of debugging but somehow the test got turned off and seems to have broken, was trying to make it more robust on multiple platforms so we can simplify task_rush.sh to use Cargo more.

@junrushao junrushao added the status: need update need update based on feedbacks label Dec 31, 2020
@sambitnayak
Copy link

sambitnayak commented Apr 5, 2021

Hitting error similar to those shown by @kazum . Any suggestions on this, please?

@ya0guang
Copy link
Member

I also encountered a similar problem when executing the WASM.

trace:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: wasm trap: indirect call type mismatch
wasm backtrace:
    0: 0x926a7 - tvm_graph_rt::module::wrap_backend_packed_func::{{closure}}::hc41b54aab3cb76f6
                    at /home/ya0guang/Code/tvm/rust/tvm-graph-rt/src/module/mod.rs:49:25
    1: 0x31f95 - tvm_graph_rt::graph::GraphExecutor::setup_op_execs::{{closure}}::h796f856bdd94f006
                    at /home/ya0guang/Code/tvm/rust/tvm-graph-rt/src/graph.rs:311:17
    2: 0xc97ad - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf5ca8f8ac2b01304
                    at /home/ya0guang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1560:9
    3: 0x9e858 - tvm_graph_rt::graph::GraphExecutor::run::{{closure}}::h64f3e6e6888bde03
                    at /home/ya0guang/Code/tvm/rust/tvm-graph-rt/src/graph.rs:204:13
    4: 0x83d82 - <core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::for_each::h71b18dc5ce1e6a4c
                    at /home/ya0guang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:203:21
    5: 0x9e80e - tvm_graph_rt::graph::GraphExecutor::run::h2fd8fe0d78a2c3ff
                    at /home/ya0guang/Code/tvm/rust/tvm-graph-rt/src/graph.rs:203:9
    6: 0x2bb77 - run
                    at /home/ya0guang/Code/tvm/apps/wasm-standalone-mod/wasm-graph/src/lib.rs:86:5
', src/main.rs:84:22

@areusch areusch added the needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it label Oct 19, 2022
@hpanda-naut hpanda-naut added rust Related to TVM's Rust bindings and removed needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it labels Nov 28, 2022
@tqchen tqchen closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust Related to TVM's Rust bindings status: need update need update based on feedbacks
Projects
None yet
Development

No branches or pull requests

8 participants