Closed Bug 585813 Opened 13 years ago Closed 11 years ago

Script Timeout at tabbrowser.xml:1457 when closing tabs


(Firefox :: Tabbed Browser, defect)

Not set



Firefox 13
Tracking Status
firefox10 --- wontfix
firefox11 --- wontfix
firefox12 --- verified
firefox13 --- verified
firefox-esr10 --- wontfix
blocking2.0 --- final+


(Reporter: alice0775, Assigned: ttaubert)



(Keywords: regression, Whiteboard: [qa!])


(1 file)

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4pre) Gecko/20100809 Minefield/4.0b4pre ID:20100809040505
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b4pre) Gecko/20100809 Minefield/4.0b4pre ID:20100809040505

When I close many tabs by middle-clicking. the following alert box appears.

>A script on this page may be busy, or it may have stopped responding. You can >stop the script now, or you can continue to see if the script will complete.
>Script: chrome://browser/content/tabbrowser.xml:1457

I select "Continue" in the alert, however I got same alert box again again.
If I select "Cancel" in the alert, then remaining tabs can not be closed any more.

Reproducible: Always

Steps to Reproduce:
1. Start Minefield with new profile
2. Create Bookmarks Folder and 34 Bookmarks in the folder
3. Open in All Tabs Bookmarks Folder ( 34 tabs )
4. Middle click tab quickly ( Till alert appears )

*number 34 is example.

Actual Results:
 Alert box appears.

Expected Results:
 Close action should be performed properly.
> >Script: chrome://browser/content/tabbrowser.xml:1457

Can you open chrome://browser/content/tabbrowser.xml in a tab, hit Ctrl+U, Ctrl+L, go to line 1457 and tell me what code is in that line? Thanks.
Blocks: 380960
>>>> is line 1457

            if (aCloseWindow) {
              this._windowIsClosing = true;
>>>>        while (this._removingTabs.length)
            } else if (!this._windowIsClosing) {
              if (aNewTab)

              // workaround for bug 345399
So I guess this loops infinitely. Interesting...
blocking2.0: --- → final+
(I just ran across this when trying to enter private browsing, probably the same thing though since it was closing tabs?)
OS: Windows 7 → All
Hardware: x86 → All
This happens to me at least once a day, but when closing tabs using Cmd+W. So far I haven’t seen any particular pattern here. I don’t recall this happening until 4.0b7.

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b7) Gecko/20100101 Firefox/4.0b7
Keywords: regression
The only cause I can think of after a brief look at _endRemoveTab is that aTab._endRemoveArgs might be falsy for some reason, resulting in an early return and the infinite loop.
Target Milestone: --- → Firefox 4.0b8
Target Milestone: Firefox 4.0b8 → ---
I can't reproduce this anymore. Can someone post more specific steps to reproduce?
I am reporter. and I can not reproduce anymore too.
I’m able to reproduce in Fx4b7, but never consistently enough to create a reproducible testcase.
(In reply to comment #10)
> I’m able to reproduce in Fx4b7, but never consistently enough to create a
> reproducible testcase.

A lot of code has changed since then. Please test this in a nightly or the release candidate for beta 8:
You can use a separate, fresh profile if you'd like:
Bump. Colin, can you still reproduce this?
I haven’t run into it thus far in Fx4b8, so it is probably fixed.
Closed: 12 years ago
Resolution: --- → WORKSFORME
Thanks Colin.

Closing, since reporter and confirmers can no longer reproduce.
Not fixed at least not for the user on bug 646759.
Resolution: WORKSFORME → ---
Summary: Script Timeout at tabbrowser.xml:1457 when I close tabs by middle clicking. → Script Timeout at tabbrowser.xml:1457 when closing tabs
I have no idea what could cause this, except this._removingTabs[0]._endRemoveArgs being null when this._endRemoveTab(this._removingTabs[0]); is called, but that seems impossible.
I got a slow-script dialog at tabbrowser.xml:1610 with yesterday's nightly. I think I was trying to close a tab when it happened. After that, I couldn't close any tabs, but I could still open new ones.
This happens all the time with my FF, as I can remember only on, which is written in JSP as far as I know.
This has happened to me on several occasions, but I was never able to consistently reproduce the unresponsive script.  I have finally been able to reproduce this after noticing it at my place of work.

The following link has the ingredient in place to create the bug:

To simulate the unresponsive script/crash:

- You must have dom.allow_scripts_to_close_windows set to true (in about:config) for this to work.
- Have at least two tabs open before opening my link. (It only seems to "crash" when you're closing the penultimate tab.)
- Middle mouse click to close this tab, then close the previous tabs with a middle click. The penultimate tab should make the browser temporarily unresponsive.

The bug seems to be triggered with window.close(). This might also happen without dom.allow_scripts_to_close_windows being set to true, but this is the only way I could repeatedly reproduce it.
For Comment 22 I found
Last good nightly: 2009-03-24
First bad nightly: 2009-03-26 (there were no 2009-03-25 Win32 Builds)

what points to Bug 462673 what points to already filed Regression Bug 555875.

I got no Alert Boxes though.
For comment 23:

Bug 555875 relates to the middle mouse click causing unclosable tabs, but clicking the tabs 'X' or CTRL+W causes the same unresponsive script problem.

Bug 462673 seems to be more like the problem I'm seeing, though it's showing as fixed, but I saw the same problem in FF 4.0, and currently in FF 5.0.

I'm new to filing bugs, so I apologise if I've done something wrong.
The bug was forgotten? Then at least uncheck it as blocking final.
Bump, this is still occurring for me using FF10.0 under WinXP and now the line number is 1636 - this has also been occurring under FF9 for a while.

I open several tabs using ctrl-click then visit the first and close it using CTRL-W, which displays the next tab which I then also close using CTRL-W and so on.  It varies how many tabs are closed in this way before the unresponsive script warning  appears but I seem to get this very regularly, perhaps even daily.  For those interested these are Facebook game pages that are almost certainly script-heavy and which have not finished loading by the time I close them.

I can confirm that FF ignores requests to close further tabs after the warning but still allows new ones to be opened.  Closing FF then pops up the confirm dialog asking if I want to close 1 more tab than is visible.

This is the first time I've looked for a bug to report against but it's exactly the script line I'm seeing as unresponsive so my apologies if this is not the right place to post!
I'm using FF 10.0.1 on MacOS X 10.7.3.
I've been getting hit with this bug for a very long time, and it's still around.  I finally signed up here and decided to write about it.

This seems to be race-condition however, involved somehow with Flash.

Here's a simple way to repeat it for yourself.

1) Copy the text of this message you're reading and place it somewhere you can read it; as you'll first need to close Firefox.
2) Make sure you have Flash installed in FF.
3) Open Firefox fresh, and don't have any pages open, even this one that you're reading.
4) Go to
5) Open 10 product pages and wait for all the pages to complete loading.  These are pages which show an individual product, and has a zoom feature via Flash loaded on the main photo of the product.
6) Switch focus to the 2nd tab from the left-hand side, then place your mouse over the 'X' like you're ready to close out the tab.
7) Now, click like crazy until all the tabs are closed.  You'll notice, most often, you'll be able to click the 'X' on a single tab multiple times.  That's ok, keep going.  Now, in a short while, you'll be treated with the glory of this never-dying bug.

