Closed Bug 225302 Opened 21 years ago Closed 19 years ago

document.onfocus = function() { alert('hi'); } causes Crash of Mozilla

Categories

(Core :: DOM: Events, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: traumwandler, Unassigned)

References

()

Details

(Keywords: crash, testcase)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.5) Gecko/20031007 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.5) Gecko/20031007 If you use via JavaScript an alert at document.onfocus. The browser crashes. I know that the Alert Window gets it's own focus. IE ignores this anyway. Reproducible: Always Steps to Reproduce: 1. Create a Document 2. insert an handler for document.onfocus 3. use an alert inside Actual Results: Mozilla crashes after 2 or 3 clicks at OK Expected Results: Endless available Alert boxes without crash or only one Alert Box
Reassigning to DOM Events -
Assignee: general → events
Component: JavaScript Engine → DOM Events
QA Contact: PhilSchwartau → ian
crash, TalkbackID TB25447774Y Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6a) Gecko/20031028 Raising the severity to critical, as it is a crash. I clicked OK of the Alert as fast as I could, and looked at my resources. USER and SYSTEM went down and up, after some time down only. I opened GDIusage.exe to have a look at GDI, made a snapshot, and compared after some clicks. Only thing grown was regions and fonts, 74 fonts and 81 regions had been added. Then I wanted to close the tab, to no avail. Menus weren´t working also. I closed the Alert, and had to close the next one. Closing the third, mozilla crashed in KERNEL32.DLL, DocWatson and Talkback came up.
Severity: minor → critical
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: crash
I opened the testcase, and this time only tried to close the Alert using [x]. It always came again, and after some tries I opened GDIusage.exe and made a snapshot. 10 Alerts later, the number of fonts was grown by 20, and the number of regions was grown by 15. I clicked 10 more alerts, and got the same increase by 20 resp. 15. I tried to close the tab, but had to kill mozilla to get rid of this page.
Talkback id or stack?
Keywords: stackwanted
I don't crash, but I do assert: ###!!! ASSERTION: Attempt to decrement focus controller's suppression when no su ppression active! : 'PR_FALSE', file c:/src/mozilla/dom/src/base/nsFocusController.cpp, line 462
TalkbackID from my comment #2 in Status Whiteboard
Whiteboard: TB25447774Y
Attached file testcase (deleted) —
In debug build same assertion as in comment #5, no crash, also no crash with optimized build (both current trunk, Win2k). Martin, Hermann, can you try again with current builds?
Now using release 1.6, still the same problem, running on WinXP.
WFM 2004041208/trunk/W2K Martin Heidegger: Are you able to reproduce crash with actual nightbuild?
Keywords: testcase
Whiteboard: TB25447774Y
Martin, please provide a talkback ID if you can still reproduce this with Mozilla 1.7b (installer build has talkback) or a current nightly (zip builds also have talkback now).
Newest nightly build, still the same problem. Actually i can't send you a Talkback ID (maybe i am to stupid to get it), because the Talkbackmanager didn't open by this crash (i have to kill the task).
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a3) Gecko/20040827 not crashing, but making mozilla unusable. Testcase loaded, you´ve got an Alert, which comes up again instantly, wether you confirm or close it. No chance to kill the tab, or switch to another one, focus stays at the alert, you´ve got to use taskmanager to kill the browser.
on windows you can deal with this in two ways a. run venkman: 1. mozilla -venkman 2. click stop 3. click ok to dismiss the alert 4. in venkman you can either i. document.onfocus="" ii. window.alert=function(){} the only crash i'm getting is my generic window closing resulted in gc which tried to use a dead eventqueue - it's a fun crash, but i have lots of ways to hit that crash.
*** Bug 274593 has been marked as a duplicate of this bug. ***
WFM (no crash), Mozilla 2004-12-19-05 trunk Linux. Another way of getting out of the loop: hold ESC key down and then click the X in the upper right corner of the window, eventually a click will go through (at least on Linux).
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a6) Gecko/20041230 Only way to get out of the loop is holding ESC key pressed for some seconds. Thanks for the hint in comment 15, I wouldn´t have thought of trying ESC after OK and X weren´t working. Don´t think I can say wfm, or is this a solution expected from the average user?
*** Bug 287543 has been marked as a duplicate of this bug. ***
There are still problems here. Hold down the enter key -- something I could see many users trying to get rid of this reappearing alert. Firefox goes to 100% CPU and has to be killed. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20051220 Firefox/1.6a1 Works for me in trunk and in 1.0.7. There are other bugs for not being able to end a series of infinite alert()s.
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: stackwanted
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: