Closed Bug 850676 Opened 11 years ago Closed 11 years ago

test_mixed_content_blocker_bug803225.html is causing docshell/test/navigation tests to fail

Categories

(Core Graveyard :: Security: UI, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(firefox21 fixed)

RESOLVED FIXED
mozilla22
Tracking Status
firefox21 --- fixed

People

(Reporter: jmaher, Assigned: mrbkap)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

While working on rearranging some test directories, I found that docshell/test/navigation/test_bug13871.html and test_not_opener.html would fail miserably:

05:53:57     INFO -  237475 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237476 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237477 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237478 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237479 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237480 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:57     INFO -  237481 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237482 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:57     INFO -  237483 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237484 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:57     INFO -  237485 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237486 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237487 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237488 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | uncaught exception - TypeError: can't access dead object at :0
05:53:57     INFO -  237489 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237490 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:57     INFO -  237491 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237492 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:57     INFO -  237493 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237494 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:57     INFO -  237495 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:57     INFO -  237496 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:53:58     INFO -  237502 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | [SimpleTest.finish()] this test already called finish!
05:53:58     INFO -  237503 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_bug13871.html | called finish() multiple times
05:54:07     INFO -  237554 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237555 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237556 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237557 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237558 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237559 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:07     INFO -  237560 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237561 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:07     INFO -  237562 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237563 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:07     INFO -  237564 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237565 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237566 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237567 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | uncaught exception - TypeError: can't access dead object at :0
05:54:07     INFO -  237568 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237569 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:07     INFO -  237570 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237571 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:07     INFO -  237572 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237573 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:07     INFO -  237574 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:07     INFO -  237575 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times
05:54:08     INFO -  237580 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | [SimpleTest.finish()] this test already called finish!
05:54:08     INFO -  237581 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/mochitest/navigation/test_not-opener.html | called finish() multiple times

After tracking this down, I found that the problem is in test_mixed_content_blocker_bug803225.html, specifically the mailto part of the test.  

For some reason the mailto test in here is causing future tests to fail!  If we can't fix this asap, we should remove the mailto part of the test until we can fix it and ensure that it doesn't cause other tests to fail/pass unexpectedly.
Attached patch remove the mailto test (1.0) (obsolete) — Splinter Review
here is a patch if we deem it ok to disable this
Version: 18 Branch → Trunk
Thank you for figuring this out. I spent a day miserably trying to debug the failures.
I just narrowed it down, maybe there is something with the way we use the observer and mailto stuff, or there is a bug in the product when it comes to mailto and app handlers.
Comment on attachment 724428 [details] [diff] [review]
remove the mailto test (1.0)

I need to resolve this bug before other patches can work, lets disable this for now and when somebody has the time to fix it properly we can land the fix to the mailto/test code.
Attachment #724428 - Flags: review?(ted)
I think we should get signoff from the author of the test (or one of the reviewers) before blindly disabling this.
Flags: needinfo?(tanvi)
The mailto: test is to make sure nsMixedContentBlocker isn't blocking the mailto protocol - http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsMixedContentBlocker.cpp#267.  A mailto tab is opened, a post message is sent to the opener and the tab is closed - https://mxr.mozilla.org/mozilla-central/source/content/base/test/test_mixed_content_blocker_bug803225.html?force=1#130.

What is the issue with this test?  Is there a problem with the implementation?  Why does rearranging test directories make it fail?  Is the underlying issue in the test or our mailto protocol code?
Flags: needinfo?(tanvi)
the issue with the mailto portion of this test is that when it runs it causes docshell tests to fail.  I have no idea why this happens, even if I don't move content/base, but move docshell tests around I get a failure which points back to the mailto portion of this test.

I am not am expert in the mailto protocol or what the test is doing, which is why I was hoping the original test author/reviewer could shed some light and a patch to fix this.  

The most concerning thing is that this specific part of the test causes side effects in other test cases which if I were a sheriff I would disable this test case immediately.
Attached patch Proposed fixSplinter Review
Hey Joel, I hope you don't mind, but I looked into this and found that the reason for the failures is that the test registers an observer (in content) for "content-document-global-created" and never unregisters it. Then, we GC, find that the only reference to the observer is from chrome, and sever chrome's link to it (in order to free the window). This causes tons of "can't access dead object" errors, which end up causing the docshell tests to barf.

I tried tracking down where in the docshell tests the exception causes problems, but failed and decided that wasn't important.
Assignee: nobody → mrbkap
Attachment #724428 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #724428 - Flags: review?(ted)
Attachment #725676 - Flags: review?(tanvi)
Comment on attachment 725676 [details] [diff] [review]
Proposed fix

Thanks for catching this Blake!  Patch looks good to me.
Attachment #725676 - Flags: review?(tanvi) → review+
https://hg.mozilla.org/mozilla-central/rev/4a21247a08eb
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Can this test fix also be pushed to mozilla-beta? As the test is failing on comm-beta/mozilla-beta SeaMonkey testboxen. Although the Firefox mozilla-beta testboxen don't seem to fail (why?).
Comment on attachment 725676 [details] [diff] [review]
Proposed fix

Looking at the logs at http://tbpl-dev.callek.net/?tree=SeaMonkey-Beta I don't know how much this patch is going to help, but it's low-risk, applies cleanly, and I'm happy to check it in if release drivers are willing to take it.

[Approval Request Comment]
User impact if declined: None.
Testing completed (on m-c, etc.): The patch has been on m-c for a month.
Risk to taking this patch (and alternatives if risky): The patch has zero risk for users, it only changes a test to clean up after itself.
Attachment #725676 - Flags: approval-mozilla-beta?
Attachment #725676 - Flags: approval-mozilla-aurora?
Yeah, I'm currently working on getting this green again (but yeah, there are worse problems than this test bug :)
Comment on attachment 725676 [details] [diff] [review]
Proposed fix

Test only fix - don't think this is needed on Beta, but we'll take it nonetheless given zero-risk.
Attachment #725676 - Flags: approval-mozilla-beta?
Attachment #725676 - Flags: approval-mozilla-beta+
Attachment #725676 - Flags: approval-mozilla-aurora?
Attachment #725676 - Flags: approval-mozilla-aurora+
Keywords: checkin-needed
Pushed to mozilla-beta: https://hg.mozilla.org/releases/mozilla-beta/rev/5f7ba4e3664f
Bug is already fixed on mozilla-aurora
Tagging [qa-] for verification since this poses zero risk to users.
Whiteboard: [qa-]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: