Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Using [[ArrayBufferData]] for shared memory makes SharedArrayBuffers transferable, contrary to intent #144

Closed
lars-t-hansen opened this issue Sep 12, 2016 · 6 comments
Labels

Comments

@lars-t-hansen
Copy link
Collaborator

lars-t-hansen commented Sep 12, 2016

According to the HTML spec, if an object has an [[ArrayBufferData]] internal slot that is not detached then the object is transferable, see https://html.spec.whatwg.org/multipage/infrastructure.html#istransferable.

Recently we made the change that we use [[ArrayBufferData]] even for a Shared Data Block, and this slot cannot become detached. This was a much-desired change. But roughly at the same time we decided that postMessage() should not allow for a SharedArrayBuffer in the transfer list, and this is now encoded in the SAB companion spec for DOM, see https://tc39.github.io/ecmascript_sharedmem/dom_shmem.html.

Clearly these decisions are not quite compatible. The fix is probably to hack up the HTML spec to discriminate better. This needs to be noted with greater specificity in section 1.5 of our DOM companion spec.

@littledan
Copy link
Member

Sorry for not realizing the effect here--this seems like exactly why we shouldn't've done the change that I was pushing for. Reverting the change would be an acceptable path, but I like the idea to do the fix in HTML.

@lars-t-hansen
Copy link
Collaborator Author

@littledan, fixing HTML to have a tighter spec for is-transferable is pretty clean, imo. Now that we've made the change in this proposal I'm not eager to revert it.

@flagxor
Copy link

flagxor commented Apr 11, 2017

Does this issue still need to be open?
Doesn't this encompass the same concern?
https://codereview.chromium.org/2809253002/

@lars-t-hansen
Copy link
Collaborator Author

@flagxor This is technically about the HTML spec. They are working on cleaning up the structured clone algorithm, whatwg/html#2421 is a good place to start. Until that's been landed this bug should probably stay open.

(I don't see how the referenced bug is relevant here?)

annevk pushed a commit to whatwg/html that referenced this issue Apr 16, 2017
annevk pushed a commit to whatwg/html that referenced this issue Apr 25, 2017
Additionally, define StructuredSerializeForStorage when for
serializable objects need to be stored more persistently.

Tests: web-platform-tests/wpt#5003.

Fixes #2260 (by being the last in a set of fixes). Closes
tc39/proposal-ecmascript-sharedmem#144 and closes
tc39/proposal-ecmascript-sharedmem#65.
annevk pushed a commit to whatwg/html that referenced this issue Apr 26, 2017
Additionally, define StructuredSerializeForStorage when for
serializable objects need to be stored more persistently.

Tests: web-platform-tests/wpt#5003.

Fixes #2260 (by being the last in a set of fixes). Closes
tc39/proposal-ecmascript-sharedmem#144 and closes
tc39/proposal-ecmascript-sharedmem#65.
annevk added a commit to whatwg/html that referenced this issue Apr 28, 2017
Additionally, define StructuredSerializeForStorage when for
serializable objects need to be stored more persistently.

Tests: web-platform-tests/wpt#5003.

StructuredSerializeForStorage follow-up:

* whatwg/notifications#99
* w3c/IndexedDB#197

Fixes #2260 (by being the last in a set of fixes). Closes
tc39/proposal-ecmascript-sharedmem#144 and closes
tc39/proposal-ecmascript-sharedmem#65.
@annevk
Copy link
Member

annevk commented May 2, 2017

This can be closed.

@lars-t-hansen
Copy link
Collaborator Author

Make it so.

inikulin pushed a commit to HTMLParseErrorWG/html that referenced this issue May 9, 2017
Additionally, define StructuredSerializeForStorage when for
serializable objects need to be stored more persistently.

Tests: web-platform-tests/wpt#5003.

StructuredSerializeForStorage follow-up:

* whatwg/notifications#99
* w3c/IndexedDB#197

Fixes whatwg#2260 (by being the last in a set of fixes). Closes
tc39/proposal-ecmascript-sharedmem#144 and closes
tc39/proposal-ecmascript-sharedmem#65.
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this issue May 9, 2017
Additionally, define StructuredSerializeForStorage when for
serializable objects need to be stored more persistently.

Tests: web-platform-tests/wpt#5003.

StructuredSerializeForStorage follow-up:

* whatwg/notifications#99
* w3c/IndexedDB#197

Fixes whatwg#2260 (by being the last in a set of fixes). Closes
tc39/proposal-ecmascript-sharedmem#144 and closes
tc39/proposal-ecmascript-sharedmem#65.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
Additionally, define StructuredSerializeForStorage when for
serializable objects need to be stored more persistently.

Tests: web-platform-tests/wpt#5003.

StructuredSerializeForStorage follow-up:

* whatwg/notifications#99
* w3c/IndexedDB#197

Fixes whatwg#2260 (by being the last in a set of fixes). Closes
tc39/proposal-ecmascript-sharedmem#144 and closes
tc39/proposal-ecmascript-sharedmem#65.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants