iodide-project / iodide-project/iodide
Detecting crashes of the Pyodide WASM environement
- Dominant language
- JavaScript
- Stars
- 1.5k
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Description
It would be very useful if Iodide could detect when Pyodide WASM environment crashes (e.g. after a segfault), and warn the user.
For instance, running the simple code snippet from https://github.com/iodide-project/pyodide/issues/200 in the demo notebook https://iodide.io/pyodide-demo/python.html produces a segfault which crashes Pyodide, meaning that any subsequent command will also fail.
This situation is very confusing for users, because Iodide still works in this scenario. So the user gets some error in one notebook cell, and then thinking that maybe something was wrong in the provided code, they would try to change the input code, but irrespective of the input the cell would still fail. More frustrating, even other cells that used to work now will also fail. The only solution is to restart the page.
Even if though segfaults shouldn't happen, it's still possible to run into one, particularly when people build some custom packages. I'm not sure if running out of memory can also produce a somewhat similar outcome.
It would help user experience to have some mechanism in Iodide to warn the user when this happens. For instance, one could imagine running some sanity test (e.g executing `1+1`) before running the actual code from the cell.
In Jupyter this is somewhat similar to the "kernel died" situation. I'm not sure if it's possible/desirable to recover from such situation, without restarting the page though.
cc @mdboom
Contributor guide
Assessment
This issue has not been assessed yet.