Closed Bug 1949668 Opened 6 days ago Closed 6 days ago

Race condition between clearning mIsDeferredPurgePending and removing from the purge request list

Categories

(Core :: Memory Allocator, defect, P1)

defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox135 --- unaffected
firefox136 --- unaffected
firefox137 --- fixed

People

(Reporter: pbone, Assigned: jstutte)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Bug 1920451 changed the order of removing an arena from the list before purging dirty pages from it, this introduced a race condition.

Thread MayPurgeStep: Finds arena
Thread MayPurgeStep: Purges memory from arena and is finished so it clears mIsDeferredPurgePending
Thread 2: Releases more memory in the arena and sets mIsDeferredPurgePending
Thread 2: Adds the arena to the list of requests (a no-op, it's already there)
Thread MayPurgeStep: Removes arena from list.

Now the arena has the flag set but is not in the list. Deferred purging will never release memory from it.

I suggest removing the arena from the list before attempting to purge memory from it.

Set release status flags based on info from the regressing bug 1920451

:jstutte, since you are the author of the regressor, bug 1920451, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Assignee: nobody → jstutte
Flags: needinfo?(jstutte)
Pushed by jstutte@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4cb558574e3b Avoid a race that might end up with a situation where we stop purging an arena. r=smaug
Status: NEW → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: