Closed Bug 556698 Opened 14 years ago Closed 14 years ago

Intermittent failure in test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined

Categories

(Core Graveyard :: Plug-ins, defect)

x86
All
defect
Not set
normal

Tracking

(blocking2.0 final+)

RESOLVED FIXED
mozilla2.0b7
Tracking Status
blocking2.0 --- final+

People

(Reporter: philor, Assigned: benjamin)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1270186227.1270186546.24020.gz
Linux mozilla-central opt test mochitests-5/5 on 2010/04/01 22:30:27
s: moz2-linux-slave25

311 INFO Running /tests/modules/plugin/test/test_twostreams.html...
312 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined at http://mochi.test:8888/tests/modules/plugin/test/test_twostreams.html:1
313 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined at http://mochi.test:8888/tests/modules/plugin/test/test_twostreams.html:1
NPP_NewStream
NPP_StreamAsFile, file=/tmp/plugtmp/plugin-loremipsum_nocache.txt
NPP_DestroyStream
NPP_NewStream
NPP_StreamAsFile, file=/tmp/plugtmp/plugin-loremipsum_nocache.txt
NPP_DestroyStream
314 INFO TEST-PASS | /tests/modules/plugin/test/test_twostreams.html | Frame contents should match
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1272622548.1272622994.15687.gz
Linux mozilla-central opt test mochitests-5/5 on 2010/04/30 03:15:48
s: moz2-linux-slave09
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1275096266.1275097495.4457.gz
Linux mozilla-central debug test mochitests-5/5 on 2010/05/28 18:24:26
s: moz2-linux-slave01

541 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined at http://mochi.test:8888/tests/modules/plugin/test/test_twostreams.html:1
542 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined at http://mochi.test:8888/tests/modules/plugin/test/test_twostreams.html:1
909 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_dynDelayedUnsecurePicture.html | FAILURE: src='http://...' changed to broken, expected broken got secure
910 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_dynDelayedUnsecurePicture.html | FAILURE: for 'broken' expected  flags [0,1,0], src='http://...' changed to broken
926 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_dynUnsecureBackground.html | FAILURE: document.body.background='http://...' changed to broken, expected broken got secure
927 ERROR TEST-UNEXPECTED-FAIL | /tests/security/ssl/mixedcontent/test_dynUnsecureBackground.html | FAILURE: for 'broken' expected  flags [0,1,0], document.body.background='http://...' changed to broken
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1275104060.1275104381.30984.gz
Linux mozilla-central opt test mochitest-other on 2010/05/28 20:34:20
s: mv-moz2-linux-ix-slave02
(In reply to comment #8)
> http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1275104060.1275104381.30984.gz
> Linux mozilla-central opt test mochitest-other on 2010/05/28 20:34:20
> s: mv-moz2-linux-ix-slave02

This is incorrect, not related to this bug.
Summary: Intermittent failure in test_twostreams.html | frameLoaded is not defined → Intermittent failure in test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - is is not defined
OS: Linux → All
Summary: Intermittent failure in test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - is is not defined → Intermittent failure in test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined
This bug was very intermittent until Saturday, and has since spiked to one of the most common oranges, which coincides with the landing of bug 513008.

Michal, did you check the plugin usage of cache entries to make sure that NP_ASFILE works correctly still?
Blocks: 513008
The relevant code is here:

http://mxr.mozilla.org/mozilla-central/source/modules/plugin/base/src/nsPluginStreamListenerPeer.cpp#1032

As far as I can tell, this code assumes that the cached file is fully written when OnStopRequest is called. Did you audit clients to see if other make the same assumption? I thought it was a fairly common assumption.
Assignee: nobody → michal.novotny
blocking2.0: --- → final+
(In reply to comment #56)
> This bug was very intermittent until Saturday, and has since spiked to one of
> the most common oranges, which coincides with the landing of bug 513008.
> 
> Michal, did you check the plugin usage of cache entries to make sure that
> NP_ASFILE works correctly still?

Hmm, that's strange. I'd guess that bug 513074 should cause this and not 513008 since it didn't change the writing to the cache. Anyway I'll have a look at it.
(In reply to comment #56)
> This bug was very intermittent until Saturday, and has since spiked to one of
> the most common oranges, which coincides with the landing of bug 513008.
> 
> Michal, did you check the plugin usage of cache entries to make sure that
> NP_ASFILE works correctly still?

As far as I can see NP_ASFILE works correctly.

Either cacheChannel->SetCacheAsFile(PR_TRUE) succeeds and then it is guaranteed that the file is written synchronously, or it fails and then nsPluginStreamListenerPeer writes data in its own temporary file. The latter is the case of test_twostreams.html.

Also the error "frameLoaded is not defined" couldn't be IMO caused by wrong NS_ASFILE handling.

I'm still trying to find out where is the problem, but I'm not able to reproduce it locally.
This seems to happen pretty frequently on Windows. Do you have access to a Windows machine with VMWare that can do record and replay? If not, maybe we can find a volunteer to record-and-replay debug this.
Unfortunately I don't have access to a windows machine.
I have this in a recording but I won't be able to look at it for quite a while. Anyone who needs pointers feel free to ping me.
Apparently backing out bug 513008 helped to get rid of this intermittent failure.  I believe that analyzing the replay log will also tell us or give us at least a clue to cause of bug 589296.
Reports in comments 232 to 238 are all from tracemonkey tree that had not been merged with mozilla-central containing the backout (http://hg.mozilla.org/mozilla-central/rev/a93c9118f16d).
Sorry, sometimes when I'm off in another tree I remember that an open bug isn't really open, but this time I forgot.
Finally I have a clue why the test fails. The onload function of the iframe is called before the main HTML document is completely loaded and the frameLoaded() function is undefined. Iframe's onload is blocked until every script in the main document is loaded but the linked css doesn't block it. I've created a simplified testcase to reproduce it:

http://michal.etc.cz/bug556698/test_iframe_onload_link.html
It takes 5 seconds to load the css file and the iframe's onload fails.

I'm not familiar with this code and don't know what the correct behavior should be.
If
1) loading of the linked css should also block the iframe's onload function
or
2) all javascript code from the main HTML should be fully parsed and known at this point since the linked css file can't contain any javascript.

Could anybody who knows the onload stuff look at this bug?
bz, can you help diagnose comment 241?
The testcase as written just has an inherent race.  We prse the <iframe> and start its about:blank load before we parse the <script>.  So anything that delays either parsing or execution of the script (server lag on the connection the main page is loading on, the script being blocked by the stylesheet, whatever) can cause the frame onload to fire before the script has run.

The right fix is to put the <script> before the <iframe> in the main document.

The script being blocked by the stylesheet is correct.

The iframe onload not waiting on the stylesheet is also correct, I think....  We could try to change that, but the waiting for stylesheets stuff is only needed for web compat, and this case hasn't been a compat issue.
Attached patch Reorder per bzSplinter Review
Assignee: michal.novotny → benjamin
Status: NEW → ASSIGNED
Keywords: checkin-needed
It looks like this landed:
http://hg.mozilla.org/mozilla-central/rev/3ec1eddb8474
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b7
Linux mozilla-1.9.2 test mochitests on 2010/11/18 19:11:06Linux mozilla-1.9.2 test mochitests on 2010/11/18 19:11:06
s: moz2-linux-slave21
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.6/1290136266.1290138509.31571.gz

107406 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined
107407 ERROR TEST-UNEXPECTED-FAIL | /tests/modules/plugin/test/test_twostreams.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - frameLoaded is not defined
115752 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_popup_attribute.xul | show popup with position
115769 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_popup_attribute.xul | open popup at screen
115783 ERROR TEST-UNEXPECTED-FAIL | /tests/toolkit/content/tests/widgets/test_popup_attribute.xul | open context popup at screen

Build Error Log

 Skipping 111565 Lines...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The most obvious reason for this has landed, you can file a new bug if necessary but please don't reopen this one.
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Whiteboard: [orange]
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: