Closed Bug 1570666 Opened 5 years ago Closed 5 years ago

test_ext_native_messaging xpcshell test leaks GC things at shutdown

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jonco, Assigned: rpl)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached file test_ext_native_messaging.txt (deleted) —

The following xpconnect test leaks JS GC things at shutdown:

toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js

Logfile attached.

If I comment out the test_connect_native_from_content_script test added in bug 1518843 the leak goes away.

Flags: needinfo?(agi)
Regressed by: 1518843
Keywords: regression

I don't know what any of this does, but it seems it's a BrowserChildMessageManager that's being leaked.

Maybe the test needs removeListener calls to balance the addListener calls?

I'm not sure how to read the log, what's the problem here? How do I run this locally?

Flags: needinfo?(agi) → needinfo?(jcoppeard)

(In reply to :Agi | ⏰ PST | he/him from comment #4)
You can run the test with:

mach xpcshell-test toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js 

The problem is the leaks reported in the output like this:

 0:04.87 pid:2199 ERROR: GC found live Cell 0x3091043eb040 of kind FUNCTION at shutdown
 0:04.87 pid:2199 ERROR: GC found live Cell 0x3091043eb080 of kind FUNCTION at shutdown
 0:04.87 pid:2199 ERROR: GC found live Cell 0x3091043eb0c0 of kind FUNCTION at shutdown
 0:04.87 pid:2199 ERROR: GC found live Cell 0x3091043eb100 of kind FUNCTION at shutdown
 0:04.87 pid:2199 ERROR: GC found live Cell 0x3091043eb140 of kind FUNCTION at shutdown
Flags: needinfo?(jcoppeard)

(In reply to Andrew McCreight [:mccr8] from comment #3)

Maybe the test needs removeListener calls to balance the addListener calls?

OK, tried that but it didn't fix the leak.

(In reply to Jon Coppeard (:jonco) from comment #6)

(In reply to Andrew McCreight [:mccr8] from comment #3)

Maybe the test needs removeListener calls to balance the addListener calls?

OK, tried that but it didn't fix the leak.

The shutdown leak detected should be fixed by explicitly closing the test content page created in the test_connect_native_from_content_script test case.

:jonco, would you mind to confirm me that the patch I've just attached fixes the issue for you too?
(I've quickly tried it locally, on a linux64 artifact debug build, and the shutdown leaks were not reported anymore).

Flags: needinfo?(jcoppeard)

Thanks for fixing this Luca!

Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/29ad25c05e8e Test content page should be closed explicitly to avoid shutdown leak in native messaging xpcshell test. r=zombie,jonco
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → lgreco
Flags: needinfo?(jcoppeard)

Hello,

Will this fix require manual validation? If yes, please provide some steps to reproduce in order to correctly test it and also, please set the "qe-verify+" flag. Otherwise, could the "qe-verify-" flag be added? Thanks!

Flags: needinfo?(lgreco)
Flags: needinfo?(lgreco) → qe-verify-
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: