Gridtube 1.4.3 add-on causes a single youtube.com zombie compartment

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: nmaier, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 595907 [details]
Affected version 1.4.3

STR:
- Open a youtube search results page
- Wiggle your mouse over some result item, in particular the question mark icon that is displayed as the result item description is expanded on mouse over.
- Close the tab
- Open about:memory?verbose
- Hit Minimize memory use a couple of times
- Look for any compartments for youtube
-> Still present

This seems to happen due to implicit variable declarations in overlay.js#popupShow/popupHide: node is missing a |var|.
I cannot reproduce after adding the missing |var| declarations.

As this seems to be due to an implicit variable declaration, at most one content window + compartment will be leaked.
Using the steps above, it can be determined that in fact at most one window + compartment is leaked.

Previous versions (1.4.2) might be affected, too, as they share the same suspected culprit, but in the add-on default configuration the leak is not reproducible.
This is the second one this week where an add-on leak has been found to be caused by a missing |var|, and which "use strict;" would have caught.  Grr.
(Reporter)

Comment 2

5 years ago
Well, it's usually not as easy as sticking in "use strict"; You'll actually spend a lot of time fixing your code. I'd be all in favor of a new "use noimplicitdecl"; or something similar and force public add-ons to use that or strict mode in all code via AMO policy, maybe turning it on by default for chrome code after a grace period.

Here is a long-fixed window leak I created myself. Leaked our DownThemAll! windows, not content pages:
https://bugs.downthemall.net/changeset/2744
Another one regarding references keeping windows alive:
https://bugs.downthemall.net/changeset/2734
And a very funky one:
https://bugs.downthemall.net/changeset/2750
Nils reviewed the add-on and pointed out the leak to the developer. It should be fixed soon, hopefully.

Comment 4

5 years ago
I am the addon author. Thanks for noticing this bug. Indeed it caused the aforementioned memory leak problem. I didn't declare the specific variable 'node' as 'var'. I fixed this, by declaring the variable properly in both functions (popupShow/popupHide). After than I didn't get the same problem again. I will resubmit for full review as new version.
(Reporter)

Comment 5

5 years ago
Version 1.4.4 was submitted and made public that fixes the leaks
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.