Closed Bug 732374 Opened 12 years ago Closed 12 years ago

ProxTube Add-On causes zombie compartments

Categories

(WebExtensions :: General, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Omar_Hawk, Unassigned)

References

()

Details

(Whiteboard: [MemShrink:P3])

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

When letting the ProxTube [1] Add-On 1.3.4 doing its work (for example unlocking this video from a German Internet Provider: http://www.youtube.com/watch?v=27RVIgW7L8c ), a single compartment of the last watched video stays in memory after closing the tab.

If the ProxTube AddOn fails ("Sorry, the ProxTube service is temporary unavailable. I'm really sorry about this incident! Contact me or try again later in a few minutes."), the same thing happens.

As far as I see, at max. only one compartment stays in memory.

Tested with Firefox 10.0.2

[1] https://addons.mozilla.org/de/firefox/addon/proxtube/


Actual results:

After pushing "reduce memory" several times:
39.13 MB (100.0%) -- explicit
├──17.54 MB (44.83%) -- js
│  ├───7.66 MB (19.58%) -- compartment([System Principal], 0x6465000)
│  │   ├──4.67 MB (11.94%) -- gc-heap
│  │   │  ├──1.96 MB (05.02%) -- objects
│  │   │  │  ├──1.56 MB (03.99%) -- function
│  │   │  │  └──0.40 MB (01.02%) -- non-function
│  │   │  ├──1.39 MB (03.56%) -- shapes
│  │   │  │  ├──1.28 MB (03.28%) -- tree
│  │   │  │  └──0.11 MB (00.29%) -- (1 omitted)
│  │   │  ├──0.65 MB (01.66%) -- arena
│  │   │  │  ├──0.62 MB (01.59%) -- unused
│  │   │  │  └──0.03 MB (00.07%) -- (2 omitted)
│  │   │  ├──0.60 MB (01.53%) -- scripts
│  │   │  └──0.07 MB (00.17%) -- (3 omitted)
│  │   ├──1.18 MB (03.02%) -- script-data
│  │   ├──0.69 MB (01.76%) -- mjit-code
│  │   │  ├──0.58 MB (01.47%) -- method
│  │   │  └──0.11 MB (00.29%) -- (2 omitted)
│  │   ├──0.46 MB (01.19%) -- object-slots
│  │   ├──0.39 MB (01.00%) -- shapes-extra
│  │   │  ├──0.24 MB (00.61%) -- tree-tables
│  │   │  └──0.15 MB (00.39%) -- (3 omitted)
│  │   └──0.26 MB (00.67%) -- (4 omitted)
│  ├───4.82 MB (12.32%) -- compartment(http://www.youtube.com/watch?v=27RVIgW7L8c)
│  │   ├──2.70 MB (06.90%) -- gc-heap
│  │   │  ├──0.97 MB (02.49%) -- objects
│  │   │  │  ├──0.72 MB (01.84%) -- function
│  │   │  │  └──0.25 MB (00.65%) -- non-function
│  │   │  ├──0.54 MB (01.37%) -- scripts
│  │   │  ├──0.54 MB (01.37%) -- arena
│  │   │  │  ├──0.52 MB (01.32%) -- unused
│  │   │  │  └──0.02 MB (00.05%) -- (2 omitted)
│  │   │  ├──0.48 MB (01.22%) -- shapes
│  │   │  │  ├──0.40 MB (01.03%) -- tree
│  │   │  │  └──0.07 MB (00.19%) -- (1 omitted)
│  │   │  └──0.18 MB (00.45%) -- (2 omitted)
│  │   ├──0.87 MB (02.21%) -- script-data
│  │   ├──0.75 MB (01.92%) -- mjit-code
│  │   │  ├──0.57 MB (01.46%) -- method
│  │   │  └──0.18 MB (00.45%) -- (2 omitted)
│  │   └──0.51 MB (01.29%) -- (5 omitted)
│  ├───2.88 MB (07.37%) -- gc-heap-chunk-dirty-unused
│  ├───1.31 MB (03.35%) -- compartment(atoms)
│  │   ├──0.77 MB (01.96%) -- string-chars
│  │   └──0.54 MB (01.39%) -- gc-heap
│  │      ├──0.51 MB (01.30%) -- strings
│  │      └──0.03 MB (00.08%) -- (1 omitted)
│  ├───0.41 MB (01.05%) -- runtime
│  │   ├──0.25 MB (00.64%) -- atoms-table
│  │   └──0.16 MB (00.41%) -- (1 omitted)
│  ├───0.25 MB (00.64%) -- stack
│  └───0.21 MB (00.53%) -- (4 omitted)
├──14.85 MB (37.96%) -- heap-unclassified
├───3.90 MB (09.96%) -- storage
│   └──3.90 MB (09.96%) -- sqlite
│      ├──2.11 MB (05.40%) -- places.sqlite
│      │  ├──1.92 MB (04.90%) -- cache-used [3]
│      │  └──0.19 MB (00.50%) -- (2 omitted)
│      ├──0.86 MB (02.20%) -- other
│      ├──0.69 MB (01.77%) -- (6 omitted)
│      └──0.23 MB (00.60%) -- cookies.sqlite
│         ├──0.22 MB (00.56%) -- cache-used
│         └──0.01 MB (00.03%) -- (2 omitted)
├───0.89 MB (02.27%) -- xpti-working-set
├───0.85 MB (02.18%) -- layout
│   ├──0.54 MB (01.39%) -- shell(chrome://browser/content/browser.xul)
│   │  ├──0.33 MB (00.84%) -- arenas
│   │  └──0.21 MB (00.55%) -- styledata
│   ├──0.22 MB (00.55%) -- shell(about:memory)
│   │  └──0.22 MB (00.55%) -- (2 omitted)
│   └──0.09 MB (00.24%) -- (1 omitted)
├───0.60 MB (01.54%) -- startup-cache
├───0.31 MB (00.80%) -- images
│   └──0.31 MB (00.80%) -- (2 omitted)
└───0.18 MB (00.46%) -- (6 omitted)


Expected results:

The compertment should have been gone, after closing the tab and pushing the minimize memory-button.
Blocks: LeakyAddons
Component: General → Extension Compatibility
Product: Core → Firefox
QA Contact: general → extension.compatibility
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink:P3]
The developer has been contacted through AMO, though I haven't been able to reproduce this bug (I know there are some YouTube videos restricted in Costa Rica, but I couldn't find any).
I have contacted the author myself (via webform), and already told him what I found about the reason for this issue: an undeclared variable...

After changing this part of the code by myself, there were no more compartments after closing the youtube tab.
Thanks, Jan!

I'm getting sick of these leaks caused by missing "var"s...
I'm going to fix it asap.
Many thanks to you Jan.
@Jorge i think this one is restricted in Costa Rica: http://www.youtube.com/watch?v=Oeum1rx3SlQ
(In reply to Malte Götz from comment #4)
> I'm going to fix it asap.
> Many thanks to you Jan.
> @Jorge i think this one is restricted in Costa Rica:
> http://www.youtube.com/watch?v=Oeum1rx3SlQ

Thanks! I can confirm the leak now.
Status: UNCONFIRMED → NEW
Ever confirmed: true
FYI, the developer says the new version is planned to be released in early April.
Component: Extension Compatibility → Add-ons
Product: Firefox → Tech Evangelism
Malte: do you have any updates on this?
(In reply to Jorge Villalobos [:jorgev] from comment #7)
> Malte: do you have any updates on this?

Sorry, i'm working on a big update but it appears to be a bit buggy at the moment! Hope i will get it ready soon.
I've fixed it and submitted the update!
Seems, as if the meory compartment has been fixed, but I get several Exceptions when using this Add-On now:

Zeitstempel: 06.05.2012 14:04:58
Fehler: document.getElementById("proxButton") is null
Quelldatei: chrome://proxtube/content/overlay.js
Zeile: 207

Happens directly before the dialogue appears (the one that is asking me whether I want to unblock the video)

Besides, it does not work at all when installing it into a clean profile (having no previous version installed). It doesn't show the dialogue that lets me accept the privacy policy, so it won't unblock any video. And what is even worse: Firefox cannot be closed at all - the firefox.exe process stays until I kill it via task manager... If I start Firefox after killing the process, everything seems to work.
(In reply to Jan Wedding from comment #10)
> Seems, as if the meory compartment has been fixed, but I get several
> Exceptions when using this Add-On now:
> 
> Zeitstempel: 06.05.2012 14:04:58
> Fehler: document.getElementById("proxButton") is null
> Quelldatei: chrome://proxtube/content/overlay.js
> Zeile: 207
> 
> Happens directly before the dialogue appears (the one that is asking me
> whether I want to unblock the video)
> 
> Besides, it does not work at all when installing it into a clean profile
> (having no previous version installed). It doesn't show the dialogue that
> lets me accept the privacy policy, so it won't unblock any video. And what
> is even worse: Firefox cannot be closed at all - the firefox.exe process
> stays until I kill it via task manager... If I start Firefox after killing
> the process, everything seems to work.

Sounds really strange, i released a beta version about 2 weeks ago and nobody got that problems.
The "document.getElementById("proxButton") is null" exception looks like the script is unable to reach the toolbar button. Do you use Linux? A few Linux users reported me, that the toolbar button does not appear. It's really strange, because i can't find the problem and it's only under Linux.
Are you sure that the problem, that you're unable to close firefox belongs to ProxTube?
Yes, I am sure, that this was because of ProxTube (but more my mistake). ;)
When closing the Firefox window, there was somehow the privacy policy in background (or hidden, but I guess I just didn't see it, because I was working with several Firefox profiles at the time), so the Firefox process didn't stop after closing the main Firefox window. I tried to open this privacy policy window via settings, but nothing happened, so I thought there was something wrong and closed Firefox, but in fact the window was just somewhere in the background.

Maybe, you could focus the data policy window in case it is already opened somewhere in the background and the user tries to load a video without having the policy accepted or it is tried to open via settings menu. 
See here on how to find the correct window: https://developer.mozilla.org/en/nsIWindowMediator#Enumerating_windows
-> Simply add one unique ID in your window for which you are searching there and after having the correct window found, focus it. :)

About the other exception:
This happens when I don't allow Proxtube to change my proxy settings without request videos and directly after opening a video and then clicking on the OK-button in the dialogue that is asking me whether I want to allow proxtube to change my proxy settings now.
See here for a screenshot: http://img16.imageshack.us/img16/4598/proxtube.png

I am using Firefox 12 on Windows 7 Pro (x64)
Both problems are solved and I've uploaded the new updated version.
The new version doesn't show the leak anymore. Thanks!
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.