Fails also on MS Vista. Started after installing FF 10 or 10.1.
Assignee: nobody → ttaubert
Attached patch patch v1Splinter Review
Attachment #597793 - Flags: review?(dao)
Attachment #597793 - Flags: review?(dao) → review+
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 13
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
(In reply to Mark Smith from comment #26)
> Bump, this is still occurring for me using FF10.0 under WinXP and now the
> line number is 1636 - this has also been occurring under FF9 for a while.

Is there a plan to backport this fix into FF11? (FF10 is affected)
Comment on attachment 597793 [details] [diff] [review]
patch v1

[Approval Request Comment]
Regression caused by (bug #): bug 380960
User impact if declined: browser might hang when closing tabs
Testing completed (on m-c, etc.): landed two weeks ago and didn't cause any problems
Risk to taking this patch (and alternatives if risky): low risk
String changes made by this patch: none
Attachment #597793 - Flags: approval-mozilla-esr10?
Attachment #597793 - Flags: approval-mozilla-beta?
Attachment #597793 - Flags: approval-mozilla-aurora?
Comment on attachment 597793 [details] [diff] [review]
patch v1

[Triage Comment]
Since this may be causing unnecessary user pain and is low risk, approving for Aurora 12. It's too late in FF11's cycle to take a fix for a bug that's been around since FF4, however. There's also no need to backport this to the ESR, however, as it's not a critical security/stability issue.
Attachment #597793 - Flags: approval-mozilla-esr10?
Attachment #597793 - Flags: approval-mozilla-esr10-
Attachment #597793 - Flags: approval-mozilla-beta?
Attachment #597793 - Flags: approval-mozilla-beta-
Attachment #597793 - Flags: approval-mozilla-aurora?
Attachment #597793 - Flags: approval-mozilla-aurora+
Whiteboard: [qa-]
Whiteboard: [qa-] → [qa+]
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20100101 Firefox/12.0
While verifying this issue I noticed bug 741391. Could the fix for this bug have provoked it? (that bug didn't reproduce before)
Verified as fixed on:
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0
Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0
BuildID: 20120425123149
Whiteboard: [qa+] → [qa!]
I'm getting this bug (unresponsive script chrome://browser/content/tabbrowser.xml ) on Mac OS X.6.8. Doesn't happen consistently – once every couple dozen tabs closed, maybe, and I can't see a pattern.

It's line 2088 for me, but this is the same as Alice0775 White posted above (with "while" being line 2088).

            if (aCloseWindow) {
              this._windowIsClosing = true;
              while (this._removingTabs.length)
I have just got it, browser got frozen completely.

(In reply to Marko from comment #41)
> I have just got it, browser got frozen completely.
> chrome://browser/content/tabbrowser.xml:2066

This bug was fixed and verified a *long* time ago. While the symptom may appear to indicate this is the same bug, it probably isn't. Please file a new bug report. Thank you.
I have been experiencing browser freezes for the last few days perhaps since the last Firefox release (I am not 100% sure as I have setup FF automatic upgrades). The same things happen i.e. the browser freezes, tabs don't close etc. So, today instead of closing Firefox as a whole or stopping the script, I decided to read the entire message as I thought that maybe there was some virus or something which was trying to freeze the browser everyday. There were no more than 2-3 tabs open and that too of reputable sites. I also clean up all history, cache, cookies etc. all these years everytime I close firefox. So, the freeze today just did not make sense. Here is what was written in the popup:

A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.

Script: chrome://browser/content/tabbrowser.xml:2089

Then I tried to open the link above and paste the code into notepad++. Here is the lines that appear near line no. 2089.

Here are the lines:

          </body></method><method name="moveTabToStart"><body>
            var tabPos = this.mCurrentTab._tPos;
            if (tabPos > 0)
              this.moveTabTo(this.mCurrentTab, 0);
          </body></method><method name="moveTabToEnd"><body>
            var tabPos = this.mCurrentTab._tPos;
            if (tabPos < this.browsers.length - 1)
              this.moveTabTo(this.mCurrentTab, this.browsers.length - 1);
          </body></method><method name="moveTabOver"><parameter name="aEvent"/><body>
            var direction = window.getComputedStyle(this.parentNode, null).direction;
            if ((direction == "ltr" && aEvent.keyCode == KeyEvent.DOM_VK_RIGHT) ||
                (direction == "rtl" && aEvent.keyCode == KeyEvent.DOM_VK_LEFT))
          </body></method><method name="duplicateTab"><parameter name="aTab"/><!-- can be from a different window as well --><body>
            return SessionStore.duplicateTab(window, aTab);
           MAKE SURE TO ADD IT HERE AS WELL. --><property name="canGoBack" onget="return this.mCurrentBrowser.canGoBack;" readonly="true"/><property name="canGoForward" onget="return this.mCurrentBrowser.canGoForward;" readonly="true"/><method name="goBack"><body>

That is from line no.2080 to 2099 as per notepad++. just took some extra lines if there was any mistake by any chance.

The exact line no. 2089 as per notepad++ is

</body></method><method name="moveTabOver"><parameter name="aEvent"/><body>

This frequent browser freezing at that too without opening much tabs and clearing all cache, history etc. has never happened to me in my nearly 10+ years of using Firefox. So, thought of informing.
zaman (comment 43) please try and if it doesn't help, file a separate bugs.

comments 40 and 41: you're probably seeing bug 1078280.

Every one else, please file separate bugs instead of commenting here.
You need to log in before you can comment on or make changes to this bug.