Closed Bug 1521223 Opened 9 months ago Closed 9 months ago

Add an interface to deliberately leak an object

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

Details

Attachments

(2 files)

It would be good if we had a mochitest unit test for leak checking, to cover the case where an object leaks. Right now there is one, but it uses a fake leak log. We need some interface that can be called from privileged JS that can leak an object that will show up in the leak log. The object it leaks shouldn't be used otherwise.

This is needed to test various leak checking harnesses.

In the second patch, I updated the mochitest test to actually leak, using the API I added in part 1, but the status and level reported are "warning" instead of some kind of failure like the ASan one. Is that expected? It seems weird, but I'm not at all familiar with how this works.

Flags: needinfo?(ahal)

ahal explained in the review comment that "warning" means "orange". I'm too used to thinking of compiler warnings, which are non-fatal...

Flags: needinfo?(ahal)
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7955097a8041
part 1 - Add an API to deliberately leak an object. r=froydnj
https://hg.mozilla.org/integration/autoland/rev/0b9c766c352f
part 2 - Update the leakcheck test to work on a real leak log. r=ahal
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.