Closed Bug 395707 Opened 18 years ago Closed 18 years ago

Crash @nsWindowSH::GetProperty(nsIXPConnectWrappedNative*, JSContext*, JSObject*, long, long*, int*) during EM restart

Categories

(Toolkit :: Startup and Profile System, defect)

x86
macOS
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.9beta1

People

(Reporter: tchung, Assigned: mossop)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; es-ES; rv:1.9a8pre) Gecko/2007091004 Minefield/3.0a8pre Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; es-ES; rv:1.9a8pre) Gecko/2007091004 Minefield/3.0a8pre On nightly build, i reproduced a top #14 crash (according to breakpad), when applying a nightly software update, with an incompatible extension loaded. Reproducible: Always Steps to Reproduce: 1. install an incompatible extension on nightly (eg. Nightly test tool 1.3b1) 2. Open a prior nightly build, and do a Help > Updates 3. When update window appears, do the nightly update 4. When dialog asks to restore session of open sites, click restart 5. Verify Firefox updates software, and then upon restartng Firefox, it crashes at nsWindowSH::GetProperty(nsIXPConnectWrappedNative*, JSContext*, JSObject*, long, long*, int*) Actual Results: Crash @nsWindowSH::GetProperty(nsIXPConnectWrappedNative*, JSContext*, JSObject*, long, long*, int*) upon restarting session after software update Expected Results: no crash.
Flags: blocking-firefox3?
The crash appears to be occurring during the xpcom-shutdown phase of the EM requested restart.
According to Dave, bug 395897 might be about the same issue (that bug has a testcase).
Flags: blocking-firefox3? → blocking-firefox3+
I think we need this for b1..
Target Milestone: --- → Firefox 3 M9
I can also reproduce this by running Firefox2 with an incompatible extension (e.g. Firebug 1.0.5) and then starting Minefield.
This particular case occurs when attempting to call nonBrowserWindowShutdown on the hidden window. It is just the function call that crashes, even if the function is empty.
So the regression range is kind of right, this has started crashing because nonBrowserWindowShutdown was added in bug 342600.
During XPCOM shutdown there is a last ditch attempt to destroy any remaining hidden window: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/xpfe/appshell/src/nsAppShellService.cpp&rev=1.235&mark=561#552 Unfortunately this comes after nsDOMScriptObjectFactory sees the xpcom-shutdown and destroys nsDOMClassInfo, pretty much breaking any scripts that would try to run in the hidden window. http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/dom/src/base/nsDOMScriptObjectFactory.cpp&rev=1.20&mark=289#258 On a normal shutdown the hidden window is destroyed in advance of the xpcom shutdown so there isn't an issue. On the EM initiated restart however the hidden window is not destroyed.
Component: General → XRE Startup
Flags: blocking-firefox3+
Product: Firefox → Toolkit
QA Contact: general → xre.startup
Summary: Crash @nsWindowSH::GetProperty(nsIXPConnectWrappedNative*, JSContext*, JSObject*, long, long*, int*) during session restore → Crash @nsWindowSH::GetProperty(nsIXPConnectWrappedNative*, JSContext*, JSObject*, long, long*, int*) during EM restart
Target Milestone: Firefox 3 M9 → ---
Version: unspecified → Trunk
Oops, this was blocking-firefox3+ so should be blocking1.9
Flags: blocking1.9?
Attached patch patch rev 1Splinter Review
This simply destroys the hidden window before xpcom shutdown when a restart has been forced
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #284949 - Flags: review?(benjamin)
Target Milestone: --- → mozilla1.9 M9
Comment on attachment 284949 [details] [diff] [review] patch rev 1 As hacks go, this one kinda sucks, but I'll let it slide because I can't think of something better right now.
Attachment #284949 - Flags: review?(benjamin) → review+
(In reply to comment #11) > (From update of attachment 284949 [details] [diff] [review]) > As hacks go, this one kinda sucks, but I'll let it slide because I can't think > of something better right now. About the only thoughts I came up with were either to destroy the hidden window directly from NS_ShutdownXPCOM always (not a good idea I think), or add a new observer topic send from NS_ShutdownXPCOM say xpcom-before-shutdown or something which the appshell service could listen to and destroy the hidden window there. Both of those seem pretty invasive than this.
Flags: blocking1.9? → blocking1.9+
Whiteboard: [has patch][has reviews]
Checking in toolkit/xre/nsAppRunner.cpp; /cvsroot/mozilla/toolkit/xre/nsAppRunner.cpp,v <-- nsAppRunner.cpp new revision: 1.198; previous revision: 1.197 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][has reviews]
Verified fix on Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a9pre) Gecko/2007102304 Minefield/3.0a9pre. Repro steps in comment #1 no longer happen. Crash Reporter at: http://crash-stats.mozilla.com/report/list?range_unit=weeks&branch=1.9&range_value=2&signature=nsWindowSH%3A%3AGetProperty(nsIXPConnectWrappedNative*%2C+JSContext*%2C+JSObject*%2C+long%2C+long*%2C+int*), also shows no further instances of this crash after Build ID: 2007102000, which is the next build after Dave's checkin from Comment #13. Marking bug as verified.
Status: RESOLVED → VERIFIED
Component: XRE Startup → Startup and Profile System
QA Contact: xre.startup → startup
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: