Closed
Bug 819454
Opened 12 years ago
Closed 12 years ago
[Shutdown] Avoid js::NukeCrossCompartmentWrappers in SDK on shutdown
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
1.14
People
(Reporter: BenWa, Assigned: mossop)
References
(Blocks 1 open bug)
Details
(Whiteboard: [Snappy:p1][sps])
Attachments
(1 file)
During shutdown the addon SDK calls 'js::NukeCrossCompartmentWrappers' from 'unloadSandbox()@bootsrap.js'.
This is takes about 141ms on my machine on shutdown. In bug 818296 we're skipping it completely for window destruction on optimized shutdown only. We should consider doing the same in the SDK.
Assignee | ||
Updated•12 years ago
|
Priority: -- → P1
Reporter | ||
Comment 1•12 years ago
|
||
I've received more shutdown reports from users indicating that this is a problem. So far the highest I've seen is 500ms.
Reporter | ||
Comment 2•12 years ago
|
||
Any chance someone can look at this? It's easy to code, will give a sizeable improvement to your shutdown telemetry has confirmed by the performance reporter (several slow shutdown profiles show 100-500ms spend in this function for add-on heavy profiles).
This will take a long time for add-on to be repack with this change so the sooner we get it in the better.
On the profile in
http://people.mozilla.com/~bgirard/cleopatra/?report=ea216713a20097f657da61b0aad4452b58963226#report=ea216713a20097f657da61b0aad4452b58963226&search=nuke
It looks like we get to nukeModules earlier than we want to ever put the call to exit(0). If this is something that should be safe to skip, probably the safe way to do it is to first move it to a xpcom-shutdown-* message. That way we will at some point move write poisoning and exit(0) past it.
Also note that this is from a timer. If it is at all important to run during shutdown, that should be avoided. As we shutdown faster we will at some point exit before the time set for the timer.
Reporter | ||
Comment 4•12 years ago
|
||
I just went through the latest 5 slow shutdown reports and 4 out of those showed 28%-65% of their time spent in this function on shutdown. It would be nice to get an owner for this bug.
5 latest slow shutdown reports:
http://people.mozilla.com/~bgirard/cleopatra/?report=ea216713a20097f657da61b0aad4452b58963226
(28%)
http://people.mozilla.com/~bgirard/cleopatra/?report=2e84bd302194a87e9d48cbc99e461f7dfe9e6bfd
(58%)
http://people.mozilla.com/~bgirard/cleopatra/?report=3ac942ec124b81e4f7507cbf903de87e5ef68f4d
(65%)
http://people.mozilla.com/~bgirard/cleopatra/?report=fab714d7c23a4844c7f9c8c0708b92cb270441d9
(38%)
http://people.mozilla.com/~bgirard/cleopatra/?report=a3c83b738e9f806a818ba1c2f7f534a3d0fb1c08
(0% - IO/Memory issue)
Whiteboard: [Snappy][sps]
Updated•12 years ago
|
Whiteboard: [Snappy][sps] → [Snappy:p1][sps]
Assignee | ||
Comment 5•12 years ago
|
||
Matteo, can you take a look at this please?
Assignee: nobody → zer0
Assignee | ||
Comment 6•12 years ago
|
||
Actually never mind I can see the fix is straightforward so I'll just take it.
Assignee: zer0 → dtownsend+bugmail
Assignee | ||
Comment 7•12 years ago
|
||
Pointer to Github pull-request
Assignee | ||
Updated•12 years ago
|
Attachment #716165 -
Flags: review?(poirot.alex)
Updated•12 years ago
|
Attachment #716165 -
Flags: review?(poirot.alex) → review+
Comment 8•12 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/4e1166445ccad9d1f0060387b481a32b52012cf9
Bug 819454: Avoid nuking module sandboxes when the application is shutting down.
https://github.com/mozilla/addon-sdk/commit/03f0890b41d10c2633262a095be09a21238cd643
Merge pull request #809 from Mossop/bug819454
Bug 819454: Avoid nuking module sandboxes when the application is shutting down. r=ochemeau
Assignee | ||
Comment 9•12 years ago
|
||
Would like to spin this into 1.14 once it's been through tests please Wes.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.14
Comment 10•12 years ago
|
||
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/f496376919260068e21addc05e962ab49ee40cb8
Merge pull request #809 from Mossop/bug819454
Bug 819454: Avoid nuking module sandboxes when the application is shutting down. r=ochemeau(cherry picked from commit 03f0890b41d10c2633262a095be09a21238cd643)
Reporter | ||
Comment 11•12 years ago
|
||
For the platform we only disable this if we doing a non debug shutdown. I don't know enough about NukeCrossCompartmentWrappers to advise here.
Kyle can you take a look at the patch that landed here?
(In reply to Benoit Girard (:BenWa) from comment #11)
> For the platform we only disable this if we doing a non debug shutdown. I
> don't know enough about NukeCrossCompartmentWrappers to advise here.
>
> Kyle can you take a look at the patch that landed here?
I'm not sure what input you want from me here ...
You need to log in
before you can comment on or make changes to this bug.
Description
•