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

wasmi_cli doesn't preserve WASI exit status #675

Closed
yamt opened this issue Feb 13, 2023 · 2 comments · Fixed by #677
Closed

wasmi_cli doesn't preserve WASI exit status #675

yamt opened this issue Feb 13, 2023 · 2 comments · Fixed by #677

Comments

@yamt
Copy link

yamt commented Feb 13, 2023

when a wasi module calls proc_exit(0), wasmi_cli says Error: failed during execution of _start: Exited with i32 exit status 0 and exit with 1.
it's common for this kind of cli wasm runner programs to relay wasi exit code to host exit(). i guess wasmi_cli should follow the convention.

@Robbepop
Copy link
Member

Robbepop commented Feb 13, 2023

@yamt Thanks a lot for reporting this wasmi_cli bug!

So this means that if a WASI program terminates with proc_exit(0) then it returns an error with exit code 0 that is acutally not an error and therefore wasmi_cli should not treat it as such?

@Robbepop Robbepop changed the title wasmi_cli doesn't preserve wasi exit status wasmi_cli doesn't preserve WASI exit status Feb 13, 2023
@yamt
Copy link
Author

yamt commented Feb 13, 2023

@yamt Thanks a lot for reporting this wasmi_cli bug!

So this means that if a WASI program terminates with proc_exit(0) then it returns an error with exit code 0 that is acutally not an error and therefore wasmi_cli should not treat it as such?

yes.
the common convention is if a wasi command calls proc_exit(N), the runner program (in this case wasmi_cli) itself exits with exit code N.

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.

2 participants