| Summary: | JSArrayBufferView::byteOffsetConcurrently has a race when using PAC | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> | ||||
| Component: | JavaScriptCore | Assignee: | Saam Barati <saam> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ews-watchlist, keith_miller, mark.lam, msaboff, tzagallo, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Saam Barati
2021-07-07 12:53:05 PDT
Seems like the bug is in:
inline std::optional<unsigned> byteOffsetConcurrently();
My guess is we're detaching concurrently.
(In reply to Saam Barati from comment #1) > Seems like the bug is in: > inline std::optional<unsigned> byteOffsetConcurrently(); > > > My guess is we're detaching concurrently. yeah, looks like that's what the test is doing: //@ slow! //@ runDefault("--jitPolicyScale=0") // This test should not crash. script = ` let a = new Int32Array(1); for (let i = 0; i < 1000; ++i) ~a.byteOffset; transferArrayBuffer(a.buffer); eval(a.byteOffset); let description = describe(a.byteOffset); if (description !== 'Int32: 0') print(description); `; const iterations = 1000; for (let i = 0; i < iterations; i++) runString(script); I think the fix is to have a different version of vector() for when run from the concurrent thread. Created attachment 433100 [details]
patch
Comment on attachment 433100 [details]
patch
r=me. Is there anyway to assert that vectorWithoutPACValidation() is not called by the mutator? Maybe not. Just thought I'd ask.
(In reply to Mark Lam from comment #5) > Comment on attachment 433100 [details] > patch > > r=me. Is there anyway to assert that vectorWithoutPACValidation() is not > called by the mutator? Maybe not. Just thought I'd ask. This patch is making it so that vectorWithoutPACValidation is called on the mutator. So asserting would immediately crash. This patch aligns what the mutator thread already does when inlined in DFG/FTL's byte offset implementation. Committed r279707 (239499@main): <https://commits.webkit.org/239499@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433100 [details]. |