Closed Bug 728589 Opened 12 years ago Closed 12 years ago

LinkResolve 0.3 add-on (under review) creates zombie compartments

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: TheOne, Unassigned)

References

Details

(Whiteboard: [MemShrink:P3])

Attachments

(1 file)

156.71 KB, application/octet-stream
Details
This add-on leaks chrome compartments

1) Install the add-on (v0.3) from https://addons.mozilla.org/en-US/firefox/addon/linkresolve/
2) Disable the add-on
3) Go to about:memory?version

The author has been informed about this bug.

Could this be bug 724433?
According to the developer, these are SDK leaks and using the trunk fixes the problem. We should verify this after 1.5 is released and the add-on is updated.
Summary: LinkyResolve 0.3 add-on (under review) creates zombie compartments → LinkResolve 0.3 add-on (under review) creates zombie compartments
Whiteboard: [MemShrink] → [MemShrink:P3]
I just notified the developer about the 1.5 SDK.
Please note that according to bug 730566 comment #5, some SDK leaks are still present.
Component: General → Add-ons
Product: Core → Tech Evangelism
I just sent a message to the developer requesting them to update to the 1.6 SDK and submit an update.
version 0.7 still remains present on disable, even after repacking with SDK 1.6.
Additionally, the add-on leaks during use.
Steps to Reproduce:
1) Go to http://www.google.com/
2) select Resolve Link context menu item
3) close tab
4) go to about:memory?verbose and see reference to http://www.google.com still.
(In reply to Andrew Williamson [:eviljeff] from comment #5)
> 4) go to about:memory?verbose and see reference to http://www.google.com
> still.

I pressed minimize memory usage a few times also, btw.
> Steps to Reproduce:
> 1) Go to http://www.google.com/

In here I had to search for something, in order to bring up the page of search results.  Then I did...

> 2) select Resolve Link context menu item
> 3) close tab
> 4) go to about:memory?verbose and see reference to http://www.google.com
> still.

I got zombie compartments for the linked-to page as well.

If I did a follow-up search with Bing, and the zombie compartments for google and the previous search were replaced with the zombies from the Bing search.
The zombie compartment that appears when resolving a URL has been fixed in the latest version. There's still a zombie left when the add-on is disabled, but it might be an SDK bug.

The compartment points to preferences-service.js. What the add-on does is basically this:

> var prefs = require("simple-prefs");
> ...
> onMessage: function (ahref) {
>   ...
>   if (prefs.prefs["open_in_new_tab"]) { ... }
>   ...
> }
> ...
> exports.onUnload = function (reason) {
>   prefs = null
>   ...
> }

It sounds to me like the onMessage closure is being held even after the add-on is disabled.
(In reply to Jorge Villalobos [:jorgev] from comment #8)
> The zombie compartment that appears when resolving a URL has been fixed in
> the latest version. There's still a zombie left when the add-on is disabled,
> but it might be an SDK bug.
> 
> The compartment points to preferences-service.js. What the add-on does is
> basically this:
> 
> > var prefs = require("simple-prefs");
> > ...
> > onMessage: function (ahref) {
> >   ...
> >   if (prefs.prefs["open_in_new_tab"]) { ... }
> >   ...
> > }
> > ...
> > exports.onUnload = function (reason) {
> >   prefs = null
> >   ...
> > }
> 
> It sounds to me like the onMessage closure is being held even after the
> add-on is disabled.

I also try nulling prefs immediate after that like

> var prefs = require("simple-prefs");
> ...
> onMessage: function (ahref) {
>   ...
>   if (prefs.prefs["open_in_new_tab"]) { ... }
>   prefs = null;
> }
> ...
> exports.onUnload = function (reason) {
>   prefs = null
>   ...
> }


But it leaks too.
Alex, can you look into this? Do you think this is an SDK bug?
Depends on: 764831
(In reply to Jorge Villalobos [:jorgev] from comment #10)
> Alex, can you look into this? Do you think this is an SDK bug?

Confirmed, the SDK is leaking.
Do not hesitate to cc me when you are seing something weird around SDK addons.

I filled an SDK bug 764831. More details there.
I just landed bug 764831, it would be cool to give it a try with a repacked version of your addon against git master.
You can download it without using git:
.zip:
https://github.com/mozilla/addon-sdk/zipball/master
.tar.gz:
https://github.com/mozilla/addon-sdk/tarball/master
Thomasy, can you repack your add-on with the latest stable version of the SDK and give it a try?
(In reply to Jorge Villalobos [:jorgev] from comment #13)
> Thomasy, can you repack your add-on with the latest stable version of the
> SDK and give it a try?

I use Nightly 20120822 

> cfx run 

> Resolve url @ http://thomasy.tw/

> Disable addons

> Open about:compartments?verbose

Main Process

User Compartments

System Compartments
[System Principal]
atoms
moz-nullprincipal:{19a7c7c7-fc9a-4b65-82da-2826486d7357}

Ghost Windows

I seems that there is no leak at all.
This version leaks in Firefox 14, but not in 15, so it looks like the bug is fixed in Firefox and not the SDK (I didn't test other versions, though). I recommend that you submit this new version anyway, since there are other important fixes that went into the SDK.
The latest version is on AMO and Firefox 15 will be released next Tuesday. Calling this fixed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: Add-ons → General
Product: Tech Evangelism → WebExtensions
You need to log in before you can comment on or make changes to this bug.