Closed Bug 200006 Opened 21 years ago Closed 21 years ago

cannot dismiss alert when accessing a bogus url via open web location (target=current window or new tab, new window works fine)

Categories

(SeaMonkey :: UI Design, defect)

PowerPC
macOS
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bugzilla, Assigned: danm.moz)

Details

(Keywords: hang, platform-parity, regression, Whiteboard: [adt2])

Attachments

(2 files)

found using 2003.03.31.03 comm bits on mac 10.2.4. not a problem on win2k or
linux. this is a recent regression, as it works fine in the 2003.03.25.03 build.

1. bring up the Open Web Location dialog (cmd+shift+L).
2. select "New Navigator Tab" from the droplist.
3. enter a bogus url in the location textfield (eg, foo.foo.foo).
4. click the Open button.
5. you'll get an alert (sheet) saying that the url is invalid --click OK to
dismiss the alert.

results: the alert sheet won't go away. with the exception of the apple and
application menu, the entire menubar is disabled. you can only quit the app.
this regressed btwn the 2003.03.25.03 (works fine) and 2003.03.26.15 (broken)
builds.
QA Contact: paw → sairuh
Nav triage team: nsbeta1+/adt2
Keywords: nsbeta1nsbeta1+
Whiteboard: [adt2]
Haven't we seen this before? I guess I'll go find the bug and see how they fixed
it then (though I seem to recall that one being cross platform).
Status: NEW → ASSIGNED
See (related or same?) bug 144710
odd how it was working for a while, then came back.
Going back with the builds i have on hand I see this *is* a problem on for me on
1.3,  was not on 2003031403 on the first try (but the focus was lost), 2nd try
(relaunched app) i wasn't able to dismiss the dialog again... 

Perhaps this isn't a regression, but just intermittent (and a dupe of bug
144710) - Se, in 2003 03 25 03 did it work ok multiple times in a row?
I pulled a tree from 2003-03-25 00:00:00 and saw this problem.

*** This bug has been marked as a duplicate of 144710 ***
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Not quite a dupe after all, just very similar symptoms.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
So here's where I'm at: when you call window.setTimeout, we add a timer to a
sorted queue. For this specific sheet case, that timer never gets processed,
even though its time has come up and it should've been.
Summary: cannot dismiss alert when accessing a bogus url via open web location → cannot dismiss alert when accessing a bogus url via open web location (target=current window or new tab, new window works fine)
*mumble* modal event loops *mumble*
The data in attachment 120977 [details] show what's going on here. Essentially, we're
deadlocked on the event queue monitor.

The main thread is in a nested event loop for the 'host not found' dialog. On
the stack, we're just about to leave nsWindowWatcher::OpenWindowJS(), which was
called for the Open Location dialog. That has a EventQueueAutoPopper on the
stack, which is being destroyed, and in doing so calling
nsEventQueueServiceImpl::PopThreadEventQueue. That method enters the
mEventQMonitor of the nsEventQueueServiceImpl.

Meanwhile, we're trying to run a modal event loop, which needs to process
PLEvents. The timer thread trying to post a timer events, and is calling
nsEventQueueServiceImpl::GetThreadEventQueue, which is waiting to enter that
same monitor. We deadlock, because we never leave the modal event loop that is
causing the mEventQMonitor to be held on the stack of the main thread.

I think this is really a bug for danm. It seems wrong that
PL_ProcessPendingEvents is ever called while the event queue service is the
mEventQMonitor, because you never know whether code called from a plevent is
going to need to do event queue stuff.
->danm
Assignee: jaggernaut → danm
Status: REOPENED → NEW
On eMac with Sys 10.1.5.  Nightly build of Mozilla for Nov 30. 

This bug or something like it came back again in mid-November, 2003.  
Alerts of almost any kind - server-side, or Mozilla password manager, 
Mozilla "do you want to close all tabs" made Mozilla hang. Depending on 
the particulars, I had to quit or force-quit.  Neither "ok" nor "cancel" would 
do anything and in some cases the entire menubar is dimmed while it 
waits. 

Tried it just now and the Mozilla alerts for password choice and tab 
closing worked just fine! However, all is not quite right - a side effect I've 
noticed has occurred - my animated .gif is no longer animated, nor is the 
mozilla icon at the top right  showing any activity when a page is loading.  

The server-side alert hangs Mozilla if I've already lost the animation, but at 
least force-quit wasn't required.  
The code for the alert I used, if this is helpful at all,  is:
function renamepage(){
var pagename = prompt("Please type in a new name for your page?","");
if(pagename){
_cfainvokecontrolhandlerevent('editbar.renamepage',pagename,'editbar');
}

Tell me if I should use another bug to track the bug I've described.  Just 
now I can't make it fail again.   I wanted to spot the moment the animation 
stopped.  Maybe keeping an animated gif in view is a way to prevent the 
bug!  ha ha.

Polly



Not sure why a monitor is needed rather than a lock.  Could use automon/lock
love in 1.7a, too.  But this ought to fix things for 1.6b.

/be
Comment on attachment 136615 [details] [diff] [review]
proposed fix, plus comment cleanup

Thanks to sfraser for the analysis.

/be
Attachment #136615 - Flags: superreview?(darin)
Attachment #136615 - Flags: review?(danm-moz)
Attachment #136615 - Flags: approval1.6b?
Flags: blocking1.6b+
danm: I hope no event handler depends on the thread-id-keyed table entry in the
event queue service still being present; PushThreadEventQueue will cope with the
lack of an entry.

/be
Comment on attachment 136615 [details] [diff] [review]
proposed fix, plus comment cleanup

looks right to me.  always good to avoid making callbacks while holding a lock!
;)
Attachment #136615 - Flags: superreview?(darin) → superreview+
Comment on attachment 136615 [details] [diff] [review]
proposed fix, plus comment cleanup

Should be OK. I believe a thread's eldest queue is never disposed of by
popping, so the chewy nugget of this code should never be triggered, anyway. If
it is somehow triggered and we try to push a new eldest queue in some
downstream event handler, well, that'll work as far as we know. And we've got
an assertion there waiting already.
Attachment #136615 - Flags: review?(danm-moz) → review+
Attachment #136615 - Flags: approval1.6b? → approval1.6b+
Fixed.

/be
Status: NEW → RESOLVED
Closed: 21 years ago21 years ago
Resolution: --- → FIXED
VERIFIED: mozilla 1.6.f, mac os x.
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: