Closed Bug 1552118 Opened 6 years ago Closed 6 years ago

Crash calling IsAboutToBeFinalized from a finalizer on a cell in the same sweep group

Categories

(Core :: JavaScript: GC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox68 --- wontfix
firefox69 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

During foreground finalization we currently release all empty arenas when we've finished sweeping the zone. However finalizers for cells in other zones in the same sweep group may not have been run yet. Trying to call IsAboutToBeFinalized from a finalizer on a cell in another zone in the same sweep group can fail if the cell is in an arena that we already released.

Bug 1546727 has a use case for doing this, to maintain a count of Debugger.Frame instances related to a JSScript by updating the script's count in the frame object's finalizer. These cells are in different zones in the same sweep group (debugger and debuggee respectively). This seems like a reasonable thing to want to do so we should support it.

Ugh, I uploaded the patch to bug 1551907 by mistake, where it has been reviewed. I'll try and move it to here.

This releases all foreground finalized arenas at the end of sweeping the sweep group rather than at the end of sweeping the zone (for objects) or immediately (for everything else) as happens currently. This simplifies the code in a couple of places and I don't think it will have any noticeable effects.

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/87221d5fcb98 Don't release foreground finalized arenas until the end of sweeping the zone group r=sfink
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: