Bug 220364 - Should SharedArrayBuffer/WebAssembly.Memory really throw?
Summary: Should SharedArrayBuffer/WebAssembly.Memory really throw?
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2021-01-06 08:37 PST by Sam Sneddon [:gsnedders]
Modified: 2021-05-14 06:52 PDT (History)
16 users (show)

See Also:


Attachments
Patch (192.72 KB, patch)
2021-01-22 18:13 PST, Yusuke Suzuki
mark.lam: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (68.50 KB, patch)
2021-01-22 19:43 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2021-01-06 08:37:54 PST
Currently in ToT (and STP 117+), trying to create a SharedArrayBuffer throws with "Shared WebAssembly.Memory and SharedArrayBuffer are not enabled".

This has caused a variety of WPT tests to regress (e.g., many encoding tests), due to https://github.com/web-platform-tests/wpt/blob/master/common/sab.js silently creating a non-shared WebAssembly.Memory (as would be expected of an unsupported option) previously but now throwing with that TypeError.
Comment 1 Radar WebKit Bug Importer 2021-01-13 08:38:11 PST
<rdar://problem/73152534>
Comment 2 Yusuke Suzuki 2021-01-22 18:13:10 PST
Created attachment 418204 [details]
Patch
Comment 4 Mark Lam 2021-01-22 19:20:26 PST
Comment on attachment 418204 [details]
Patch

r=me if EWS bots are green.
Comment 5 Yusuke Suzuki 2021-01-22 19:41:46 PST
I'll only update sab.js and wasm for now.
Comment 6 Yusuke Suzuki 2021-01-22 19:43:54 PST
Created attachment 418208 [details]
Patch
Comment 7 Yusuke Suzuki 2021-01-22 20:40:24 PST
Debug failure http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html is flaky and unrelated to wpt / wasm
Comment 8 Yusuke Suzuki 2021-01-22 20:58:54 PST
Committed r271774: <https://trac.webkit.org/changeset/271774>
Comment 9 Simon Fraser (smfr) 2021-01-23 11:12:36 PST
Comment on attachment 418208 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418208&action=review

> Source/JavaScriptCore/ChangeLog:8
> +        Not accessing "shared" field if Options::useSharedArrayBuffer() is false.

This doesn't tell me the answer to the question in the title.
Comment 10 Mark Lam 2021-01-23 11:37:01 PST
(In reply to Simon Fraser (smfr) from comment #9)
> Comment on attachment 418208 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=418208&action=review
> 
> > Source/JavaScriptCore/ChangeLog:8
> > +        Not accessing "shared" field if Options::useSharedArrayBuffer() is false.
> 
> This doesn't tell me the answer to the question in the title.

The answer is no.  The above comment was trying to say, "we should not access the `shared` field if Options::useSharedArrayBuffer() is false".
Comment 12 Sam Sneddon [:gsnedders] 2021-05-14 06:52:06 PDT
Filed https://github.com/web-platform-tests/wpt/pull/28998 to workaround the constructor unexpectedly throwing.