-
Notifications
You must be signed in to change notification settings - Fork 53
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
Handling the exit trap #30
Comments
It looks like I am mistaken; the only change in behavior is that nonzero exit codes result in a trap now. That's great, actually! But I'd still need some nice way to handle the trap. |
After more testing I think my original conclusion was accurate; I later dismissed it because wasmtime 0.17 had another issue, which is that it looks like setting argv doesn't work at all. |
Ah yes, I'll add C API functions for inspecting this so a new exception class can be implemented here. |
This allows embedders to take a different action when a WASI program exits depending on whether it exited with an exit status or exited with a trap. cc bytecodealliance/wasmtime-py#30
This allows embedders to take a different action when a WASI program exits depending on whether it exited with an exit status or exited with a trap. cc bytecodealliance/wasmtime-py#30
This allows embedders to take a different action when a WASI program exits depending on whether it exited with an exit status or exited with a trap. cc bytecodealliance/wasmtime-py#30
* Add an `ExitTrap` subclass of `Trap` * Return an appropriate trap from `Trap.__from_ptr__` * Attach the exit code via a `code` field Closes bytecodealliance#30
* Add an `ExitTrap` subclass of `Trap` * Return an appropriate trap from `Trap.__from_ptr__` * Attach the exit code via a `code` field Closes bytecodealliance#30
Ok I've added bindings for this at #35 |
This allows embedders to take a different action when a WASI program exits depending on whether it exited with an exit status or exited with a trap. cc bytecodealliance/wasmtime-py#30
Since wasmtime-py 0.18.0, it seems that when the
main()
function returns, the call to_start()
also simply returns, which is good. However, it looks like ifexit()
is called, then the result is awasmtime._trap.Trap: Exited with i32 exit status 1
. It is not clear how this trap can be handled besides matching the exception message with a regex.The text was updated successfully, but these errors were encountered: