-
Notifications
You must be signed in to change notification settings - Fork 458
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
[spec] Normative: Remove ahead of time bounds checks from instantiation #820
[spec] Normative: Remove ahead of time bounds checks from instantiation #820
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but I think we need approval from the CG before we can land it. Maybe put it on the agenda of one of the next meeting?
document/core/exec/modules.rst
Outdated
@@ -613,10 +613,6 @@ It is up to the :ref:`embedder <embedder>` to define how such conditions are rep | |||
|
|||
h. Let :math:`\X{eend}_i` be :math:`\X{eo}_i` plus the length of :math:`\elem_i.\EINIT`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe move this down to where it is actually used first now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
document/core/exec/modules.rst
Outdated
@@ -635,17 +631,17 @@ It is up to the :ref:`embedder <embedder>` to define how such conditions are rep | |||
|
|||
h. Let :math:`\X{dend}_i` be :math:`\X{do}_i` plus the length of :math:`\data_i.\DINIT`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
12th is probably too soon, so maybe the meeting on the 26th? |
Sounds good. I won't be able to attend the 12th anyway. |
Added future meeting item here |
I'll keep this open until at least the next CG, but it seems the consensus from this week's meeting was that we should go with this solution, but bundle it with the bulk memory proposal. |
Is it practical to further relax this to do the bounds check for each byte/element copied? As noted in the original issue, an extension that adds shrinking memories/tables or page protection makes it impractical to ensure the copy will be all-or-nothing. |
After @jfbastien pointed this out, we concluded in WebAssembly/threads#96 that we would need to do basically as you propose. The current idea is that segment initialization and bulk operations will (observably) perform writes from low to high addresses in order at byte/element granularity until oob. I think this still needs to be fleshed out in the proposal repo, however. |
Closing, as this behavior is moved to the bulk memory proposal. |
See WebAssembly/threads#94 for background. The current specification does not extend neatly to the multi-threaded case.
This PR corresponds to potential solution 2, which received a broadly positive initial response, and would allow data initialisers to be used with shared memories.
I choose to make the per-initialiser bounds checks result in a Trap/RuntimeError rather than a Fail/LinkError, since this makes the behaviour indistinguishable from using bulk memory operations in the start function, and I believe users might expect LinkError to guarantee no side effects have taken place.