Random mochitest failure due to test_tree_view.xul

RESOLVED FIXED

Status

()

Core
XUL
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: roc, Assigned: roc)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Running mochitests under record-and-replay I got

162519 INFO Running /tests/toolkit/content/tests/widgets/test_videocontrols.html...
162520 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - netscape is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:50
162521 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162522 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162523 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162524 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162525 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162526 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162527 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
162528 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://localhost:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27

It looks like we're calling back into the tree-view JS after we've already moved on to the next test, which doesn't work and also somehow triggers an error report to the window for test_videocontrols.html. That's quite disturbing actually since test_tree_view's JS should not be running in the context of the other page...
Huh.  That onerror handler triggering there is indeed very weird.  We should probably have some checks about globals there or something to prevent that event from going to the new inner window due to the error on the old inner.
I'll try to get more details, but unfortunately the VMWare Visual Studio plugin crashed and somehow uninstalled itself... This is probably a good time to update to VMWare 7.0.1.
Unsurprisingly perhaps, this error occurs while we're painting the window.

I guess this is a situation where the old document is a zombie and the content viewer for the new document hasn't been shown yet because not enough of the new document has loaded.
Created attachment 432493 [details] [diff] [review]
fix

I think this will fix it. I hope it makes sense. It does mean that when the document enters the zombie state, trees will paint differently from before, so in theory we should invalidate any trees... but who cares, really.
Attachment #432493 - Flags: review?(bzbarsky)
Roc, bz is out for at least a week, could someone else (dbaron?) review here?
Attachment #432493 - Flags: review?(bzbarsky) → review?(Olli.Pettay)
Comment on attachment 432493 [details] [diff] [review]
fix

Could we bail out earlier when building display list? Probably when stepping into a new presshell?
We still want to paint these zombie documents. The new document isn't ready to paint yet.
So is the problem that error event from previous page is fired in the next page?
What about preventing error event in this case.
I wonder if the problem happens because of the async error event.

ScriptErrorEvent::Run could check that the current inner window is the same as
what it was when creating the object.
That is a problem, yes.

However, I don't think we should be calling into script that can't possibly run correctly.
I don't think the problem is because of the async error event. By the time we run the old script, the current inner window is already the new window.
I don't have a copy of the stack, and I think I deleted the VM recording, but it was very simple. It's a regular asynchronous paint, which goes into nsTreeBodyFrame::PaintColumn, which calls mView->GetColumnProperties, which runs page script, which raises an error because all the properties of its global object are gone. I'm not sure how that error ends up firing on the window of the new doc, though.
Attachment #432493 - Flags: review?(Olli.Pettay) → review+
Whiteboard: [needs landing]
http://hg.mozilla.org/mozilla-central/rev/6a398023b956
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
I think I saw another instance of this on try server
http://tinderbox.mozilla.org/showlog.cgi?log=MozillaTry/1277260471.1277261468.18111.gz

17564 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_videocontrols.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - treeData is not defined at http://mochi.test:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul:27
JavaScript error: http://mochi.test:8888/tests/toolkit/content/tests/widgets/test_tree_view.xul, line 27: treeData is not defined

and a bunch of

###!!! ASSERTION: XPConnect is being called on a scope without a 'Components' property!: 'Error', file /builds/slave/tryserver-macosx-debug/build/js/src/xpconnect/src/xpcwrappednativescope.cpp, line 784
You need to log in before you can comment on or make changes to this bug.