Closed Bug 396234 Opened 17 years ago Closed 17 years ago

Crash when dialog comes up before automatic shutdown on Mac

Categories

(Toolkit :: Startup and Profile System, defect, P3)

PowerPC
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: bzbarsky, Assigned: mossop)

References

()

Details

(Keywords: crash, regression)

Attachments

(1 file, 1 obsolete file)

See bug 384983 for steps to reproduce. On Mac, those steps cause a crash because we're firing a pagehide event (presumably for this dialog that came up), but sXPConnect is already null when we hit the nsWindowSH code in nsDOMClassInfo.cpp that uses it, so we crash.
The point is, this makes the EM restart thing suck that much worse on Mac, because I can't use -silent to work around it screwing with gdb.
OK, I'm also getting this without -silent, just with the extension update check dialog. It comes up, it closes, the app sits there unresponsive for a bit, the app crashes. 100% reproducible if I start current trunk after running Fx2 on the same profile.
Flags: blocking1.9?
Keywords: regression
Summary: Crash when session restore comes up with -silent on Mac → Crash when dialog comes up before automatic shutdown on Mac
Flags: blocking1.9? → blocking1.9+
Fixed by and dupe of bug 395707, right?
Seems likely, yes. At least in terms of reason for crash and symptoms. I'll try to pull a tree from after that checkin and test.
I'm still seeing this crash with a build pulled on 2007-10-21. So no, not fixed. I think the difference is that the window being destroyed here is not the hidden window, as in bug 395707.
This might have been fixed by other checkins, please check again.
Priority: -- → P2
Checkins since comment 5? I'll try to check tomorrow, I guess.
Not going to block beta2. Assigning to dtownsend for now.
Assignee: nobody → dtownsend
Priority: P2 → P3
It actually is the same problem with bug 395707 with the hidden window. However there I only covered the case of the window existing during an EM restart. In this case a window has appeared (thus creating a hidden window) but the app then never properly runs so the hidden window is not properly disposed of. This particular case would actually be fixed by bug 384983 but there are potential other ways to hit this I believe, should be a fairly simple fix though.
Attached patch patch rev 1 (obsolete) — Splinter Review
This is the way to go I think and a better fix for bug 395707. Now just always destroy the hidden window from the same place that we created it, named in nsAppRunner. Added the DestroyHiddenWindow on nsAppStartup mainly for symmetry and to save a few lines here and there. There's still a couple of points where we miss it (the NS_ENSURE_SUCCESS etc. points) but since those are only in error circumstances anyway I left those for now.
Attachment #289302 - Flags: review?(benjamin)
Whiteboard: [has patch][needs review]
Comment on attachment 289302 [details] [diff] [review] patch rev 1 >Index: toolkit/components/startup/public/nsIAppStartup.idl > interface nsIAppStartup : nsISupports > { > /** > * Create the hidden window. > */ > void createHiddenWindow(); > > /** >+ * Destroys the hidden window. >+ */ >+ void destroyHiddenWindow(); Please document what happens if you call this method without ever having called createHiddenWindow. Need to rev iid. >Index: toolkit/xre/nsAppRunner.cpp >+ appStartup->DestroyHiddenWindow(); You have this sprinkled several different places. Can we unify them all in ScopedXPCOMStartup::~ScopedXPCOMStartup (right before NS_ShutdownXPCOM) or is there a reason we need to call it earlier in shutdown?
Attachment #289302 - Flags: review?(benjamin) → review-
Whiteboard: [has patch][needs review]
Attached patch patch rev 2Splinter Review
Updated per review comments
Attachment #289302 - Attachment is obsolete: true
Attachment #290714 - Flags: review?(benjamin)
Whiteboard: [has patch]
Attachment #290714 - Flags: review?(benjamin) → review+
Will check in when the tree reopens
Whiteboard: [has patch] → [has patch][has reviews]
Checking in toolkit/xre/nsAppRunner.cpp; /cvsroot/mozilla/toolkit/xre/nsAppRunner.cpp,v <-- nsAppRunner.cpp new revision: 1.200; previous revision: 1.199 done Checking in toolkit/components/startup/public/nsIAppStartup.idl; /cvsroot/mozilla/toolkit/components/startup/public/nsIAppStartup.idl,v <-- nsIAppStartup.idl new revision: 1.5; previous revision: 1.4 done Checking in toolkit/components/startup/src/nsAppStartup.cpp; /cvsroot/mozilla/toolkit/components/startup/src/nsAppStartup.cpp,v <-- nsAppStartup.cpp new revision: 1.22; previous revision: 1.21 done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][has reviews]
Target Milestone: --- → mozilla1.9 M11
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: