Last Comment Bug 728589 - LinkResolve 0.3 add-on (under review) creates zombie compartments
: LinkResolve 0.3 add-on (under review) creates zombie compartments
Status: RESOLVED FIXED
[MemShrink:P3]
:
Product: Tech Evangelism
Classification: Other
Component: Add-ons (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on: 764831
Blocks: LeakyAddons ZombieCompartments
  Show dependency treegraph
 
Reported: 2012-02-18 12:09 PST by Andreas Wagner [:TheOne]
Modified: 2012-08-23 17:56 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Repack with addons-sdk 1.9 (156.71 KB, application/octet-stream)
2012-08-22 17:24 PDT, Thomasy
no flags Details

Description Andreas Wagner [:TheOne] 2012-02-18 12:09:57 PST
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?
Comment 1 Jorge Villalobos [:jorgev] 2012-02-20 07:22:05 PST
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.
Comment 2 Jorge Villalobos [:jorgev] 2012-02-22 13:31:01 PST
I just notified the developer about the 1.5 SDK.
Comment 3 Jorge Villalobos [:jorgev] 2012-02-27 07:09:57 PST
Please note that according to bug 730566 comment #5, some SDK leaks are still present.
Comment 4 Jorge Villalobos [:jorgev] 2012-04-04 14:50:20 PDT
I just sent a message to the developer requesting them to update to the 1.6 SDK and submit an update.
Comment 5 Andrew Williamson [:eviljeff] 2012-04-12 07:04:03 PDT
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.
Comment 6 Andrew Williamson [:eviljeff] 2012-04-12 07:05:57 PDT
(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.
Comment 7 Nicholas Nethercote [:njn] 2012-05-02 22:26:33 PDT
> 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.
Comment 8 Jorge Villalobos [:jorgev] 2012-05-16 16:18:56 PDT
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.
Comment 9 Thomasy 2012-05-16 16:58:12 PDT
(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.
Comment 10 Jorge Villalobos [:jorgev] 2012-06-13 16:20:40 PDT
Alex, can you look into this? Do you think this is an SDK bug?
Comment 11 Alexandre Poirot [:ochameau] 2012-06-14 08:24:55 PDT
(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.
Comment 12 Alexandre Poirot [:ochameau] 2012-07-07 15:32:57 PDT
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
Comment 13 Jorge Villalobos [:jorgev] 2012-08-22 11:59:24 PDT
Thomasy, can you repack your add-on with the latest stable version of the SDK and give it a try?
Comment 14 Thomasy 2012-08-22 17:23:08 PDT
(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.
Comment 15 Thomasy 2012-08-22 17:24:17 PDT
Created attachment 654448 [details]
Repack with addons-sdk 1.9
Comment 16 Jorge Villalobos [:jorgev] 2012-08-23 08:39:15 PDT
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.
Comment 18 Jorge Villalobos [:jorgev] 2012-08-23 13:16:05 PDT
The latest version is on AMO and Firefox 15 will be released next Tuesday. Calling this fixed.

Note You need to log in before you can comment on or make changes to this bug.