Assertion failure: zone->needsMarkingBarrier(), at checkouts/gecko/js/src/gc/Marking.cpp:951
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox150 | + | fixed |
| firefox151 | + | fixed |
| firefox152 | + | fixed |
People
(Reporter: tsmith, Assigned: iain)
References
(Blocks 2 open bugs, Regression, )
Details
(5 keywords, Whiteboard: [adv-main150.0.2+r])
Attachments
(2 external files)
Found with m-c 20260430-3d6e8c604cf2 (--enable-debug)
This was found by visiting a live website with a debug build. Marking as s-s as a precaution until reviewed.
STR:
- Launch browser and visit site
This issue was triggered by visiting http://www.icloud.com/keynote/0hmu8sUZRot_9XJACva_hdnKA#DocGroup%5FLabeling%5Fin%5FQuantum%5FDOM.
Assertion failure: zone->needsMarkingBarrier(), at checkouts/gecko/js/src/gc/Marking.cpp:951
0|0|xul.dll|js::gc::PerformIncrementalReadBarrier(js::gc::TenuredCell*)|git:github.com/mozilla-firefox/firefox:js/src/gc/Marking.cpp:fcf41d17dfad8cf127eaccab48a783899ee01d4c|951|0x199
0|1|xul.dll|js::jit::WeakMapValueReadBarrier(js::gc::TenuredCell*, JS::Zone*)|git:github.com/mozilla-firefox/firefox:js/src/jit/VMFunctions.cpp:fcf41d17dfad8cf127eaccab48a783899ee01d4c|3460|0x80
0|2|||||
0|3|xul.dll|js::CheckContextLocal::check() const|git:github.com/mozilla-firefox/firefox:js/src/threading/ProtectedData.cpp:fcf41d17dfad8cf127eaccab48a783899ee01d4c|51|0x67
0|4|||||
0|5|xul.dll|js::jit::AssertPropertyLookup(js::NativeObject*, JS::PropertyKey, unsigned int)|git:github.com/mozilla-firefox/firefox:js/src/jit/VMFunctions.cpp:fcf41d17dfad8cf127eaccab48a783899ee01d4c|3446|0x8b
Comment 1•6 months ago
•
|
||
Test case:
// Assertion failure: zone->needsMarkingBarrier(), at gc/Marking.cpp:951
//
// visitWeakMapGetObject in Ion hardcodes the compilation zone as an immediate
// for the WeakMapValueReadBarrier call. If the stored value is a Symbol (atoms
// zone) and a zone-specific incremental GC runs, the compilation zone needs a
// marking barrier but the symbol's zone (atoms zone) does not, causing the
// assertion in PerformIncrementalReadBarrier to fire.
//
// Run: js --fast-warmup --no-threads test.js
let wm = new WeakMap();
let key = {};
wm.set(key, Symbol());
function get() {
return wm.get(key);
}
function main() {
get();
schedulezone(key);
startgc(1);
while (gcstate() !== "NotActive") {
get();
gcslice(100);
}
}
main();
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
| Assignee | ||
Comment 3•6 months ago
|
||
Updated•6 months ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 4•6 months ago
|
||
I'm not sure how bad the bug is, so I'm putting the test in a separate patch just in case.
| Reporter | ||
Comment 5•6 months ago
|
||
A Pernosco session is available here: https://pernos.co/debug/NAe03TX5fadL_mTTRZREVw/index.html
Sorry it was delayed coming in, but since I already had the session I might as well attach it.
Comment 6•6 months ago
|
||
Is this a security issue, Jon? It sounds like we're doing a read barrier on something that doesn't need one? Thanks.
Comment 7•6 months ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #6)
The problem is we can miss the read barrier in a zone GC because the code currently checks the wrong zone. This means we can leave a symbol or marked gray incorrectly, creating a black to gray edge.
Comment 8•6 months ago
|
||
Thanks. I think I've been calling black to gray edges sec-moderate. They can lead to a "use after unlink" which could result in a use after free if an unlink method is doing something weird.
Updated•6 months ago
|
| Assignee | ||
Comment 9•6 months ago
|
||
Comment on attachment 9575910 [details]
(secure)
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Potential for creating a black->gray edge
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Simple local fix. Clearly more correct than existing code.
- String changes made/needed:
- Is Android affected?: Yes
Updated•6 months ago
|
Comment 10•6 months ago
|
||
Updated•6 months ago
|
Comment 11•6 months ago
|
||
Comment 12•6 months ago
|
||
Comment on attachment 9575910 [details]
(secure)
Approved for 150.0.2 dot release and 151.0b7
Comment 13•6 months ago
|
||
| 150.0.2 uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 14•6 months ago
|
||
| uplift | ||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 15•2 months ago
|
||
Comment 16•2 months ago
|
||
Comment 17•2 months ago
|
||
Reverted this because it was causing sm bustages in bug2036256.js
- Revert link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | js/src/jit-test/tests/gc/bug2036256.js | /builds/worker/checkouts/gecko/js/src/jit-test/tests/gc/bug2036256.js:12:10 Error: Incremental GC already in progress (code 3, args "--fast-warmup --no-threads") [0.1 s]
Comment 18•2 months ago
|
||
Comment 19•2 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•2 months ago
|
Description
•