Closed
Bug 1041788
Opened 10 years ago
Closed 10 years ago
Unable to close tab after slow script warning at chrome://browser/content/tabbrowser.xml:1989
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
People
(Reporter: bullionareboy, Assigned: ttaubert)
References
Details
(Keywords: regression)
Attachments
(4 files)
(deleted),
video/mp4
|
Details | |
(deleted),
video/mp4
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
patch
|
dao
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
Sylvestre
:
approval-mozilla-esr31-
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0 (Beta/Release)
Build ID: 20140721030205
Steps to reproduce:
1. Have multiple website tabs open.
2. click closing [x] on specific tab.
Actual results:
Unable to close individual tab
Expected results:
tab should have closed on clicking the close button
i guess you can extend this problem to closing any tabs after this problem occurs.
Comment 2•10 years ago
|
||
Unable to reproduce, 33.0a1 (2014-07-20) Win 7 x64
Component: Untriaged → Tabbed Browser
Comment 3•10 years ago
|
||
Please check if the issue occurs using Firefox in safe mode (with your addons disabled):
http://support.mozilla.com/kb/Safe+Mode
And on a new, empty profile:
http://support.mozilla.org/en-US/kb/Managing-profiles#w_starting-the-profile-manager
This happens after a certain time of usage, it occurs randomly.
Ive got raw data and about:memory if that helps to diagnose the issue.
Updated•10 years ago
|
this again happens out of the blue on the latest Nightly 34.0a1 (2014-07-26)
i had reddit, imgur, nightly start page and an empty tab active.
Not sure if this might help, but AT-TIMES i get this pop-up before the problem starts.
Comment 7•10 years ago
|
||
(In reply to bull500 from comment #6)
> Created attachment 8463016 [details]
> popup.png
>
> Not sure if this might help, but AT-TIMES i get this pop-up before the
> problem starts.
That's very interesting - would you mind browsing to chrome://browser/content/tabbrowser.xml in your Firefox, viewing source, and hitting Ctrl-L? A dialog should come up asking you to enter a line number to jump to - type in 1989 and press enter.
Wherever it hops you to, would you mind copying it and the surrounding code, and pasting it in here? When you do that, can you also indicate which of the lines you're pasting is 1989?
Thanks!
Flags: needinfo?(bullionareboy)
Comment 8•10 years ago
|
||
Also, do you see anything in your browser console when you attempt and fail to close a tab? (You can open up the console with Ctrl-Shift-J).
The following pasted output is from tabbrowser.xml. Follows:
<method name="_endRemoveTab"> ----> LINE [1985]
<parameter name="aTab"/>
<body>
<![CDATA[
if (!aTab || !aTab._endRemoveArgs) ----> LINE [1989]
return;
var [aCloseWindow, aNewTab] = aTab._endRemoveArgs;
aTab._endRemoveArgs = null;
if (this._windowIsClosing) {
aCloseWindow = false;
aNewTab = false;
}
this._lastRelatedTab = null;
// update the UI early for responsiveness
aTab.collapsed = true;
this.tabContainer._fillTrailingGap();
this._blurTab(aTab);
this._removingTabs.splice(this._removingTabs.indexOf(aTab), 1);
if (aCloseWindow) {
this._windowIsClosing = true;
while (this._removingTabs.length)
this._endRemoveTab(this._removingTabs[0]);
} else if (!this._windowIsClosing) {
if (aNewTab)
focusAndSelectUrlBar();
// workaround for bug 345399
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
} ----> LINE [2019]
Flags: needinfo?(bullionareboy)
Reporter | ||
Comment 10•10 years ago
|
||
Also about the browser console info - when the https://bugzilla.mozilla.org/attachment.cgi?id=8463016 pop up came up; i hit the debug button and it showed me an empty browser console.
Do you want to create the tab close situation again? Its randomly occurs but i can try my luck.
Comment 11•10 years ago
|
||
Hm, that 1989 line is just a conditional, and wouldn't be expensive, which suggests that some kind of loop was being executed and when the slow-script warning came up, you just happened to be at that line of code.
Do you happen to have any add-ons installed and enabled?
Flags: needinfo?(bullionareboy)
Reporter | ||
Comment 12•10 years ago
|
||
The addons are DownloadHelper, DownThemALL, Gnotifier, HTitle, Lightbeam, Japanese Tattoo - (persona).
When i first submitted the bug i had - DownloadHelper, DownThemALL, HTitle,Japanese Tattoo - (persona).
Flags: needinfo?(bullionareboy)
Comment 13•10 years ago
|
||
So, as luck would have it, I reproduced this!
Some facts:
1) I had a large number (~200) tabs open at the time.
2) I attempted to close most of them by selecting a tab and choosing "Close Other Tabs"
3) I got the slow script warning as Firefox tried to close all my tabs, and I chose to stop the script.
After that, I couldn't close any tabs. Flipping open my browser debugger, I saw that the reason I couldn't close a tab was because we were failing this conditional in _beginRemoveTab:
if (aTab.closing ||
this._windowIsClosing)
return false;
this._windowIsClosing is stuck set at "true". I imagine this is likely because I stopped the slow script while I was closing all of those tabs.
Here's a plausible explanation: with many tabs open, I choose "Close Other Tabs". This causes me to enter "removeAllTabsBut" in tabbrowser.xml, which loops through all tabs that aren't pinned and aren't the one I selected, and calls removeTab on them.
For each of these tabs, we enter _beginRemoveTab, which adds them to the "_removingTabs" array, as tabs we're in the process of removing.
This function also sets "_endRemoveArgs" on the closing tab. One of those args is "closeWindow", which on my profile gets set to true here in "_beginRemoveTab":
var closeWindow = false;
var newTab = false;
if (this.tabs.length - this._removingTabs.length == 1) {
closeWindow = aCloseWindowWithLastTab != null ? aCloseWindowWithLastTab :
!window.toolbar.visible ||
Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab");
// ... The rest of the code in this block doesn't matter, so I omitted it
}
I must eventually iterate to the last tab in removeTab, and so this.tabs.length - this._removingTabs.length will equal 1. By the way I've traced it, aCloseWIndowWithLastTab will be passed as null from "removeTab", so the reason closeWindow gets set to true is because my browser.tabs.closeWindowWithLastTab pref is set to true, which is the default.
Ok, so I've got all of those tabs starting to close, and they're all _animating_ closed, which means we're waiting for the transition to complete. That's a ton of animation. I have a feeling we never make it for most of them, and hit the timeout fallback handler at the bottom of "removeTab".
At this point, we have a huge number of tabs closing, and one of those tabs has the "closeWindow" _endRemoveArg set to true.
So each tab now gets "_endRemoveTab" called for it.
In that function, there's this code:
if (aCloseWindow) {
this._windowIsClosing = true;
while (this._removingTabs.length)
this._endRemoveTab(this._removingTabs[0]);
} else if (!this._windowIsClosing) {
aCloseWindow will be true in one case - the case of the second-to-last tab closing. We set this._windowIsClosing to true, and then we... we iterate all of the tabs still in this._removingTabs, and try to _endRemoveTab them as well (this is after we've removed the current tab from the _removingTabs array).
I suspect this while-loop is the hot-loop that's causing the slow-script warning to come up.
And then the user chooses to stop the slow script, and this._windowIsClosing is stuck at true, and closing tabs is totally busted.
TL;DR: This seems pretty hairy, and I suspect it might be related to having many, many tabs open at once, and attempting to close most of them. This can cause a slow-script warning for tabbrowser.xml, which, if the user chooses to stop the script, puts the user in a bad state which prevents them from closing other tabs.
I also do not think this is an e10s-specific bug or restricted to Linux, as I didn't run into any of the above while using an e10s window, and I was on OS X.
Status: UNCONFIRMED → NEW
tracking-e10s:
+ → ---
Ever confirmed: true
OS: Linux → All
Summary: [e10s] Unable to close tab → Unable to close tab after slow script warning at chrome://browser/content/tabbrowser.xml:1989
Comment 14•10 years ago
|
||
bull500 - do you remember attempting to close many, many tabs before the slow script warning came up?
Flags: needinfo?(bullionareboy)
Reporter | ||
Comment 15•10 years ago
|
||
Ah forgive my knowledge of coding. i know C/C++ but ive only used in school projects, hardly have any idea of how projects work in the real world. I can understand to the situation of a fine extent though :)
And yes i use a single browser window from day to night, so i keep opening up tabs and closing them.
At times i do close tabs in a very fast manner in a single go, and i close them individually by clicking the 'x' icon on the tabs.
Flags: needinfo?(bullionareboy)
Comment 16•10 years ago
|
||
Putting this in the Firefox backlog.
No longer blocks: core-e10s, old-e10s-m2
Flags: firefox-backlog+
Comment 17•10 years ago
|
||
Removing myself as assignee, since this doesn't appear to be e10s-related.
Assignee: mconley → nobody
Reporter | ||
Comment 18•10 years ago
|
||
Today it brought me with
Script: chrome://browser/content/tabbrowser.xml:2023
Firefox 34.0a1 (2014-07-29)
Code Snippet
if (aCloseWindow) {
this._windowIsClosing = true;
while (this._removingTabs.length)
this._endRemoveTab(this._removingTabs[0]); <--- LINE [2023]
} else if (!this._windowIsClosing) {
if (aNewTab)
focusAndSelectUrlBar();
Comment 19•10 years ago
|
||
Hey Tim - any idea what might be happening here?
Flags: needinfo?(ttaubert)
Assignee | ||
Comment 20•10 years ago
|
||
This seems very similar to bug 585813. The code that landed for this bug [1] was removed by [2] in bug 616853. I don't actually remember why that was removed there, maybe we should add it back? The onunload dialog is tab modal now but that doesn't prevent us from re-entering _beginRemoveTab() with a full event queue, no?
[1] https://hg.mozilla.org/integration/fx-team/rev/39f8849e89c5
[2] https://hg.mozilla.org/mozilla-central/diff/8a7368027aad/browser/base/content/tabbrowser.xml
Flags: needinfo?(ttaubert)
Assignee | ||
Comment 21•10 years ago
|
||
Pushed a patch with the reentrancy check to try:
https://tbpl.mozilla.org/?tree=Try&rev=b90219ee360c
Assignee | ||
Comment 22•10 years ago
|
||
I accidentally cancelled the wrong try run :| But it looks like the patch is good.
bull500, could you maybe check whether you're hitting the same problems with the try builds? An opt build for Linux 64-bit can be found here:
https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/ttaubert@mozilla.com-b90219ee360c/try-linux64/firefox-34.0a1.en-US.linux-x86_64.tar.bz2
Thanks!
Flags: needinfo?(bullionareboy)
Reporter | ||
Comment 23•10 years ago
|
||
Im typing this through your build! That is one Kick-ass patch! :D
I've tested individually closing down hundreds of tabs in a single go and also using the 'Close other tabs' option.
Didn't break a sweat! Bravo! It'll be cool if somebody else can also verify and push this into the upstream package.
Flags: needinfo?(bullionareboy)
Reporter | ||
Comment 24•10 years ago
|
||
ive tried a lot to recreate the situation. looks like its fine. will need somebody else to verify again.
Assignee | ||
Comment 25•10 years ago
|
||
(In reply to bull500 from comment #24)
> ive tried a lot to recreate the situation. looks like its fine. will need
> somebody else to verify again.
Thanks for verifying! Mike, can you please try again with this patch given that you were able to reproduce in comment #13? Thanks!
Flags: needinfo?(mconley)
Comment 26•10 years ago
|
||
I wasn't able to reliably reproduce it - I just experienced it once - but I'll run with this for a while to see if I can cause it again.
Flags: needinfo?(mconley)
Assignee | ||
Comment 27•10 years ago
|
||
Submitting for review in the meantime, Dão already reviewed this once before :)
Assignee | ||
Comment 28•10 years ago
|
||
Marco, can you please add this to the iteration?
Blocks: 616853
Iteration: --- → 34.1
Points: --- → 2
status-firefox31:
--- → wontfix
status-firefox32:
--- → affected
status-firefox33:
--- → affected
status-firefox34:
--- → affected
Flags: needinfo?(mmucci)
Keywords: regression
Hardware: x86_64 → All
Assignee | ||
Comment 29•10 years ago
|
||
[Tracking Requested - why for this release]:
tracking-firefox32:
--- → ?
tracking-firefox33:
--- → ?
Comment 31•10 years ago
|
||
I wasn't able to reproduce with the try build, after running with it for a day.
Updated•10 years ago
|
Attachment #8466171 -
Flags: review?(dao) → review+
Assignee | ||
Comment 32•10 years ago
|
||
Assignee | ||
Comment 33•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 34
Comment 34•10 years ago
|
||
Hi Tim, should this bug be marked as [qa+] or [qa-] for verification.
Flags: needinfo?(ttaubert)
Assignee | ||
Updated•10 years ago
|
QA Whiteboard: [qa?] → [qa+]
Flags: needinfo?(ttaubert)
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 35•10 years ago
|
||
Comment on attachment 8466171 [details] [diff] [review]
0001-Bug-1041788-Don-t-enter-_beginRemoveTab-when-a-.perm.patch
Approval Request Comment
[Feature/regressing bug #]: Regression from bug 616853.
[User impact if declined]: Quickly closing a lot of tabs in succession can make tabs uncloseable and bring the browser to an unusable state.
[Describe test coverage new/current, TBPL]: Landed on Nightly, works. No automated tests because that's unfortunately hard to do.
[Risks and why]: Very low risk and small patch, the same code was in for 18 releases before but was removed by accident.
[String/UUID change made/needed]: None.
If this is not a sec:{high,crit} bug, please state case for ESR consideration: This bug is easy to fix and makes the browser quite unusable if it ever occurs. Has in the past been reported when closing tabs with Flash (bug 585813).
Fix Landed on Version: 34 (Hopefully we'll uplift to 32 + 33.)
Attachment #8466171 -
Flags: approval-mozilla-esr31?
Attachment #8466171 -
Flags: approval-mozilla-beta?
Attachment #8466171 -
Flags: approval-mozilla-aurora?
Updated•10 years ago
|
Comment 36•10 years ago
|
||
Comment on attachment 8466171 [details] [diff] [review]
0001-Bug-1041788-Don-t-enter-_beginRemoveTab-when-a-.perm.patch
We only accept security and top critical bugs for ESR. Not sure it fits here...
Attachment #8466171 -
Flags: approval-mozilla-esr31?
Attachment #8466171 -
Flags: approval-mozilla-esr31-
Attachment #8466171 -
Flags: approval-mozilla-beta?
Attachment #8466171 -
Flags: approval-mozilla-beta+
Attachment #8466171 -
Flags: approval-mozilla-aurora?
Attachment #8466171 -
Flags: approval-mozilla-aurora+
Comment 37•10 years ago
|
||
Hi Florin, can a QA contact be assigned for verification of this bug.
Flags: needinfo?(florin.mezei)
Assignee | ||
Comment 38•10 years ago
|
||
Updated•10 years ago
|
Iteration: 34.1 → 34.2
QA Contact: cornel.ionce
Comment 39•10 years ago
|
||
(In reply to Mike Conley (:mconley) from comment #13)
> 1) I had a large number (~200) tabs open at the time.
> 2) I attempted to close most of them by selecting a tab and choosing "Close
> Other Tabs"
> 3) I got the slow script warning as Firefox tried to close all my tabs, and
> I chose to stop the script.
Unfortunately, I couldn't make the slow script warning show up and also couldn't reproduce the initial problem. Tested on Win 7, OS X 10.8.5, both on normal and e10s windows, nightly 34.0a1 (2014-08-01)
(before the fix)
QA Whiteboard: [qa+] → [qa-]
Flags: needinfo?(florin.mezei)
QA Contact: cornel.ionce → paul.silaghi
Reporter | ||
Comment 40•10 years ago
|
||
okay, im not sure if this belongs here again but, ive got this issue back with and Unresponsive Script
Script: chrome://browser/content/tabbrowser.xml:2061
Reporter | ||
Comment 41•10 years ago
|
||
Firefox 35.0a1 (2014-09-22), Fedora 20
Comment 42•10 years ago
|
||
Hrm. bull500, can you please repeat the steps in comment 7 and show me what is at line 2061 in tabbrowser.xml in your build?
Flags: needinfo?(bullionareboy)
Reporter | ||
Comment 43•10 years ago
|
||
Im on the 35.0a1 (2014-09-29) version, auto-updated. Don't know if things changed.
2049-> if (aCloseWindow) {
this._windowIsClosing = true;
while (this._removingTabs.length)
this._endRemoveTab(this._removingTabs[0]);
} else if (!this._windowIsClosing) {
if (aNewTab)
focusAndSelectUrlBar();
// workaround for bug 345399
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
}
2061-> // We're going to remove the tab and the browser now.
// Clean up mTabFilters and mTabListeners now rather than in
// _beginRemoveTab, so that their size is always in sync with the
// number of tabs and browsers (the xbl destructor depends on this).
this.mTabFilters.splice(aTab._tPos, 1);
this.mTabListeners.splice(aTab._tPos, 1);
2068-> var browser = this.getBrowserForTab(aTab);
Flags: needinfo?(bullionareboy)
Comment 44•10 years ago
|
||
Hm, yes, it looks like tabbrowser.xml got replaced. If and when you see the message again, can you please repeat the steps with the same build?
Reporter | ||
Comment 45•10 years ago
|
||
Sorry it didnt strike me that time to do the same steps again.
Will report with data incase this happens again. :)
Reporter | ||
Comment 46•10 years ago
|
||
REPRODUCED - Slow Script - chrome://browser/content/tabbrowser.xml:2029
2025 <method name="_endRemoveTab">
<parameter name="aTab"/>
<body>
<![CDATA[
2029 if (!aTab || !aTab._endRemoveArgs)
return;
var [aCloseWindow, aNewTab] = aTab._endRemoveArgs;
aTab._endRemoveArgs = null;
if (this._windowIsClosing) {
aCloseWindow = false;
aNewTab = false;
}
this._lastRelatedTab = null;
// update the UI early for responsiveness
aTab.collapsed = true;
this.tabContainer._fillTrailingGap();
2045 this._blurTab(aTab);
This is causing tabs to get stuck in between while moving, and slightly non responsive when closing the tab. After hitting debug script, tabs dont move at all
Reporter | ||
Comment 47•10 years ago
|
||
35.0a1 (2014-10-04) - forgot to mention
Comment 48•10 years ago
|
||
I've opened a new bug - bug 1078280.
You need to log in
before you can comment on or make changes to this bug.
Description
•