Closed Bug 2081105 Opened 1 month ago Closed 1 month ago

Failure during SplitAndAllocRun can leave the allocator in an inconsistent state

Categories

(Core :: Memory Allocator, defect, P1)

defect

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

Details

Attachments

(1 external file)

If AllocRun() finds a run from a spare chunk then calls SplitAndAllocRun() which calls pages_commit() but that fails, then it will leave the chunk in an inconsistent state, specifically the still-empty chunk would be put on mChunksDirty, its run in mRunsAvail and not in mSpares. All these are incorrect, empty chunks are assumed to be spares and never in mRunsAvail or mChunksDirty. In debug builds this will probably hit an assertion, in release builds it can lead to decommitted memory being allocated (because the purging code will not remove the chunk's run from mRunsAvail since it assumes it's not there.

This is probably very rare, and happens when the process may be about to crash due to running out of memory anyway, so the user may not notice but we would see weird crashes on windows, like Bug 2075855 (but this is not the cause of Bug 2075855).

See Also: → 2075855
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: