Closed Bug 1691373 Opened 3 years ago Closed 3 years ago

MARK_DELAYED phase can occur under SWEEP_MARK on the main thread

Categories

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

defect

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

Currently we check whether we're on the main thread to work out whether we're running a helper thread task whether we should report the MARK_DELAYED phase or not. That doesn't work because we can run helper thread tasks on the main thread if they have been dispatched but not picked up by any helper thread.

The reason this hasn't shown up is that delayed marking only happens on OOM and helper thread tasks are only run on the main thread when there are lot of tasks queued. Both are uncommon in practice. I managed to provoke this while testing however.

I was looking at the wrong version of the code while I filed this.

What actually happens is that we check the current GC state in GCMarker::markAllDelayedChildren to work out whether to report the MARK_DELAYED phase. We can just pass in the reportTime flag from the caller instead.

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1473dbb7ada0
Pass reportTime to GCMarker::markAllDelayedChildren rather than checking current GC phase r=sfink
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: