-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Following code seems correct though will always panic when compiled to wasm32-wasi
:
fn main() { std::thread::sleep(std::time::Duration::new(0,5)); }
compiled with nightly rust 1.40:
>cargo +nightly build --target wasm32-wasi
It fails at least in wasmtime and wasmer-js VMs (example https://github.com/dunnock/wabench/tree/master/poll_oneoff_test):
> wasmtime target/wasm32-wasi/debug/poll_oneoff_test.wasm
thread 'main' panicked at 'thread::sleep(): unexpected result of poll_oneoff', src/libstd/sys/wasi/thread.rs:61:18
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.
error: failed to process main module target/wasm32-wasi/debug/poll_oneoff_test.wasm
caused by: Instantiation error: Trap occurred while invoking start function: wasm trap: unreachable, source location: @8f01
rustup show:
active toolchain
nightly-x86_64-apple-darwin (default)
rustc 1.40.0-nightly (0e8a4b441 2019-10-16)
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/Target: WASM (WebAssembly), http://webassembly.org/T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.