-
Notifications
You must be signed in to change notification settings - Fork 262
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
Properly define possible errno results #215
Comments
This is a good line of inquiry and we could make some significant improvements to WASI's representation of errors. WASI interfaces should never trap, except for functions marked I don't think WASI's current use of the posix-style all-errors-in-one-enum |
For syscalls like |
Thanks for filing this. As Pat speculated above, we decided against having the "all-errors-in-one-enum errno". Once WASI modularization is complete, we'll be refactoring the errors so that each module only contains the errors that are relevant to its functions. In the later stages of that process, we will be auditing each function to enumerate all the variants it can reasonably return. That work is taking place in various proposal repos and being tracked in the project linked above, so I'm going to close this one out. |
Is it required to delay definition of errors until post modularization? Currently implementations use different codes due to this not being addressed for two years. This means they are not compatible in material ways as well cause implementation delays as people fumble around wondering which codes to use. |
It isn't strictly required to wait for modularization, but modularization isn't the only thing happening here, there's also the transition to the new wit-based tooling, along with the new interface-types support. For |
that is a problem for those who specifically want 100% deterministic execution, part of that is that |
Environments which require 100% deterministic execution should ideally not provide the |
ah, yeah, that likely works better |
Just to clarify the problem is more general than nuance of random source. For example, a great start would be defining code one should use when pointers for result params are invalid (ex. argc is out of range of the underlying memory). Maybe with that carved out, we can proceed one-by-one with functions? |
For the most part, WASI in its current form falls back on POSIX-like conventions. POSIX would likely use The broader situation with the argv/argc functions is that we haven't put much effort into polishing the details, because we've been preparing to redesign them entirely when we have the new interface types tooling underneath us. If anyone is interested in working on error codes, the filesystem functions might be a good place to start. The spec is here, and already converted to the new wit format, and it's ready to accept PRs. |
Currently, the possible results of sys calls returning errno are an undefined behaviour.
For example, let's get args get. What should be the effect if the pointer is out of bounds, should it trap the execution, or return errno? If it should return errno, which one?
What other errno's can occur resulting from args.get function and when?
The text was updated successfully, but these errors were encountered: