Closed Bug 780594 Opened 12 years ago Closed 12 years ago

Intermittent browser_bug491431.js browser_privatebrowsing_windowtitle.js browser_bug565575.js browser_privatebrowsing_cookieacceptdialog.js browser_homeDrop.js browser_bug477014.js | NS_ERROR_FAILURE: Failure at chrome://browser/content/browser.js:6369

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 18
Tracking Status
firefox17 --- affected

People

(Reporter: emorley, Assigned: Gavin)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

Rev3 Fedora 12 mozilla-inbound opt test mochitest-other on 2012-08-05 06:09:26 PDT for push b5b5fb7f05f2

slave: talos-r3-fed-025

https://tbpl.mozilla.org/php/getParsedLog.php?id=14143102&tree=Mozilla-Inbound

{
TEST-START | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js
TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js | This was a normal tab close
TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js | Console message: [JavaScript Error: "The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature." {file: "data:text/plain,test%20bug%20491431%20Page" line: 0}]
TEST-PASS | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js | This was a tab closed by moving
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js | an unexpected uncaught JS exception reported through window.onerror - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget] at chrome://browser/content/browser.js:6341
Stack trace:
    JS frame :: chrome://mochikit/content/tests/SimpleTest/SimpleTest.js :: simpletestOnerror :: line 994
    native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
    native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0

TEST-INFO | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js | Console message: [JavaScript Error: "NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget]" {file: "chrome://browser/content/browser.js" line: 6341}]
INFO TEST-END | chrome://mochitests/content/browser/browser/base/content/test/browser_bug491431.js | finished in 542ms
}
pageShowEventHandlers is called off of a timeout from a pageshow event handler. By the time that timeout runs, the document in question may have been closed, which might happen during browser_bug491431.js (which very quickly opens/closes a new tab). I imagine accessing event.originalTarget in that case is prevented by bug 695480.

I'm not sure what the best way to fix this is. The simplest solution may be to refactor browser_bugbug491431.js to only close the tab once its document's been loaded, or something, which might avoid this edge case entirely.
Thank you for taking an initial look at this so speedily :-)
Summary: Intermittent browser_bug491431.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget] at chrome://browser/content/browser.js:6341 → Intermittent browser_bug491431.js or browser_privatebrowsing_windowtitle.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget] at chrome://browser/content/browser.js:6341
Summary: Intermittent browser_bug491431.js or browser_privatebrowsing_windowtitle.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget] at chrome://browser/content/browser.js:6341 → Intermittent browser_bug491431.js or browser_privatebrowsing_windowtitle.js or browser_bug565575.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget] at chrome://browser/content/browser.js:6341
Depends on: 782375
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #1)
> pageShowEventHandlers is called off of a timeout from a pageshow event
> handler. By the time that timeout runs, the document in question may have
> been closed, which might happen during browser_bug491431.js (which very
> quickly opens/closes a new tab). I imagine accessing event.originalTarget in
> that case is prevented by bug 695480.
> 
> I'm not sure what the best way to fix this is. The simplest solution may be
> to refactor browser_bugbug491431.js to only close the tab once its
> document's been loaded, or something, which might avoid this edge case
> entirely.

We could just catch the exception. It's an edge case, but it's not necessarily limited to tests.
Component: Tabbed Browser → General
Yeah, let's just do that.
Assignee: nobody → dao
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: x86 → All
I'm unable to reproduce this. I increased the timeout up to 10 seconds and closed the tab before it fired, but this didn't cause any trouble for pageShowEventHandlers... event.target kept pointing to the document.
Assignee: dao → nobody
Status: ASSIGNED → NEW
Summary: Intermittent browser_bug491431.js or browser_privatebrowsing_windowtitle.js or browser_bug565575.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMPageTransitionEvent.originalTarget] at chrome://browser/content/browser.js:6341 → Intermittent browser_bug491431.js or browser_privatebrowsing_windowtitle.js or browser_bug565575.js or browser_privatebrowsing_cookieacceptdialog.js | uncaught JS exception - NS_ERROR_FAILURE: Failure at chrome://browser/content/browser.js:6369
Blocks: 782673
Depends on: 784792
Attached patch patch — — Splinter Review
See bug 784792 comment 12 and bug 786940 comment 3.
Attachment #660352 - Flags: review?(dao)
Attachment #660352 - Flags: review?(dao) → review+
Blocks: 786940
Assignee: nobody → gavin.sharp
Target Milestone: --- → Firefox 18
https://hg.mozilla.org/mozilla-central/rev/cb4045ed8776
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 742139
Could we take the patch to branches too, please.
It might fix Bug 786940.
Summary: Intermittent browser_bug491431.js or browser_privatebrowsing_windowtitle.js or browser_bug565575.js or browser_privatebrowsing_cookieacceptdialog.js | uncaught JS exception - NS_ERROR_FAILURE: Failure at chrome://browser/content/browser.js:6369 → Intermittent browser_bug491431.js browser_privatebrowsing_windowtitle.js browser_bug565575.js browser_privatebrowsing_cookieacceptdialog.js browser_homeDrop.js browser_bug477014.js | NS_ERROR_FAILURE: Failure at chrome://browser/content/browser.js:6369
(In reply to Ed Morley [:edmorley UTC+1] from comment #193)
> https://hg.mozilla.org/releases/mozilla-beta/rev/100d3fb0ca0d

This isn't test-only. Please get this approved or backed out.
(In reply to DĂŁo Gottwald [:dao] from comment #194)
> (In reply to Ed Morley [:edmorley UTC+1] from comment #193)
> > https://hg.mozilla.org/releases/mozilla-beta/rev/100d3fb0ca0d
> 
> This isn't test-only. Please get this approved or backed out.

Bah sorry I went through the patch queue vetting them all, missed that.
Whiteboard: [orange]
Depends on: 847070
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: