Closed Bug 416622 Opened 16 years ago Closed 16 years ago

docshell navigation tests intermittently failing with NS_ERROR_XPC_BAD_OP_ON_WN_PROTO


(Core :: General, defect, P1)






(Reporter: philor, Assigned: abarth-mozilla)




(Whiteboard: required for 1.8branch if 408052 is taken)


(1 file)

Near as I can tell (by only looking at the likely-seeming failed test runs, not every single failure), the tests from bug 408052 ran just fine from when they landed 2008-01-27 until the afternoon of 2008-02-05, and since then have been intermittently failing with

*** 11630 ERROR FAIL | Error thrown during test: uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object"  nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"  location: "JS frame :: http://localhost:8888/tests/docshell/test/navigation/NavigationUtils.js :: searchForFinishedFrames :: line 207"  data: no] | got 0, expected 1 | /tests/docshell/test/navigation/test_reserved.html

around once or twice a day, in at least test_reserved.html and test_sibling-off-domain.html, on qm-centos5-01 and qm-xserve01.

No, I don't have answers to any of the reasonable questions like

* did they just happen not to fail until then ("freeze" cutting down the number of runs, lots of other failures wrecking things first)?
* did something unobvious land in the couple of days before that, that affects them?
* is something different in the test harness, or timeouts, or something, on Mac and Linux, that explains why it seems not to happen on Windows?
* is it just delayed-onset bug 373261?

(Not to mention "is it a Testing bug, an XPConnect bug, a Docshell bug, or a bug in the tests themselves?" so I'm choosing General.)
Things that make tinderbox randomly go orange are very annoying for people. :(
Flags: blocking1.9?
Priority: -- → P1
This does seem related to Bug 373261.  I'll try to reproduce the failure locally and see if we can work around it to make the test less distracting.
Looks like this is race condition.  I can get the error to trigger consistently if I set the polling frequency to 5 ms.  What seems to be happening is that the test is trying to access a partially constructed window and failing.  I can't get the condition to reproduce without UniversalXPConnect privileges, so this looks like a bug in the test.

After this patch, we ignore the error and recover gracefully when we access the window on the next call to poll().
Attachment #302681 - Flags: review?(philringnalda)
Comment on attachment 302681 [details] [diff] [review]
Tolerate partially-constructed windows

Seems reasonable enough to me, but since I'm not a docshell peer and not slow (or is it fast?) enough to reproduce it, my review would be pretty worthless.
Attachment #302681 - Flags: review?(philringnalda) → review?(bzbarsky)
I think it'd make more sense to make the xpc_Wait... calls at the very beginning of the onload handlers, rather than at the end, just in case something in onload triggers a sync finish....
Ok.  That's fine with me.  I don't really understand why that would make much of a difference because the only thing xpcWaitForFinishedFrames does synchronously is call setInterval.

Unfortunately, I can't build Mozilla at home, so we'd have to wait until tomorrow for me to make that change.  You're welcome to make that change yourself if you'd like it done sooner.
Oh, xpcWaitForFinishedFrames doesn't do anything synchronously?  In that case this is good to go as-is.
Attachment #302681 - Flags: review?(bzbarsky) → review+
Assignee: nobody → hk9565
Checking in docshell/test/navigation/NavigationUtils.js;
/cvsroot/mozilla/docshell/test/navigation/NavigationUtils.js,v  <--  NavigationUtils.js
new revision: 1.3; previous revision: 1.2
Checking in docshell/test/navigation/test_bug13871.html;
/cvsroot/mozilla/docshell/test/navigation/test_bug13871.html,v  <--  test_bug13871.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_bug278916.html;
/cvsroot/mozilla/docshell/test/navigation/test_bug278916.html,v  <--  test_bug278916.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_bug279495.html;
/cvsroot/mozilla/docshell/test/navigation/test_bug279495.html,v  <--  test_bug279495.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_child.html;
/cvsroot/mozilla/docshell/test/navigation/test_child.html,v  <--  test_child.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_grandchild.html;
/cvsroot/mozilla/docshell/test/navigation/test_grandchild.html,v  <--  test_grandchild.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_not-opener.html;
/cvsroot/mozilla/docshell/test/navigation/test_not-opener.html,v  <--  test_not-opener.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_opener.html;
/cvsroot/mozilla/docshell/test/navigation/test_opener.html,v  <--  test_opener.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_sibling-matching-parent.html;
/cvsroot/mozilla/docshell/test/navigation/test_sibling-matching-parent.html,v  <--  test_sibling-matching-parent.html
new revision: 1.2; previous revision: 1.1
Checking in docshell/test/navigation/test_sibling-off-domain.html;
/cvsroot/mozilla/docshell/test/navigation/test_sibling-off-domain.html,v  <--  test_sibling-off-domain.html
new revision: 1.2; previous revision: 1.1
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
Needed on 1.8 branch if we take bug 408052
Flags: wanted1.8.1.x+
Flags: blocking1.8.1.14?
Flags: blocking1.8.1.15?
Whiteboard: required for 1.8branch if 408052 is taken
This (or something like it) appears to still be happening:
OS X 10.5.2 mozilla-central opt test mochitests-2/5 on 2010/01/07 12:52:14

s: bm-xserve16
535 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/src/threads/test/test_scopeOnerror.html | undefined - got "uncaught exception: [Exception... \"Illegal operation on WrappedNative prototype object\"  nsresult: \"0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)\"  location: \"JS frame :: http://localhost:8888/tests/dom/src/threads/test/scopeOnerror_worker.js :: <TOP_LEVEL> :: line 1\"  data: no]", expected "uncaught exception: This exception should make it to onerror"
536 ERROR TEST-UNEXPECTED-FAIL | /tests/dom/src/threads/test/test_scopeOnerror.html | Test timed out.
You need to log in before you can comment on or make changes to this bug.