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

Double panics can still happen in the wasm node #739

Closed
tomaka opened this issue Apr 8, 2021 · 1 comment · Fixed by #2498
Closed

Double panics can still happen in the wasm node #739

tomaka opened this issue Apr 8, 2021 · 1 comment · Fixed by #2498

Comments

@tomaka
Copy link
Contributor

tomaka commented Apr 8, 2021

When a panic happens in the Wasm node, we call throw, and intentionally let the JavaScript worker die as a result.

This is totally intended. A panic could leave memory in a corrupted state, and calling functions again is undesirable.
See this paragraph for context.

It seems that, despite the worker errorring, the timeouts and sockets that are still alive in the worker continue to run and continue to call the smoldot Wasm again.

@tomaka
Copy link
Contributor Author

tomaka commented Apr 8, 2021

To reproduce: put a panic!() somewhere in a background task, then observe how there are two panics instead of one.

The second panic (something regarding WouldBlock) comes from the fact that we call try_lock on a mutex that isn't expected to be locked but is still locked because of the first panic.
The proper fix is that we never reach again Wasm code again after the first panic happened.

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

Successfully merging a pull request may close this issue.

1 participant