Closed Bug 528582 Opened 15 years ago Closed 14 years ago

Broken tabbrowser after undo close tab

Categories

(SeaMonkey :: Tabbed Browser, defect)

x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla, Assigned: neil)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file, 2 obsolete files)

I've found a race condition in the tabbrowser. If you close a website want to undo that too quickly after closing it, you get a new tab without content, that doesn't work anymore. One probably has to repeat the steps some times to see it.

Steps:

1. Load a big website like kicker.de
2. Close it with ctrl+w
3. Undo that with ctrl+shit+t

Execute steps 2 and 3 repeatedly and very fast.

First error in error console:

Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIWebNavigation.goBack]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://navigator/content/tabbrowser.xml :: restoreTab :: line 1358"  data: no]

Switching to the broken tab (5 times):

Error: listener is undefined
Source File: chrome://navigator/content/tabbrowser.xml
Line: 885

Wanting to close the broken tab:

Error: oldBrowser is undefined
Source File: chrome://navigator/content/tabbrowser.xml
Line: 1408

I can only get rid of it, by closing the whole window.
It's ctrl+shift+t of course *hide*

And I also get the following error after undo close tab, even if that works successful:

Error: this.browsers[i] is undefined
Source File: chrome://navigator/content/tabbrowser.xml
Line: 1025
Maybe the problem isn't what it seemed to be.

Easier steps to reproduce:

1. start SeaMonkey
2. open new tab
3. close that tab
4. try to undo it

At step 4 I get the error at restoreTab and the tab isn't opened:

Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIWebNavigation.goBack]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://navigator/content/tabbrowser.xml :: restoreTab :: line 1574"  data: no]

If I then open a new tab, that previous non-restored tab appears too but is non-functional.

Tested with Mozilla/5.0 (Windows NT 5.1; rv:2.0b6pre) Gecko/20100908 Firefox/4.0b6pre SeaMonkey/2.1b1pre, new profile and safe-mode.
This seems reproducible on clean profile.
Attached patch Quick fix (obsolete) — Splinter Review
This just stops you from undoing the close tab if it's not ready.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #478381 - Flags: review?(misak.bugzilla)
Attached patch Slow fix (obsolete) — Splinter Review
This might let you undo the close tab even though we're not ready.

But I haven't really tested it.
It seems both patches don't work. I was able to reproduce this bug with any of them applied.
Comment on attachment 478383 [details] [diff] [review]
Slow fix

>             // navigate back to the proper page from the light page
>-            b.webNavigation.goBack();
>+            if (b.webProgress.isLoadingDocument)
>+              b.stop();
>+            else
>+              b.webNavigation.goBack();
What about if you replace this with
b.stop();
b.webNavigation.gotoIndex(0);
Comment on attachment 478381 [details] [diff] [review]
Quick fix

(In reply to comment #7)
> What about if you replace this with
> b.stop();
> b.webNavigation.gotoIndex(0);

This fixes things.
Attachment #478381 - Flags: review?(misak.bugzilla) → review-
Attached patch Updated fixSplinter Review
Attachment #478381 - Attachment is obsolete: true
Attachment #478383 - Attachment is obsolete: true
Attachment #478589 - Flags: review?(misak.bugzilla)
Attachment #478589 - Flags: review?(misak.bugzilla) → review+
Pushed changeset 8a177d109616 to comm-central.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: