Closed Bug 783273 Opened 12 years ago Closed 12 years ago

Intermittent browser_350525.js, browser_bug734076.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMXULDocument.popupNode] at chrome://browser/content/places/controller.js:1637

Categories

(Firefox :: Bookmarks & History, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 18

People

(Reporter: emorley, Assigned: dao)

References

Details

(Keywords: intermittent-failure, regression)

Attachments

(1 file)

Rev4 MacOSX Lion 10.7 mozilla-inbound opt test mochitest-other on 2012-08-15 21:34:22 PDT for push 418b5cbc7cd9

slave: talos-r4-lion-018

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

{
TEST-START | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | set a window value
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | stored window value matches original
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | delete the window value
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | window value was deleted
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | delete non-existent window value
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | store a tab value
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | stored tab value match original
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | delete the tab value
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | tab value was deleted
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | delete non-existent tab value
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | getClosedTabCount returns zero or at most max_tabs_undo
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | after closing a tab, getClosedTabCount has been incremented
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | undoCloseTab doesn't throw
TEST-PASS | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | correct tab was reopened
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | an unexpected uncaught JS exception reported through window.onerror - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMXULDocument.popupNode] at chrome://browser/content/places/controller.js:1637
Stack trace:
    JS frame :: chrome://mochikit/content/tests/SimpleTest/SimpleTest.js :: simpletestOnerror :: line 994
    native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0

TEST-INFO | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | Console message: [JavaScript Error: "NS_ERROR_FAILURE: Failure arg 0 [nsIDOMXULDocument.popupNode]" {file: "chrome://browser/content/places/controller.js" line: 1637}]
INFO TEST-END | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_350525.js | finished in 672ms
}
https://tbpl.mozilla.org/php/getParsedLog.php?id=14530170&tree=Mozilla-Inbound
Summary: Intermittent browser_350525.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMXULDocument.popupNode] at chrome://browser/content/places/controller.js:1637 → Intermittent browser_350525.js, browser_bug734076.js | uncaught JS exception - NS_ERROR_FAILURE: Failure arg 0 [nsIDOMXULDocument.popupNode] at chrome://browser/content/places/controller.js:1637
cc'ing mak and tim - recent orange involving both Places and Session Restore?
Component: Session Restore → Bookmarks & History
Attached patch patchSplinter Review
It seems strange to me that a script keeps running while its own host document isn't accessible anymore. Maybe controller.js being loaded from an overlay plays a role here...
Assignee: nobody → dao
Status: NEW → ASSIGNED
Attachment #666927 - Flags: review?(mak77)
Blocks: hueyfix
Keywords: regression
You should be able to use Components.Utils.isDeadWrapper (introduced in bug 773980) instead of trying to get the value and catching the exception.
(In reply to Andrew McCreight [:mccr8] from comment #67)
> You should be able to use Components.Utils.isDeadWrapper (introduced in bug
> 773980) instead of trying to get the value and catching the exception.

Thanks, I guess I'll try that. Though, do you know why we get an unhelpfully unspecific NS_ERROR_FAILURE rather than "can't access dead object"?
(In reply to Dão Gottwald [:dao] from comment #68)
> Thanks, I guess I'll try that. Though, do you know why we get an unhelpfully
> unspecific NS_ERROR_FAILURE rather than "can't access dead object"?

I have no idea. It does kind of sound like it hits the dead object exception in some kind of indirect way, then the exception bubbles out in C++ code, which turns it into a meaningless exception. Maybe Kyle has some idea...
Will Components.utils.isDeadWrapper work regardless?
Comment on attachment 666927 [details] [diff] [review]
patch

Review of attachment 666927 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/places/content/controller.js
@@ +1633,5 @@
>  function doGetPlacesControllerForCommand(aCommand)
>  {
>    // A context menu may be built for non-focusable views.  Thus, we first try
>    // to look for a view associated with document.popupNode
> +  let popupNode; 

trailing space

@@ +1638,5 @@
> +  try {
> +    popupNode = document.popupNode;
> +  } catch (e) {
> +    // The document went away.
> +    return null;

I'm fine with a workaround, though may you please file a followup bug to try to figure out why this happens and annotate the bug number in the comment here?
Attachment #666927 - Flags: review?(mak77) → review+
I'm not really sure. Probably not, I guess? Maybe there's some other kind of weird wrapping going on or something. If the outermost wrapper or whatever isn't a Dead Object Proxy (which not getting the useful error message suggests to me), then I suppose isDeadWrapper probably won't work. Maybe you should just stick with what you have.
Depends on: 797307
https://hg.mozilla.org/mozilla-central/rev/d7b6af267d42
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 18
Whiteboard: [orange]
Comment on attachment 666927 [details] [diff] [review]
patch

>   // A context menu may be built for non-focusable views.  Thus, we first try
>   // to look for a view associated with document.popupNode
>-  let popupNode = document.popupNode;
>+  let popupNode; 
>+  try {
>+    popupNode = document.popupNode;
>+  } catch (e) {
>+    // The document went away.

The document-went-away case can by caught by checking |window.closed. That wouldn't hide any potential exceptions for other cases we don't know of.

At the very least, the exception should be reported to the console.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: