WeakCache<GCHashMap<>> can trigger assertions in StoreBuffer::checkAccess() when used with nursery pointers
Categories
(Core :: JavaScript: GC, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(3 files)
As discovered by Jan.
Access to the store buffer during sweeping is protected by a lock and we assert that it is held. Unfortunately we are failing to take the lock sometimes.
This is because GCHashMap::traceWeakEntries doesn't match the version in GCHashSet. It should not initialise e in the for loop:
https://searchfox.org/mozilla-central/rev/169951beec18e0505611537cfdcf7f7d3a330404/js/public/GCHashTable.h#91
https://searchfox.org/mozilla-central/rev/169951beec18e0505611537cfdcf7f7d3a330404/js/public/GCHashTable.h#280
| Assignee | ||
Comment 1•1 year ago
|
||
This is a problem because destroying the Enum may require taking the store
buffer lock which we don't hold at this point. That's why these methods take an
Enum, so that we can control its lifetime like this.
This brings it into line with the GCHasSet version.
| Assignee | ||
Comment 2•1 year ago
|
||
This removes a bunch of duplicated code with templates.
| Assignee | ||
Comment 3•1 year ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a4ac153694bb
https://hg.mozilla.org/mozilla-central/rev/8dfa41c62f75
https://hg.mozilla.org/mozilla-central/rev/653eb1da5405
https://hg.mozilla.org/mozilla-central/rev/c1a6cbe444a7
Description
•