Closed Bug 1477743 (resab) Opened 6 years ago Closed 4 years ago

[meta] Re-enable SharedArrayBuffer and Atomics by default

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox63 --- affected

People

(Reporter: lth, Unassigned)

References

(Blocks 3 open bugs)

Details

(Keywords: dev-doc-complete, meta)

Currently SharedArrayBuffer and Atomics are disabled by defaults on all branches due to the Spectre complex of bugs.

This bug is a tracker for bugs and work items that more-or-less must be completed before we can re-enable those features by default again.
Depends on: 1480012
Depends on: 1481171
Depends on: 1480725
Depends on: 1470490
Depends on: 1360190
Depends on: 1360434
Depends on: wasm-bulkmem
Depends on: 1349863
No longer depends on: fission
Depends on: 1525036
Depends on: 1525330

Is there any update on this? Chrome now already enable SharedArrayBuffer by default.

Working on it. The bugs most recently added as blockers (see directly above) are blocking this, for security reasons.

Depends on: 1530303
Depends on: 1543066
Depends on: 1543068
Depends on: 1554680
Depends on: 1557639
Depends on: 1561712
Depends on: 1562223
Depends on: 1562667
Depends on: 1563335
Blocks: 1563480
No longer depends on: wasm-bulkmem
No longer depends on: 1349863, 1360190
No longer depends on: 1360434

I've moved all dependencies that do not block a minimum viable product to block bug 1563480 instead. (Note that some of the dependencies here have dependencies of their own. There's still quite a bit remaining.)

Depends on: 1565199
Depends on: 1565205
Depends on: 1567483

Adding bug 1561594 as a dependency as it's relatively straightforward to fix and it would be good if developers did not have to copy buffers when using the encoding API from the start.

Depends on: 1561594
Depends on: 1574690
Alias: resab
No longer depends on: 1565205
Blocks: 1389458
Depends on: 1579992
Depends on: 1579012
Depends on: 1574000
Depends on: 1582200
Depends on: 1523986
Depends on: 1586217
Depends on: 1566868
Depends on: 1590539
Depends on: 1591892
Depends on: 1570889
Depends on: 1593447
Depends on: 1594748
Depends on: 1576153
Depends on: 1575425
Depends on: document-channel
Depends on: 1587007
Depends on: 1598612
No longer depends on: 1444155
Depends on: 1599496
Depends on: 1599295
Depends on: 1596682
No longer depends on: document-channel
Depends on: 1601594
Depends on: 1602363
Depends on: 1605176
Depends on: 1606624
No longer depends on: 1599496
No longer depends on: 1599295
No longer depends on: 1575425
No longer depends on: 1525330
No longer depends on: 1598612
Depends on: 1607460
Depends on: 1595848
No longer depends on: 1576153
No longer depends on: 1561594
Depends on: 1613061
No longer depends on: 1603168
No longer depends on: 1565199
No longer depends on: 1532287
Depends on: 1613066
No longer depends on: 1557639
No longer depends on: 1570889
No longer depends on: 1607460
Depends on: 1619649
Blocks: 1619655
Blocks: 1633244
Blocks: 1648685
No longer depends on: 1595848

This is now considered done, see bug 1563480 and other blocking bugs for follow-up work. See bug 1619649 for information on shipping, eta Fx 79.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME

Should this already work?

I am running Nightly 80.0a1 (2020-07-22) (64-Bit) on Linux, and when I try to run a simple pthread demo compiled with emscripten, all I get is:
Uncaught ReferenceError: SharedArrayBuffer is not defined
<anonymous> file:///home/ce/temp/threadtest.js:1414

... despite javascript.options.shared_memory is set to true in about:config.

Also, all the wasm+threads demos I found using search engines did not run and failed in one way or another.

Clemens: I think this requires the COEP and COOP headers to be correctly set too; see doc links in comment 7 to learn more about those.

Benjamin: Thanks for the hint.

I've now configured lighttpd to append those headers for every request, and thanks to the developer tools I can verify they are really served:
HTTP/1.1 200 OK
Content-Type: text/html
Accept-Ranges: bytes
ETag: "3914898211"
Last-Modified: Thu, 23 Jul 2020 12:42:20 GMT
Cross-Origin-Oper-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Content-Length: 102680
Date: Thu, 23 Jul 2020 12:48:25 GMT
Server: lighttpd/1.4.55

yet, all I get is:
Uncaught ReferenceError: SharedArrayBuffer is not defined
<anonymous> http://localhost/threadtest.js:1414
threadtest.js:1414:9
<anonym> http://localhost/threadtest.js:1414

ok, typo in the docs:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
"Oper" should be "Opener"
Cross-Origin-Oper-Policy: same-origin

Thanks! Fixed.
You also need a secure context (https), I think.

localhost is a secure context so that part is covered.

You need to log in before you can comment on or make changes to this bug.