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

Call process::exit in WASI proc_exit syscall. #373

Closed
wants to merge 1 commit into from

Conversation

kanaka
Copy link

@kanaka kanaka commented Apr 20, 2019

Currently calling proc_exit causes an exception and does not set the exit code. This updates the syscall to use std::process::exit instead of calling Err.

Fixes: #361

@lachlansneff
Copy link
Contributor

Wasmer is designed to run multiple tenants and as a result, the WASI integration is also designed to be multi-tenant. Calling the exit syscall will just kill the process, even if there are other instances running.

There's some functionality missing in wasmer that needs to be implemented that will allow the runtime to retrieve the exit code from the thrown exception, which will fix this issue.

@kanaka
Copy link
Author

kanaka commented Apr 21, 2019

@lachlansneff ah, so I assume that the if there is only a single tenant then when that tenant exits, it's exit code (if there is one) becomes exit code of the wasmer process. If you have multiple tenants, I assume you would delay exit until all tenants have exited? Out of curiosity do you just pick the exit code of the last tenant "thread" to be the wasmer exit code?

I'll close this PR and just wait (impatiently) for the original issue to be addressed the right way for wasmer's architecture :-)

@kanaka kanaka closed this Apr 21, 2019
@lachlansneff
Copy link
Contributor

This issue will be fixed today, promise!

The wasmer cli program is one-tenant only right now, so it'll just return the exit code of that tenant.

surban pushed a commit to rust-wasi-web/wwrr that referenced this pull request Nov 9, 2024
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 this pull request may close these issues.

WASI proc_exit throws exception instead of returning error code
2 participants