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

VirtualFile::poll is not implemented for non-Unix-like targets yet #2979

Closed
liudonghua123 opened this issue Jun 28, 2022 · 4 comments
Closed
Assignees
Labels
bug Something isn't working priority-low Low priority issue
Milestone

Comments

@liudonghua123
Copy link

Describe the bug

I download the latest qjs.wasm from https://registry-cdn.wapm.io/contents/_/quickjs/0.0.3/build/qjs.wasm and try to run via wasmer v2.3.0, then it failed with the following errors.

D:\code\rust\wasm>rustc -V
rustc 1.61.0 (fe5b13d68 2022-05-18)

D:\code\rust\wasm>wasmer -V
wasmer 2.3.0

D:\code\rust\wasm>ver

Microsoft Windows [Version 10.0.22000.739]

D:\code\rust\wasm>wasmer qjs.wasm
QuickJS - Type "\h" for help
qjs > thread 'main' panicked at 'not implemented: VirtualFile::poll is not implemented for non-Unix-like targets yet', lib\wasi\src\state\types.rs:227:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

D:\code\rust\wasm>set RUST_BACKTRACE=1

D:\code\rust\wasm>wasmer qjs.wasm
QuickJS - Type "\h" for help
qjs > thread 'main' panicked at 'not implemented: VirtualFile::poll is not implemented for non-Unix-like targets yet', lib\wasi\src\state\types.rs:227:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

D:\code\rust\wasm>set RUST_BACKTRACE=full

D:\code\rust\wasm>wasmer qjs.wasm
QuickJS - Type "\h" for help
qjs > thread 'main' panicked at 'not implemented: VirtualFile::poll is not implemented for non-Unix-like targets yet', lib\wasi\src\state\types.rs:227:5
stack backtrace:
   0:     0x7ff73973270f - <unknown>
   1:     0x7ff73975591a - <unknown>
   2:     0x7ff73972c188 - <unknown>
   3:     0x7ff7397352cb - <unknown>
   4:     0x7ff739734dc4 - <unknown>
   5:     0x7ff7397357cc - <unknown>
   6:     0x7ff73973568b - <unknown>
   7:     0x7ff739733057 - <unknown>
   8:     0x7ff739735389 - <unknown>
   9:     0x7ff73979c6f0 - <unknown>
  10:     0x7ff7392912d8 - <unknown>
  11:     0x7ff73930e884 - <unknown>
  12:     0x7ff73932666e - <unknown>
  13:     0x7ff73932e10e - <unknown>
  14:     0x7ff7392a45de - <unknown>
  15:     0x7ff73967eea2 - <unknown>
  16:     0x7ff739280f04 - <unknown>
  17:     0x7ff73929e971 - <unknown>
  18:      0x22868778447 - <unknown>
  19:      0x228687786dd - <unknown>
  20:      0x228686148d8 - <unknown>
  21:      0x22868615a25 - <unknown>
  22:      0x228686123e4 - <unknown>
  23:      0x22868600397 - <unknown>
  24:      0x2286879238a - <unknown>
  25:     0x7ff73934ffa9 - <unknown>
  26:     0x7ff739350208 - <unknown>
  27:     0x7ff73967ef2b - <unknown>
  28:     0x7ff73934cd45 - <unknown>
  29:     0x7ff73934a4f5 - <unknown>
  30:     0x7ff738effa8b - <unknown>
  31:     0x7ff738ee3db5 - <unknown>
  32:     0x7ff738ee410a - <unknown>
  33:     0x7ff738ee1076 - <unknown>
  34:     0x7ff738ee100c - <unknown>
  35:     0x7ff739731f6f - <unknown>
  36:     0x7ff738ee1067 - <unknown>
  37:     0x7ff739768b08 - <unknown>
  38:     0x7ffaacf754e0 - BaseThreadInitThunk
  39:     0x7ffaad42485b - RtlUserThreadStart

D:\code\rust\wasm>

Steps to reproduce

Expected behavior

wasmer qjs.wasm works like on linux.

liudonghua@DESKTOP-DELL:/mnt/d/code/rust/wasm$ wasmer qjs.wasm
QuickJS - Type "\h" for help
qjs > 1+2
1+2
3
qjs > console
console
{ log: function log() }
qjs > ^C
liudonghua@DESKTOP-DELL:/mnt/d/code/rust/wasm$

Actual behavior

Failed with VirtualFile::poll is not implemented for non-Unix-like targets yet errors.

Additional context

@liudonghua123 liudonghua123 added the bug Something isn't working label Jun 28, 2022
@syrusakbary
Copy link
Member

We believe this is already fixed in master (as we are preparing for Wasmer 3.0). We need to double check that it works properly.

Could you check that it does @liudonghua123 and report here your results? Thanks!

@syrusakbary syrusakbary added this to the v3.0 milestone Jul 5, 2022
@syrusakbary syrusakbary added the priority-low Low priority issue label Jul 5, 2022
@liudonghua123
Copy link
Author

I updated the code on master branch, and build it from source according to the docs https://docs.wasmer.io/ecosystem/wasmer/building-from-source#all-compilers. But it seems not work on windows either, crashed with memory allocation of 77309411344 bytes failed.

logs
D:\code\rust\wasmer>git pull
Already up to date.

D:\code\rust\wasmer>git branch
* master

D:\code\rust\wasmer>git log -1 --pretty=%B
Merge #3003

3003: Remove RuntimeError::raise from public API r=epilys a=fschutt

Removes RuntimeError::raise (function was already depreceated for a relatively long time).

# Review

- [x] Add a short description of the change to the CHANGELOG.md file


Co-authored-by: Felix Schütt <[email protected]>


D:\code\rust\wasmer>make build-wasmer
-----------
INFORMATION
-----------

info: syncing channel updates for '1.59-x86_64-pc-windows-msvc'
info: latest update on 2022-02-24, rust version 1.59.0 (9d1b2106e 2022-02-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
Host Target: `x86_64-pc-windows-msvc`.
Enabled Compilers: cranelift, singlepass.
Testing the following compilers & engines:
聽 * API: cranelift-universal singlepass-universal,
聽 * C-API: cranelift-universal.
Cargo features:
聽 * Compilers: `--features cranelift,singlepass`.
Rust version: rustc 1.59.0 (9d1b2106e 2022-02-23).
NodeJS version: v18.4.0.


--------------
RULE EXECUTION
--------------


cargo build  --release --manifest-path lib/cli/Cargo.toml --features cranelift,singlepass --bin wasmer
  Downloaded seahash v4.1.0 (registry `tuna`)
  Downloaded target-lexicon v0.12.4 (registry `tuna`)
  Downloaded tracing-core v0.1.27 (registry `tuna`)
  Downloaded wat v1.0.44 (registry `tuna`)
  Downloaded tracing-attributes v0.1.21 (registry `tuna`)
  Downloaded wast v38.0.1 (registry `tuna`)
  Downloaded bytecheck_derive v0.6.8 (registry `tuna`)
  Downloaded cranelift-codegen-shared v0.82.3 (registry `tuna`)
  Downloaded cranelift-bforest v0.82.3 (registry `tuna`)
  Downloaded cranelift-frontend v0.82.3 (registry `tuna`)
  Downloaded cranelift-entity v0.82.3 (registry `tuna`)
  Downloaded fallible-iterator v0.2.0 (registry `tuna`)
  Downloaded enumset_derive v0.6.0 (registry `tuna`)
  Downloaded dynasm v1.2.3 (registry `tuna`)
  Downloaded enum-iterator-derive v0.7.0 (registry `tuna`)
  Downloaded indexmap v1.8.2 (registry `tuna`)
  Downloaded more-asserts v0.2.2 (registry `tuna`)
  Downloaded proc-macro-error v1.0.4 (registry `tuna`)
  Downloaded ptr_meta_derive v0.1.4 (registry `tuna`)
  Downloaded rend v0.3.6 (registry `tuna`)
  Downloaded rkyv_derive v0.7.38 (registry `tuna`)
  Downloaded serde_bytes v0.11.6 (registry `tuna`)
  Downloaded rustc-hash v1.1.0 (registry `tuna`)
  Downloaded time-macros v0.1.1 (registry `tuna`)
  Downloaded tracing v0.1.35 (registry `tuna`)
  Downloaded wasmparser v0.83.0 (registry `tuna`)
  Downloaded time-macros-impl v0.1.2 (registry `tuna`)
  Downloaded crossbeam-deque v0.8.1 (registry `tuna`)
  Downloaded wasm-encoder v0.13.0 (registry `tuna`)
  Downloaded structopt-derive v0.4.18 (registry `tuna`)
  Downloaded time v0.2.27 (registry `tuna`)
  Downloaded standback v0.2.17 (registry `tuna`)
  Downloaded rayon-core v1.9.3 (registry `tuna`)
  Downloaded proc-macro-error-attr v1.0.4 (registry `tuna`)
  Downloaded derivative v2.2.0 (registry `tuna`)
  Downloaded cfg-if v0.1.10 (registry `tuna`)
  Downloaded structopt v0.3.26 (registry `tuna`)
  Downloaded bitflags v1.2.1 (registry `tuna`)
  Downloaded rkyv v0.7.38 (registry `tuna`)
  Downloaded rayon v1.5.3 (registry `tuna`)
  Downloaded region v3.0.0 (registry `tuna`)
  Downloaded ptr_meta v0.1.4 (registry `tuna`)
  Downloaded memmap2 v0.5.4 (registry `tuna`)
  Downloaded leb128 v0.2.5 (registry `tuna`)
  Downloaded generational-arena v0.2.8 (registry `tuna`)
  Downloaded enumset v1.0.11 (registry `tuna`)
  Downloaded enum-iterator v0.7.0 (registry `tuna`)
  Downloaded dynasmrt v1.2.3 (registry `tuna`)
  Downloaded crossbeam-epoch v0.9.8 (registry `tuna`)
  Downloaded cranelift-codegen-meta v0.82.3 (registry `tuna`)
  Downloaded corosensei v0.1.2 (registry `tuna`)
  Downloaded constant_time_eq v0.1.5 (registry `tuna`)
  Downloaded const_fn v0.4.9 (registry `tuna`)
  Downloaded bytecheck v0.6.8 (registry `tuna`)
  Downloaded wast v42.0.0 (registry `tuna`)
  Downloaded regalloc v0.0.34 (registry `tuna`)
  Downloaded blake3 v1.3.1 (registry `tuna`)
  Downloaded arrayref v0.3.6 (registry `tuna`)
  Downloaded bytesize v1.1.0 (registry `tuna`)
  Downloaded colored v2.0.0 (registry `tuna`)
  Downloaded arrayvec v0.7.2 (registry `tuna`)
  Downloaded windows_x86_64_msvc v0.33.0 (registry `tuna`)
  Downloaded cranelift-codegen v0.82.3 (registry `tuna`)
  Downloaded windows-sys v0.33.0 (registry `tuna`)
  Downloaded distance v0.4.0 (registry `tuna`)
  Downloaded 65 crates (7.2 MB) in 9.80s (largest was `windows-sys` at 3.4 MB)
  Downloaded unix_mode v0.1.3 (registry `tuna`)
  Downloaded 1 crate (10.8 KB) in 0.44s
   Compiling proc-macro2 v1.0.39
   Compiling unicode-ident v1.0.0
   Compiling syn v1.0.96
   Compiling version_check v0.9.4
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.1.0
   Compiling serde_derive v1.0.137
   Compiling serde v1.0.137
   Compiling once_cell v1.12.0
   Compiling winapi v0.3.9
   Compiling hashbrown v0.11.2
   Compiling bitflags v1.2.1
   Compiling lazy_static v1.4.0
   Compiling libc v0.2.126
   Compiling log v0.4.17
   Compiling memchr v2.5.0
   Compiling cc v1.0.73
   Compiling bytecheck v0.6.8
   Compiling crossbeam-utils v0.8.8
   Compiling rend v0.3.6
   Compiling fallible-iterator v0.2.0
   Compiling stable_deref_trait v1.2.0
   Compiling scopeguard v1.1.0
   Compiling windows_x86_64_msvc v0.33.0
   Compiling ident_case v1.0.1
   Compiling rkyv v0.7.38
   Compiling fnv v1.0.7
   Compiling leb128 v0.2.5
   Compiling seahash v4.1.0
   Compiling target-lexicon v0.12.4
   Compiling smallvec v1.8.0
   Compiling rayon-core v1.9.3
   Compiling adler v1.0.2
   Compiling cranelift-codegen-shared v0.82.3
   Compiling pin-project-lite v0.2.9
   Compiling more-asserts v0.2.2
   Compiling unicode-width v0.1.9
   Compiling rustc-demangle v0.1.21
   Compiling rustc-hash v1.1.0
   Compiling memmap2 v0.5.4
   Compiling cranelift-entity v0.82.3
   Compiling proc-macro-hack v0.5.19
   Compiling num_cpus v1.13.1
   Compiling wasmparser v0.83.0
   Compiling either v1.6.1
   Compiling typenum v1.15.0
   Compiling const_fn v0.4.9
   Compiling wasmer-compiler-cranelift v2.3.0 (D:\code\rust\wasmer\lib\compiler-cranelift)
   Compiling slab v0.4.6
   Compiling byteorder v1.4.3
   Compiling bytes v1.1.0
   Compiling unicode-segmentation v1.9.0
   Compiling anyhow v1.0.57
   Compiling subtle v2.4.1
   Compiling cfg-if v0.1.10
   Compiling constant_time_eq v0.1.5
   Compiling vec_map v0.8.2
   Compiling arrayref v0.3.6
   Compiling strsim v0.8.0
   Compiling arrayvec v0.7.2
   Compiling fastrand v1.7.0
   Compiling wasmer-cli v2.3.0 (D:\code\rust\wasmer\lib\cli)
   Compiling hex v0.4.3
   Compiling bytesize v1.1.0
   Compiling distance v0.4.0
   Compiling getrandom v0.2.6
   Compiling tracing-core v0.1.27
   Compiling proc-macro-error-attr v1.0.4
   Compiling ahash v0.7.6
   Compiling proc-macro-error v1.0.4
   Compiling standback v0.2.17
   Compiling generic-array v0.14.5
   Compiling time v0.2.27
   Compiling indexmap v1.8.2
   Compiling memoffset v0.6.5
   Compiling crossbeam-epoch v0.9.8
   Compiling corosensei v0.1.2
   Compiling rayon v1.5.3
   Compiling wasm-encoder v0.13.0
   Compiling wast v38.0.1
   Compiling cranelift-codegen-meta v0.82.3
   Compiling miniz_oxide v0.5.3
   Compiling textwrap v0.11.0
   Compiling cranelift-bforest v0.82.3
   Compiling generational-arena v0.2.8
   Compiling heck v0.3.3
   Compiling backtrace v0.3.65
   Compiling blake3 v1.3.1
   Compiling regalloc v0.0.34
   Compiling quote v1.0.18
   Compiling windows-sys v0.33.0
   Compiling object v0.28.4
   Compiling wast v42.0.0
   Compiling crossbeam-channel v0.5.4
   Compiling cranelift-codegen v0.82.3
   Compiling hashbrown v0.12.1
   Compiling region v3.0.0
   Compiling atty v0.2.14
   Compiling remove_dir_all v0.5.3
   Compiling crossbeam-deque v0.8.1
   Compiling crypto-common v0.1.3
   Compiling block-buffer v0.10.2
   Compiling clap v2.34.0
   Compiling colored v2.0.0
   Compiling tempfile v3.3.0
   Compiling digest v0.10.3
   Compiling wat v1.0.44
   Compiling darling_core v0.13.4
   Compiling thiserror-impl v1.0.31
   Compiling ptr_meta_derive v0.1.4
   Compiling bytecheck_derive v0.6.8
   Compiling enum-iterator-derive v0.7.0
   Compiling rkyv_derive v0.7.38
   Compiling tracing-attributes v0.1.21
   Compiling time-macros-impl v0.1.2
   Compiling wasmer-derive v2.3.0 (D:\code\rust\wasmer\lib\derive)
   Compiling dynasm v1.2.3
   Compiling derivative v2.2.0
   Compiling structopt-derive v0.4.18
   Compiling darling_macro v0.13.4
   Compiling thiserror v1.0.31
   Compiling ptr_meta v0.1.4
   Compiling enum-iterator v0.7.0
   Compiling tracing v0.1.35
   Compiling time-macros v0.1.1
   Compiling darling v0.13.4
   Compiling structopt v0.3.26
   Compiling wasmer-vfs v2.3.0 (D:\code\rust\wasmer\lib\vfs)
   Compiling enumset_derive v0.6.0
   Compiling wasmer-vnet v2.3.0 (D:\code\rust\wasmer\lib\vnet)
   Compiling wasmer-vbus v2.3.0 (D:\code\rust\wasmer\lib\vbus)
   Compiling serde_bytes v0.11.6
   Compiling enumset v1.0.11
   Compiling wasmer-wasi-local-networking v2.3.0 (D:\code\rust\wasmer\lib\wasi-local-networking)
   Compiling gimli v0.26.1
   Compiling dynasmrt v1.2.3
   Compiling addr2line v0.17.0
   Compiling wasmer-types v2.3.0 (D:\code\rust\wasmer\lib\types)
   Compiling wasmer-vm v2.3.0 (D:\code\rust\wasmer\lib\vm)
   Compiling wasmer-wasi-types v2.3.0 (D:\code\rust\wasmer\lib\wasi-types)
   Compiling wasmer-compiler v2.3.0 (D:\code\rust\wasmer\lib\compiler)
   Compiling wasmer-compiler-singlepass v2.3.0 (D:\code\rust\wasmer\lib\compiler-singlepass)
   Compiling cranelift-frontend v0.82.3
   Compiling wasmer v2.3.0 (D:\code\rust\wasmer\lib\api)
   Compiling wasmer-cache v2.3.0 (D:\code\rust\wasmer\lib\cache)
   Compiling wasmer-emscripten v2.3.0 (D:\code\rust\wasmer\lib\emscripten)
warning: function is never used: `call_malloc_with_cast`
  --> lib\emscripten\src\env\mod.rs:33:8
   |
33 | pub fn call_malloc_with_cast<T: Copy>(ctx: &EmEnv, size: u32) -> WasmPtr<T> {
   |        ^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> lib\emscripten\src\env\mod.rs:32:8
   |
32 | #[warn(dead_code)]
   |        ^^^^^^^^^

   Compiling wasmer-wasi v2.3.0 (D:\code\rust\wasmer\lib\wasi)
warning: `wasmer-emscripten` (lib) generated 1 warning
   Compiling wasmer-wast v2.3.0 (D:\code\rust\wasmer\tests\lib\wast)
    Finished release [optimized] target(s) in 4m 46s

D:\code\rust\wasmer>target\release\wasmer.exe D:\Downloads\qjs.wasm
memory allocation of 77309411344 bytes failed

D:\code\rust\wasmer>echo %errorlevel%
-1073740791

D:\code\rust\wasmer>where wasmer
C:\Users\Liu.D.H\.wasmer\bin\wasmer.exe

D:\code\rust\wasmer>wasmer.exe D:\Downloads\qjs.wasm
QuickJS - Type "\h" for help
qjs > thread 'main' panicked at 'not implemented: VirtualFile::poll is not implemented for non-Unix-like targets yet', lib\wasi\src\state\types.rs:227:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

D:\code\rust\wasmer>

@ptitSeb ptitSeb self-assigned this Nov 16, 2022
@ptitSeb
Copy link
Contributor

ptitSeb commented Nov 16, 2022

linked tp #570

@ptitSeb ptitSeb modified the milestones: v3.0, v3.2 Nov 16, 2022
@Michael-F-Bryan
Copy link
Contributor

The poll() method has been removed from VirtualFile and its replacements (poll_read() and poll_write()) should already be implemented for our various VirtualFile implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-low Low priority issue
Projects
None yet
Development

No branches or pull requests

4 participants