Closed Bug 1057927 Opened 10 years ago Closed 8 years ago

Firefox locking up when alerting that you are trying to close a window/tab

Categories

(Firefox :: Untriaged, defect)

31 Branch
x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ahooke, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36

Steps to reproduce:

Go to a site that pops up a window (some sort of ad that tries to get you to install junk like Flash) and demands that you interact. When I click on the close button, a Firefox dialog appears saying that I'm trying to leave that require my attention.


Actual results:

At this point Firefox hangs. CPU use goes to 110+%. I use a SSD so I can't catch any disc actions. I can click on various windows in Firefox and move them around, but I can't close windows and otherwise interact with the window. I've left Firefox to see what it will do and sometimes after half to a full hour it might recover, but that seems random. The only thing to do is force quit and recover the session, being sure to not re-open the popup windows when asked what windows to recover.


Expected results:

First off, the "block popups" in the preferences should actually do what it says - but that choice has never worked right. Secondly, even though Firefox has warned me that I'm closing a window that requires actions I should still be able to click a second time on the close button to actually close the window. I dislike clicking on the Firefox dialog because it could be some questionable site pretending to be Firefox and trying to install something. Annoyingly this seems slightly random - I might get it after an hour or two of use.
Thanks Andrew for filing a bug. Which version of Firefox had you been using? I would suggest you to update the browser version and check if that solves the problem.
Assignee: nobody → sujithreddyms
Here's a small testcase I made:

http://jsbin.com/xutewi/1/edit

If you open that in a new window, and click the window's close button, a similar dialog will pop up. If you click the window close button again, in my copy of Firefox, the window then actually just closes. Is that not what you see, either with this testcase or with a real page on the web? If it works on my testcase, but not on these evil trap pages, can you post a link to such a page so we can figure out what they do to hang Firefox?

Thank you!
(In reply to :Gijs Kruitbosch from comment #2)
> Here's a small testcase I made:
> 
> http://jsbin.com/xutewi/1/edit
> 
> If you open that in a new window, and click the window's close button, a
> similar dialog will pop up. If you click the window close button again, in
> my copy of Firefox, the window then actually just closes. Is that not what
> you see, either with this testcase or with a real page on the web? If it
> works on my testcase, but not on these evil trap pages, can you post a link
> to such a page so we can figure out what they do to hang Firefox?
> 
> Thank you!

... this time with a needinfo...

Sujith, please don't assign bugs to yourself unless you know what the issue is and plan to write a patch to fix it.
Assignee: sujithreddyms → nobody
Flags: needinfo?(ahooke)
Aah, right!
I've been trying to dig up an offending URL so I can post a problem URL. Often I see more than one window popup and it can be hard to figure out which is the problem. Also I need to wait ten minutes to really see that I've hit a problem, then I need to force quit, then I need to look through the recovery dialog (which I hope lists the problem url).

At the moment I'm seeing a number of ad sites like "MacDefender", "Ashley -something- dating service", and some "Binary Method business tricks". There's also a bunch of gaming ads. Trying to spot the exact offender might take me a few days as I suspect that most of these aren't the real culprit. I kind of wish I could see the CPU usage on a per window basis.

I also forgot my hardware/OS combo: latest MacOS on a new 2014 MacBook Air, which has no Flash installed, and no Firefox plug-ins - just default Firefox. I also see this on another 2009 iMac with the latest MacOS. I just use the Air as a web browser with literally Firefox being the only non-default-Apple software installed. The iMac is a dev machine and has all sorts of crud on it.
Flags: needinfo?(ahooke)
OS: Windows 7 → Mac OS X
bug 476541?
QA Whiteboard: [DUPEME?]
Attached image Screen shot of issue.
This is a screen shot of the issue.
This looks different to bug 476541. If you look at the screenshot you'll see that the dialog sheet has appeared and is visible. The 476541 has the dialog appearing behind the window.

What happened in my screen shot is that this popup window appeared. Firefox still worked. Not trusting any popup window contents I clicked on the close window button. If you look at the screen shot you'll see that the red close button is dark showing that it's stuck in a down state. Firefox is now using over 110% of the CPU and the GUI is locked. I can drag the window about, but the menu doesn't work and no widgets on the window work.

I now left Firefox in the above state to see if it would recover. At the 40 minute mark it was still locked up. I then did something accidental. I double clicked on the red close button. This promptly closed the locked up window and returned Firefox to a responsive state. Could it be that clicking on a window's close button while the window is in a query state causes the locking up?

(Interesting, I had started a download before this happened and it finished at the ten minute mark. This displayed the dropping arrow animation that occurs when downloads complete. So though the GUI is blocked the rest of Firefox's threads are working.)

To save time I'll type out the URL from the screen shot:

www.lpmxp5018.com/2E40407B517D4F42594B262871532E20A1382B9AB4C3CA51B479F9C8A591CACE?tgu_src_lp_domain=www.dwldultimatesoftupdate.com&ClickID=10225133441409360522&PubID=128996
Hrm. So to unpack this a bit:

- loading this URL in a tab in 32.0.1 on OS X, I can't reproduce the 100% CPU usage
- I can reproduce the tab not wanting to close if you just keep clicking the close button (which might seem like a hang)
- if I open the page in a new window using the browser console, and click OS X's close button, I see the dialog, but clicking it a second time does successfully close the window for me.

It's possible that the page that opened this new window has other scripts that help cause this problem, of course, or that there are other differences between our environments which cause this.

As it is, I'm hopeful this will be fixed with bug 1050638... but it's still not nice. At all. If you feel like digging into this more, it's possible a profile might help ( https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Profiling_with_the_Built-in_Profiler ) but I guess it might be tricky to "catch" this in the profiler...
Blocks: 1050638
I've just updated to 32.0.1 just last weekend. Haven't had any problems since, but I think that it's because I'm getting good at switching to the popup windows and closing them before they finish setting up. When I see the yellow bar appear at the top of the window that says something like "Firefox has blocked a window from opening" then I know there's a window behind the current window and should switch to it and close it.

I use Apple's activity monitor to measure the CPU usage, drive access, and network activity. How reliable that is up for grabs. I don't think all the cores are hot. It looks like only one. That's why I'm seeing 110% usage. Some Firefox threads are running lightly in other cores, but one core is going crazy.

Interesting about how you can just click a second time to close the window. Single clicking doesn't seem to work for me at that stage. Whereas double-clicking the close box does seem to close the window. To me it looks like: you click to close a window, Firefox asks for confirmation, and wants a double-click on the close as the confirmation. Doing a single-click at this point puts Firefox into a "monitor for second click state", which never comes out of and it never times out from the monitoring for the double-click event. Hence the hang I'm seeing. Could it be that there's a loop watching for the second-click and it runs without easing up on the cpu?

One vague observation is that this issue seems to arise with double popup windows appearing. Maybe I'm hitting a page that puts up a random ad. After time I hit a certain nasty ad. This popup appears behind my current window. Then this popup fires up another ad window - one that it knows contains a query. While I'm distracted by the window that asks me if I really want to close it, then the first window is busily loading something that drains the cpu. With the cpu at 100% the monitoring for events goes screwy. (That is web pops up A, A opens B, B slows me down, A loads script and locks up cpu.) But this is me wildly speculating. The problem with this scenario is that the other window has a URI that's so long that I can't screenshot all of it and when I force quit Firefox and it recovers I only get the page title and not the URI.

I'll look into the profiling if I can wrap my head around it.

This is a hard one to reproduce. I often go days without noticing it. Some days I might get three in an hour. Seems like a randomly set ad on a page that triggers it all. It is getting rarer, but I think it's because I'm learning reflexes to get around it.
Some further feedback on this issue as I've used the latest updates to Firefox.

As a vague feel I have the impression that I'm experiencing the problem a lot less. But I suspect that this is more about me quickly closing the popup windows before they complete downloading the page's content than any real fix. (I guess this is one benefit to living in a country with a slow internet.)

I have noticed one important change. I had noticed that when the interface locked up that I could double click on the offending window's close box. A few minutes would see Firefox recover. This was ugly but I could live with it. The change is that in the latest versions, when this locking problem occurs, the mouse cursor now turns into a spinning beach ball. This means that I can no longer do my trick of double clicking the close button.

This spinning beach ball is a killer. I can't recover Firefox from being locked up without force quitting it. I don't like using third party products but it looks like I'll have to install something like AdBlock. If I stop the popup windows with their ads then I should avoid this problem.

Might as well close this bug.
(In reply to Andrew from comment #11)
> Some further feedback on this issue as I've used the latest updates to
> Firefox.
> 
> As a vague feel I have the impression that I'm experiencing the problem a
> lot less. But I suspect that this is more about me quickly closing the popup
> windows before they complete downloading the page's content than any real
> fix. (I guess this is one benefit to living in a country with a slow
> internet.)
> 
> I have noticed one important change. I had noticed that when the interface
> locked up that I could double click on the offending window's close box. A
> few minutes would see Firefox recover. This was ugly but I could live with
> it. The change is that in the latest versions, when this locking problem
> occurs, the mouse cursor now turns into a spinning beach ball. This means
> that I can no longer do my trick of double clicking the close button.
> 
> This spinning beach ball is a killer. I can't recover Firefox from being
> locked up without force quitting it. I don't like using third party products
> but it looks like I'll have to install something like AdBlock. If I stop the
> popup windows with their ads then I should avoid this problem.
> 
> Might as well close this bug.

Could I ask you to try Firefox 34 beta (https://beta.mozilla.org/ ) and see if that fixes it? It has the fix for bug 1050638, and I'm hopeful this will let you actually close the tab...
Flags: needinfo?(ahooke)
I gave the Beta version 34 a go over the weekend and the problem is definitely still there, and worse.

I think the "worse" aspect has come from a big improvement to the Firefox speed. I really have noticed a massive leap in general responsiveness and rendering. It's a really nice improvement. I wouldn't say that Firefox previously felt sluggish but the difference is really noticeable.

But this improvement in speed causes me problems. It appears that I've become quite skilful at closing the  popup ads as they appear and the previously slower speed of Firefox (plus my slow internet speeds) gave me the time to close the offending windows before they loaded enough to cause problems. 

So you could say that an improvement to Firefox has caused my problem to be unmanageable. I've gone from experiencing a lock up per day to one every five minutes of usage.

I can't make the problem reproducible. If I screenshot the ad causing the lock up, kill Firefox, restart Firefox and enter the url in manually, the page loads but without any lock up. It doesn't seem to be the ad itself but something that randomly joined to the ad. Hit a dozen or so ads and boom.

I've dropped back to the version prior to beta and I'll try Adblock. If this improves things then something nasty is definitely associated with ads. But what that is I'm at a loss to determine.

On a note of observation, when the locking occurred I noticed that more of the cpu is being used. I've gone from seeing slightly over 100% cpu usage to about 130% cpu usage. Maybe that's a part of the improved speed of Firefox.
Flags: needinfo?(ahooke)
(In reply to Andrew from comment #13)
> I gave the Beta version 34 a go over the weekend and the problem is
> definitely still there, and worse.
> 
> I think the "worse" aspect has come from a big improvement to the Firefox
> speed. I really have noticed a massive leap in general responsiveness and
> rendering. It's a really nice improvement. I wouldn't say that Firefox
> previously felt sluggish but the difference is really noticeable.
> 
> But this improvement in speed causes me problems. It appears that I've
> become quite skilful at closing the  popup ads as they appear and the
> previously slower speed of Firefox (plus my slow internet speeds) gave me
> the time to close the offending windows before they loaded enough to cause
> problems. 
> 
> So you could say that an improvement to Firefox has caused my problem to be
> unmanageable. I've gone from experiencing a lock up per day to one every
> five minutes of usage.

:-(

> I can't make the problem reproducible. If I screenshot the ad causing the
> lock up, kill Firefox, restart Firefox and enter the url in manually, the
> page loads but without any lock up. It doesn't seem to be the ad itself but
> something that randomly joined to the ad. Hit a dozen or so ads and boom.

Hrm. Are you comfortable sharing the pages that cause these ads? I'm assuming it's some interaction with the original opening page that's causing this, if opening the ad page itself doesn't trigger the problem.
Flags: needinfo?(ahooke)
I'll try to dig up some examples but, now that I think about it, I'd say a lot come from clicking on Captchas. When I get a site that requires "proof" that I'm human they have require entering a Captcha. Clicking on the Captchas causes a lot of popup ads to appear. It's like they use the click to give keyboard focus as an acknowledgement that you want to open new windows.

This means that I'll have to turn off Adblocker, which is a shame as it works like a charm. It's so strange browsing without a swarm of ad windows appearing. This probably explains why I seem to be the only person seeing this problem - I'm probably the only person using just vanilla Firefox - AdBlocker is a very popular plugin.
Flags: needinfo?(ahooke)
Hi reporter,

I haven't managed to reproduce this issue on the latest release(43.0.4) nor latest Nightly(46.0a1). Do you have any links to any website on which you encountered this issue?

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20160105164030

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160107030235

Can you please try to reproduce this on the latest release(43.0.4) and latest Nightly(46.0a1) and provide the results? When doing this, please try to reproduce with a new clean Firefox profile, maybe even in safe mode, as some of this issues may be caused by third party installed add-ons or custom settings(https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems).

Thanks,
Paul.
Flags: needinfo?(ahooke)
Since the reporter didn't provide the requested information, I will mark this issue as RESOLVED INCOMPLETE. If you still encounter this problem, please feel free to reopen this bug, or file a new one.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(ahooke)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: