Closed Bug 6005 Opened 26 years ago Closed 26 years ago

crash closing window

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: danm.moz, Assigned: joki)

References

Details

(Whiteboard: problem understood. fix not so lucky.)

Closing a window from JavaScript (on an event handler for a button, say) crashes. This is not the same crash as was fixed just a couple of days ago. Someone has bestowed a new one on us. In particular, a window closed using the ToolkitCore method CloseWindow will crash reliably in jsinterp.c, as it attempts to clean up after handling the function call to CloseWindow. The webshell is finally being deleted, taking the JavaScript context with it. Not sure who wants this bug; I guess I'll babysit it for a while.
*** Bug 5800 has been marked as a duplicate of this bug. ***
*** Bug 5976 has been marked as a duplicate of this bug. ***
OS: Mac System 8.5 → All
Whiteboard: problem understood. fix not so lucky.
The problem here is that JavaScript perhaps reasonably expects things not to be deleted from underneath it as it's executing a script.. Not too surprisingly, the CloseWindow script is causing the GlobalWindow to be deleted, taking with it the JavaScript context.. If the GlobalWindow object holding a JavaScript context could be found and addrefed for the duration of a JS script's execution, things would be much happier. I'd like to ask the help of someone who understands this stuff at least a little. This probably means I'm going to try to drop this bomb on someone.
Severity: major → critical
Priority: P3 → P1
Target Milestone: M6
Raising priority to 1 and severity to critical, targetting M6, cc'ing clayton & brendan in a plea for help from the JS gods.
Assignee: danm → joki
Yup this one's for us.
Component: Apprunner → JavaScript
QA Contact: 3853 → 4590
Updating QA Contact
jan, since vidur and joki have accepted this, i think that means it's a layout bug and not core javascript.
jan, since vidur and joki have accepted this, i think that means it's a layout bug and not core javascript.
QA Contact: 4015 → 4616
*** Bug 5962 has been marked as a duplicate of this bug. ***
*** Bug 6593 has been marked as a duplicate of this bug. ***
*** Bug 6745 has been marked as a duplicate of this bug. ***
*** Bug 6743 has been marked as a duplicate of this bug. ***
*** Bug 6760 has been marked as a duplicate of this bug. ***
Adding waterson and leaf to cc.
Adding waterson and leaf to cc.
*** Bug 6512 has been marked as a duplicate of this bug. ***
A test case sample: <?xml version="1.0"?> <?xml-stylesheet href="xul.css" type="text/css"?> <!DOCTYPE window> <window style="width: 100%; height: 100%" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="setTri()"> <titledbutton popup="popupStuff" value="Click me for a popup!"/> <popup id="popupStuff"> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <titledbutton onclick="window.close();" value="Click me bitch."/> </window> </popup> </window>
Please excuse the rude language in the test case. I made the mistake of pasting it directly without sanitizing it first (you can tell it's a frustrating bug). :)
Crash experienced in after create profile wizard finishes it's job profiles is due to CloseWindow() call of toolkitCore. Is this bug going to keep track that problem too ?
sorry.. let me rephrase. Crash experienced after create profile wizard finishes it's job in profiles core is due to CloseWindow() call of toolkitCore. Is this bug going to keep track that problem too ?
*** Bug 6615 has been marked as a duplicate of this bug. ***
Status: NEW → ASSIGNED
Looking now to see if the nsToolkitCore::CloseWindow crash is the same but I suspect it is. Hoping to have fix tomorrow.
Okay, I think I got this one. The profile manager doesn't crash on exit anymore. However, there are multiple paths into this one from the many test cases if one of them still crashes please add a test case for the remaining crash case and reopen. Marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
QA Contact: 4616 → 4395
gbush, can you Verify please?
Status: RESOLVED → VERIFIED
QA Contact: 4395 → 4616
Currently there is no crash on closing window using javascript. But command window.close() does not close window actually and there is already a bug for that [Bug# 5444]. Marking this bug as verified.
QA Contact: 4616 → 4395
builds 199052408 on WinNT, Mac8.5PPC, Linux, Win95, Win98 all bring up Profile Manager and exit gracefully
Actually on Win95 using todays build [1999-05-24-09 apprunner] if we try to follow directions in bug# 5800 [which is dup of this bug] then it still does not close the Link source dialog. I think its because of window.close() or self.close() is not working. If I sound wrong please let me know, so in that case we need to re-open bug# 5800.
I followed steps in bug 5800 and could not close link dialog as you noted. I reopened 5800. It does not appear to be same behavior as noted in this bug.
Just a guess here... I doubt that's a bug. window.close() will only work if the OPENER property is set for the window. I'm guessing this was opened using the toolkit core (which doesn't set the opener property), and then an attempt was made to close it with window.close(). The toolkit core is obsolete, and shouldn't be used to open windows any more.
Changing component to "Javascript Engine". "Javascript" component is being retired.
You need to log in before you can comment on or make changes to this bug.