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

I'm running demo.wasm in #936 under Windows and an error occurred. #3022

Closed
abc767234318 opened this issue Jul 16, 2022 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@abc767234318
Copy link

Describe the bug

I'm running demo.wasm in #936 under Windows and an error occurred.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("key must be a string", line: 1, column: 2)', src\main.rs:21:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run `demo.wasm`
│   1: RuntimeError: unreachable
           at __rust_start_panic (demo.wasm[839]:0x2d163)
           at rust_panic (demo.wasm[833]:0x2cf92)
           at std::panicking::rust_panic_with_hook::hd67762ecc8bae640 (demo.wasm[832]:0x2cf0f)
           at std::panicking::begin_panic_handler::{{closure}}::h4aed573334d346d1 (demo.wasm[819]:0x2c150)
           at std::sys_common::backtrace::__rust_end_short_backtrace::h33c000da160739e7 (demo.wasm[818]:0x2c08f)
           at rust_begin_unwind (demo.wasm[827]:0x2c83a)
           at core::panicking::panic_fmt::hddd782b3234e7a63 (demo.wasm[925]:0x32d23)
           at core::result::unwrap_failed::h70df1603dbe85f50 (demo.wasm[975]:0x3a203)
           at core::result::Result<T,E>::unwrap::hc5f6490093d419d0 (demo.wasm[152]:0xb276)
           at demo::main::hc227cbc73dbcad75 (demo.wasm[54]:0x2724)
           at core::ops::function::FnOnce::call_once::hbf411d7dab0f9129 (demo.wasm[70]:0x3199)
           at std::sys_common::backtrace::__rust_begin_short_backtrace::h1bacb221e96b689b (demo.wasm[51]:0x2254)
           at std::rt::lang_start::{{closure}}::h1e3c90e57ef77be5 (demo.wasm[27]:0x1288)
           at std::rt::lang_start_internal::h2b37ba429069aa23 (demo.wasm[767]:0x28dad)
           at std::rt::lang_start::h1d483e719bc6d2a1 (demo.wasm[26]:0x1225)
           at __original_main (demo.wasm[56]:0x2c52)
           at _start (demo.wasm[11]:0x816)
           at _start.command_export (demo.wasm[1037]:0x3e5a2)
╰─▶ 2: unreachable
wasmer 2.3.0
rustc 1.62.0 (a8314ef7d 2022-06-27)

Steps to reproduce

wasmer run --dir=. demo.wasm '{"a":"txt", "b":1}'
@abc767234318 abc767234318 added the bug Something isn't working label Jul 16, 2022
@jcaesar
Copy link
Contributor

jcaesar commented Jul 16, 2022

The panic is occurring inside the wasm binary and not in wasmer. (Wasmer could sure be a little more explicit about this than just printing RuntimeError: unreachable.) This is fairly unlikely to be a wasmer bug.
Much more likely, it is a problem with how whatever shell you're using on windows mangles the " in the command line.

Could you paste the entire output from the run, especially the

Got input = {"a":"txt", "b":1}

line?

@abc767234318
Copy link
Author

@jcaesar Thank you very much. That was my problem.

@abc767234318
Copy link
Author

@jcaesar Sorry, I have another problem.
The following error occurs when I execute the following command.

wasmer run --llvm --dir=. demo.wasm '{""a"":""txt"", ""b"":1}'
error: failed to run `demo.wasm`
╰─▶ 1: The `llvm` compiler is not included in this binary.

Does Windows not support the LLVM backend?

@abc767234318 abc767234318 reopened this Jul 18, 2022
@epilys
Copy link
Contributor

epilys commented Jul 18, 2022

It does but your copy of wasmer seems not to include it. Did you build it yourself?

@abc767234318
Copy link
Author

abc767234318 commented Jul 18, 2022

@epilys I didn't build it myself. Do I need to build Wasmer from source code?

@syrusakbary
Copy link
Member

syrusakbary commented Jul 19, 2022

Does Windows not support the LLVM backend?

Nope, it should be included by default in Linux. In macOS it also should be present (but not on M1). But in Windows we haven't included it by default

@syrusakbary
Copy link
Member

It seems this issue can be closed by #2148. Closing issue to follow-up there

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

4 participants