Closed Bug 695471 Opened 13 years ago Closed 11 years ago

Ask add-on devs to check for zombie compartments before submitting add-on.

Categories

(addons.mozilla.org Graveyard :: Add-on Validation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: justin.lebar+bug, Assigned: jorgev)

References

Details

(Whiteboard: [MemShrink:P3][ddn])

We've noticed in MemShrink that the vast majority of leaks users experience are due to bugs in addons.

We've talked about a variety of ways to mitigate these leaks, but the most straightforward way would be to fix the addons themselves.

It's hard to detect all kinds of addon leaks, but zombie compartments are very easy to detect.  Use the browser with the add-on for a while, and then follow the instructions at [1].

Seeing how many add-ons leak, I think we should ask add-on developers to verify that they have checked for zombie compartments as part of the add-on submission process.

[1] http://blog.mozilla.com/nnethercote/2011/07/20/zombie-compartments-recognize-and-report-them-stop-the-screaming/
Whiteboard: [MemShrink]
Assignee: nobody → jorge
Whiteboard: [MemShrink] → [MemShrink][ddn]
Whiteboard: [MemShrink][ddn] → [MemShrink:P1][ddn]
I'll write some text for this.
Draft text:

"Many add-ons have memory leaks, see https://bugzilla.mozilla.org/show_bug.cgi?id=700547 for some examples.  

Before submitting your add-on, you should do some basic checking to see that your add-on does not have leaks.  One particular kind of memory leak that is relatively easy to detect is called a zombie compartment.  See http://blog.mozilla.com/nnethercote/2011/07/20/zombie-compartments-recognize-and-report-them-stop-the-screaming/ for information on how to identify zombie compartments.  When following those instructions, you should make sure that you do some actions that activate your add-on's functionality.  For example, if your add-on stores passwords, visit a site that uses a password.

Zombie compartments and other leaks are usually caused by add-ons that keep references to things in Firefox.  For example, an add-on shouldn't hold onto a window object once the tab enclosing that window has been closed.  This kind of thing is quite easy to do unintentionally, and can drastically worsen the performance of Firefox with the add-on enabled."

Jorge, are you able to put this text (subject to any necessary further revisions) somewhere appropriate on AMO?
Status: NEW → ASSIGNED
> "Many add-ons have memory leaks, see https://bugzilla.mozilla.org/show_bug.cgi?id=700547 for some 
> examples.  

Grammar police: This is a comma splice, please use a semicolon.
We're adding a pre-submission checklist on bug 692207, which will include some important validation warnings and other other. We can add a note about memory compartments, but it should be a short one, maybe with a link for more details.
Depends on: 692207
Here's some shorter text:

"Many add-ons cause memory leaks of a particular kind called 'zombie compartments'. See https://bugzilla.mozilla.org/show_bug.cgi?id=700547 for some examples.  Before submitting your add-on, you should do some basic checking to see that your add-on does not have leaks.  Detailed instructions on how to do this are at https://developer.mozilla.org/en/Zombie_Compartments."

You can make the text even shorter if you want, the link to the devmo page is the important thing.
I'd remove the sentence with the "examples" link. Even for someone familiar with Bugzilla, it's hard to get from there to informative examples of code patterns that leak. Instead, you could add a "examples" section to the devmo page.
Jorge is going to add "look in about:memory for (a) zombie compartments and (b) other excessive memory consumption" to the AMO reviewer's checklist.  This is likely to be much more effective than submitting it to the AMO submitter's checklist.  With that in mind, jlebar and I agreed that this can be downgraded to a MemShrink:P3.
Whiteboard: [MemShrink:P1][ddn] → [MemShrink:P3][ddn]
Jorge has updated the checklist.  It's at https://wiki.mozilla.org/AMO:Editors/EditorGuide/AddonReviews under "Memory leaks from content".
What is the status of this?
Zombie compartment checking has been on the add-on reviewer checklist for ages, and bug 695480 made most of them impossible anyway.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.