Closed Bug 1683288 Opened 3 years ago Closed 3 years ago

Improve the mechanism used to set the OOM allocation size

Categories

(Toolkit :: Crash Reporting, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: gsvelto, Assigned: gerard-majax)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

See bug 1682975 comment 7 for why we would want to do this.

Right now we pass to the memory allocator a pointer to a function that gets called when we hit an OOM. The function takes the size of the allocation that couldn't be satisfied and sets a global variable in the crash reporting code. If the function pointer isn't set we don't set the annotation.

I was wondering if flipping things around would improve the situation: having a global variable in the memory allocator code that is set when we hit an OOM scenario with the size that couldn't be satisfied. Then we'd expose a function to read it (or expose the variable itself) and have the exception handler read it at crash time. Something like get_oom_abort_size(). This mechanism would be slightly simpler than set_oom_abort_handler() and since we don't have any other user of that function I think it might just be OK. Mike WDYT about this?

Flags: needinfo?(mh+mozilla)
Assignee: nobody → lissyx+mozillians
Status: NEW → ASSIGNED
Attachment #9219520 - Attachment is obsolete: true
Attachment #9219601 - Attachment is obsolete: true
Pushed by alissy@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/24cac1a6750d
Directly query OOMAllocationSize value and enable tests on linux/macOS r=gsvelto
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Blocks: 1709277

Looking at the nightly channel it seems like that the vast majority of OOM crashes now have the annotation set. The few which don't are those captured by WER and I filed bug 1711418 to fix them. There are still a very small amount of crashes that are still missing the annotation but they're so few that I think we can consider this fixed for good.

Blocks: 1716862
Flags: needinfo?(mh+mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: