-
Notifications
You must be signed in to change notification settings - Fork 82
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
Clarifying trap semantics #55
Comments
Great questions:
|
Ok that sounds reasonable. A question along those lines though: in some cases a trap is theoretically recoverable for example with an OOM trap from a |
Yeah, that's a good question too. Thinking through the Post-MVP, a custom adapter function, which itself controls the call to |
Ok that sounds like a reasonable stance for now. To summarize every component will have a "locked" flag and if set would cause a trap on entry to the instance in any case. In Python-like-pseudo-code we'd set the locked flag to True just before entry and to False after exit with the current In general though the intention is that for the MVP trap is equated with "the instance is poisoned and cannot ever be reused" and runtimes will need to ensure that the embedder either loses access to an instance on a trap or otherwise if an instance is reused it never actually goes back into wasm and quickly returns an embedder-level error. |
Yeah, I'd say we could reuse the |
Resolved by #57 |
In implementing post-return I realized that I ended up having a few questions about the semantics of traps with components which may be worth calling out explicitly in the canonical ABI explainer or otherwise just resolving my questions here:
canon_lift
if thelower
operation traps/errors thenmay_leave
is set toFalse
which would trigger the prior assert the next time the function is called (if it could even be called)canon_lift
if thelift
operation traps/errors thenmay_enter
is left asFalse
and all future calls tocanon_lift
will trapcanon_lower
there are similar consequences ascanon_lift
but in reverse.I vaguely recall the idea that when an instance traps it poisons the entire component instance as being impossible to enter, but I'm not sure if that's what's expected (since otherwise that would transitively poison everything right now I think and only an embedder could catch the error). Otherwise though I didn't see many other references to traps and recovery in the current canonical ABI explainer.
The text was updated successfully, but these errors were encountered: