Closed Bug 1711100 Opened 4 years ago Closed 4 years ago

Remove XPCOM leak logging from nsTArray_base

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(1 file)

This is for a few reasons:

  • The leak logging isn't as useful as other types of logging, as
    nsTArray_base is frequently relocated without invoking a constructor,
    such as when stored within another nsTArray. This means that
    XPCOM_MEM_LOG_CLASSES cannot be used to identify specific leaks of
    nsTArray objects.

  • The nsTArray type is layout compatible with the ThinVec crate with the
    correct flags, and ThinVec does not currently perform leak logging.
    This means that if a large number of arrays are transferred between rust
    and C++ code using ThinVec, for example within another ThinVec, they
    will not be logged correctly and might appear as e.g. negative leaks.

  • Leaks which have been found thanks to the leak logging added by this
    type have often not been significant, and/or have needed to be
    circumvented using some other mechanism. Most leaks found with this type
    in them also include other types which will continue to be tracked.

If people are leaking nsTArrays of plain data that isn't tracked by leak checking, that should still show up in LSan, as a last resort.

This is for a few reasons:

  • The leak logging isn't as useful as other types of logging, as
    nsTArray_base is frequently relocated without invoking a constructor,
    such as when stored within another nsTArray. This means that
    XPCOM_MEM_LOG_CLASSES cannot be used to identify specific leaks of
    nsTArray objects.

  • The nsTArray type is layout compatible with the ThinVec crate with the
    correct flags, and ThinVec does not currently perform leak logging.
    This means that if a large number of arrays are transferred between rust
    and C++ code using ThinVec, for example within another ThinVec, they
    will not be logged correctly and might appear as e.g. negative leaks.

  • Leaks which have been found thanks to the leak logging added by this
    type have often not been significant, and/or have needed to be
    circumvented using some other mechanism. Most leaks found with this type
    in them also include other types which will continue to be tracked.

Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9128360a5bf5 Remove XPCOM leak logging from nsTArray_base, r=mccr8
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: