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

Can Wasi ExitCode be negative? #5131

Closed
gluax opened this issue Oct 3, 2024 · 1 comment · Fixed by #5151
Closed

Can Wasi ExitCode be negative? #5131

gluax opened this issue Oct 3, 2024 · 1 comment · Fixed by #5151
Assignees
Labels
📦 lib-wasi About wasmer-wasi ❓ question I've a question!
Milestone

Comments

@gluax
Copy link

gluax commented Oct 3, 2024

Summary

A clear and concise summary of your question.

I see that https://docs.rs/wasmer-wasix-types/0.27.0/wasmer_wasix_types/wasi/enum.ExitCode.html has an i32 and as such when you ask for the raw exit code it gives an i32.

But after searching around a bit, I don't see a situation in which it would be negative. I see that Errno is repr(u16). Can this actually be negative anywhere?

I could be missing it somewhere since a from impl exists:

impl From<ExitCode> for i32 {
    fn from(val: ExitCode) -> Self {
        match val {
            ExitCode::Errno(err) => err.to_native(),
            ExitCode::Other(code) => code,
        }
    }
}

Additional details

N/A

@gluax gluax added the ❓ question I've a question! label Oct 3, 2024
@gluax gluax changed the title Wasi ExitCode Wasi ExitCode can be negative? Oct 3, 2024
@gluax gluax changed the title Wasi ExitCode can be negative? Can Wasi ExitCode be negative? Oct 3, 2024
@xdoardo
Copy link
Contributor

xdoardo commented Oct 17, 2024

Thanks for the report, seems like a bug on our side.

@xdoardo xdoardo added this to the v5.0 milestone Oct 17, 2024
@xdoardo xdoardo added the 📦 lib-wasi About wasmer-wasi label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-wasi About wasmer-wasi ❓ question I've a question!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants