Closed Bug 1586007 Opened 6 years ago Closed 6 years ago

Add assertions to catch access to marking state in other zones by finalizers

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

With a few expections, finalizers and sweeping code in general shouldn't depend on the marking state of GC things in other zones. Although IsMarked and IsAboutToBeFinalized will return sensible results (e.g. true and false respectively for non-collected zones), this is still an error. We should add assertions to catch this.

(Exceptions to this are be things like sweeping cross compartment wrappers, where the generic map sweeping code checks both key and value, and these can be in different zones).

This extends AutoSetThreadIsSweeping to take an optional zone parameter. When querying the marking state via IsAboutToBeFinalized and IsMarked calls we check this zone matches the zone of the thing we're looking at. This catches the problem in the Debugger.Frame finalizer.

Attachment #9098769 - Attachment description: Bug 1586007 - Check that finalizers and sweeping code doesn't access marking state for things in other zones r?sfink → Bug 1586007 - Check that finalizers and sweeping code doesn't access marking state for things in other zones r=sfink
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1f72718fefac Check that finalizers and sweeping code doesn't access marking state for things in other zones r=sfink
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: