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

__wasi_random_get in wasi polyfill not defined #89

Closed
nipzu opened this issue Apr 1, 2019 · 3 comments
Closed

__wasi_random_get in wasi polyfill not defined #89

nipzu opened this issue Apr 1, 2019 · 3 comments

Comments

@nipzu
Copy link

nipzu commented Apr 1, 2019

The javascript polyflll function random_get calls an undefined function __wasm_random_get and gives an error. Calling the ___wasi_random_get function with 3 underscores would generate a random number without errors. Most of the other WASI functions seem to have 3 underscores so why doesn't this function have them? The sched_yield and sock_shutdown functions also seem to be calling undefined functions.
https://github.com/CraneStation/wasmtime/blob/a6f31a2be331f66a26e5516cae80c02261b49744/wasmtime-wasi/js-polyfill/wasi.js#L455

@sunfishcode
Copy link
Member

Good spot! Those functions should have three underscores. I've now fixed them in dd0d71b.

@nipzu nipzu closed this as completed Apr 1, 2019
@zhuowei
Copy link
Contributor

zhuowei commented Apr 20, 2019

@sunfishcode I can still reproduce this on the publicly hosted polyfill; you might want to update the polyfill on the site.

@sunfishcode
Copy link
Member

It's now updated with this fix.

howjmay pushed a commit to howjmay/wasmtime that referenced this issue Jan 24, 2022
Fixes bytecodealliance#89.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
pchickey pushed a commit to pchickey/wasmtime that referenced this issue May 12, 2023
…ce#89)

Preview1's `fd_readdir` includes `.` and `..`, but Preview2 is changing
to avoid this. Update the Preview2 host implementation to omit these
entries, and add code the polyfill to re-add them.
pchickey pushed a commit to pchickey/wasmtime that referenced this issue May 16, 2023
…ce#89)

Preview1's `fd_readdir` includes `.` and `..`, but Preview2 is changing
to avoid this. Update the Preview2 host implementation to omit these
entries, and add code the polyfill to re-add them.
mooori pushed a commit to mooori/wasmtime that referenced this issue Dec 20, 2023
dhil added a commit to dhil/wasmtime that referenced this issue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants