Failure during SplitAndAllocRun can leave the allocator in an inconsistent state
Categories
(Core :: Memory Allocator, defect, P1)
Tracking
()
| 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).
| Assignee | ||
Comment 1•1 month ago
|
||
Comment 3•1 month ago
|
||
| bugherder | ||
Updated•28 days ago
|
Description
•