-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
tokio thread panic with IO error when targeting wasm32-wasi #5238
Comments
I can consistently trigger this panic server-side by ungracefully closing the client-side connection accepted on the listener side in WASI. It seems that it occurs on write to the (closed) stream I will try to bisect when I have more capacity |
I have a simple fix that work for my use case. fakeshadow/mio@332d265 I'm not sure if it's the intended or correct way of handling event error hence no PR from it. Hope it can help you fixing it. |
It sounds pretty weird. I'm not really sure what's going on in your change to mio. Thoughts @Thomasdezeeuw ? |
This is unrelated to the panic, this line checks for The actual panic comes from line 180: tokio/tokio/src/runtime/io/mod.rs Line 180 in 28ec4a6
This is how error handling is done for many events in wasm. If it wasn't then nothing wasm related would run.
This just ignored all errors. The relevant error code is So the next step would be to determine where this error comes from within wasmtime, but I don't have time to do that today. |
I'm marking this issue as help-wanted. I have no experience with wasmtime, and it would be a big help if someone can investigate what the error means. |
Version
1.22
Platform
Linux pop-os 6.0.6-76060006-generic #202210290932~1667401208~22.04~d2df702 SMP PREEMPT_DYNAMIC Wed N x86_64 x86_64 x86_64 GNU/Linux
(Also tested on other popular distros like arch the same issue exists.)Description
When using wasmtime cli to run tokio runtime powered wasm applcation there is occasional case where wasmtime produce an I/O error cause tokio to panic with following message:
According to this line error kind with
Uncategorized
variant is excluded from error handling causing the panic:tokio/tokio/src/runtime/io/mod.rs
Lines 175 to 179 in 28ec4a6
After further look into the source of error it leads to
mio
where event error is treated the same as selector error:https://github.com/tokio-rs/mio/blob/0accf7dc22f197245e6a1aa84096262cd6f6e4d4/src/sys/wasi/mod.rs#L113
I did not look further into how
wasmtime
produce this error due to not familiar with it's code base but I can confirm it did not happen on windows 11 when I test the same code.Reproducible example (docker needed):
The text was updated successfully, but these errors were encountered: