You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fundamental methodKernel#sleep stops working in the latest version of Ruby WASM package. My current workaround is to override the Kernel#sleep like:
moduleKerneldefsleep(time)JS.eval("return new Promise((resolve) => setTimeout(resolve, #{time * 1000}))").awaitendend
Thank you for narrowing down the issue! With ruby.debug+stdlib.wasm, I identified the crash happens on poll_oneoff implementation in wasi-vfs.
Stack trace
(index):35 RbError: Something went wrong in Ruby VM: RuntimeError: unreachable
at 0013fce2:0x3ff74
at 0013fce2:0x42827
at 0013fce2:0x9cbc
at 0013fce2:0x39cf8
at wasi_vfs::wasi_snapshot_preview1::poll_oneoff::h441084cfdf4da2ed (ruby.debug+stdlib.wasm:0xa9423b)
at wasi_vfs_wasi_snapshot_preview1_poll_oneoff (ruby.debug+stdlib.wasm:0xa95ac1)
at __imported_wasi_snapshot_preview1_poll_oneoff (ruby.debug+stdlib.wasm:0xa961cc)
at __wasi_poll_oneoff (ruby.debug+stdlib.wasm:0xa9696f)
at clock_nanosleep (ruby.debug+stdlib.wasm:0xa792e7)
at rb_array_len (thread_none.c:270) at rb_threadptr_pending_interrupt_empty_p (thread.c:1955) at vm_check_ints_blocking (thread.c:214) at sleep_hrtime (thread.c:1275)
It seems like the change between two versions added poll_oneoff implementation in wasi-vfs, so it seems very relevant. I'll take a closer look. kateinoigakukun/wasi-vfs@9e70c75
Descriptoin
The fundamental method
Kernel#sleep
stops working in the latest version of Ruby WASM package. My current workaround is to override theKernel#sleep
like:Reproduce
Expected
Browser console should print both
"vm_2_2"
and"vm_2_3"
.Actual
Browser prints
"vm_2_2"
successfully but failed to print"vm_2_3"
.The text was updated successfully, but these errors were encountered: