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

support for env_logger not yet implemented? #455

Closed
huangjj27 opened this issue May 19, 2019 · 3 comments · Fixed by #459
Closed

support for env_logger not yet implemented? #455

huangjj27 opened this issue May 19, 2019 · 3 comments · Fixed by #459
Labels
❓ question I've a question!

Comments

@huangjj27
Copy link

Summary

writing a programming using env_logger and log, but when executing these statement, it panicked with not yet implemented

Additional details

$ wasmer run guess_wasi.wasm -- RUST_LOG=DEBUG
Please input your guess.
100
scaned string: ""100\n""
You guessed: 100
too big!
thread 'main' panicked at 'not yet implemented', lib\wasi\src\syscalls\windows.rs:16:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread 'main' panicked at 'error: "unhandled trap at 7ff84a9a9129 - code #e06d7363: unknown exception code"', src\bin\wasmer.rs:467:17
stack backtrace:
   0:     0x7ff62a18a5ed - std::sys::windows::backtrace::set_frames
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\sys\windows\backtrace\mod.rs:94
   1:     0x7ff62a18a5ed - std::sys::windows::backtrace::unwind_backtrace
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\sys\windows\backtrace\mod.rs:81
   2:     0x7ff62a18a5ed - std::sys_common::backtrace::_print
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\sys_common\backtrace.rs:70
   3:     0x7ff62a18d9ed - std::sys_common::backtrace::print
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\sys_common\backtrace.rs:58
   4:     0x7ff62a18d9ed - std::panicking::default_hook::{{closure}}
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:200
   5:     0x7ff62a18d670 - std::panicking::default_hook
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:215
   6:     0x7ff62a18e27f - std::panicking::rust_panic_with_hook
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:478
   7:     0x7ff62a18ddb3 - std::panicking::continue_panic_fmt
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:385
   8:     0x7ff62a18dd01 - std::panicking::begin_panic_fmt
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:340
   9:     0x7ff629f5cb7e - <wasmer::Backend as core::str::FromStr>::from_str::hcccf4cab5b2b1dd9
  10:     0x7ff629f60f16 - <wasmer::Backend as core::str::FromStr>::from_str::hcccf4cab5b2b1dd9
  11:     0x7ff629f55bb5 - std::io::read_to_end::h586cee48d6fa7b78
  12:     0x7ff62a18dbf6 - std::rt::lang_start_internal::{{closure}}
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\rt.rs:49
  13:     0x7ff62a18dbf6 - std::panicking::try::do_call<closure,i32>
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:297
  14:     0x7ff62a193021 - panic_unwind::__rust_maybe_catch_panic
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libpanic_unwind\lib.rs:87
  15:     0x7ff62a18e5b1 - std::panicking::try
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panicking.rs:276
  16:     0x7ff62a18e5b1 - std::panic::catch_unwind
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\panic.rs:388
  17:     0x7ff62a18e5b1 - std::rt::lang_start_internal
                               at /rustc/6c2484dc3c532c052f159264e970278d8b77cdc9\/src\libstd\rt.rs:48
  18:     0x7ff629f624b6 - main
  19:     0x7ff62a2024eb - invoke_main
                               at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  20:     0x7ff62a2024eb - __scrt_common_main_seh
                               at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
  21:     0x7ff84d5e7973 - BaseThreadInitThunk
  22:     0x7ff84dcaa270 - RtlUserThreadStart
thread panicked while panicking. aborting.
Illegal instruction
@huangjj27 huangjj27 added the ❓ question I've a question! label May 19, 2019
@MarkMcCaskey
Copy link
Contributor

Thanks for the report! The only major code in WASI that we have that's incompatible on Windows are the clock functions. Some of the clock functions for WASI seem to be Unix-specific, but Realtime and Monotonic should both be straightforward to implement and should hopefully cover this case!

@MarkMcCaskey
Copy link
Contributor

I think the PR above should fix it! I'll look in to getting our regression tests working on Windows, though testing clocks is a bit tricky given how we've set things up

bors bot added a commit that referenced this issue May 21, 2019
459: add realtime and monotonic clock support for wasi on windows r=MarkMcCaskey a=MarkMcCaskey

resolves #455 

Co-authored-by: Mark McCaskey <[email protected]>
@bors bors bot closed this as completed in #459 May 21, 2019
@huangjj27
Copy link
Author

I think the PR above should fix it!

Yes! I just print a debug message from WASI. here is the example:

$ wasmer run hello_log_wasi.wasm -- RUST_LOG=debug
[2019-05-25T01:20:29Z DEBUG guess_wasi] hello, wasi with log!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question I've a question!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants