Closed
Bug 1041362
Opened 10 years ago
Closed 10 years ago
Intermittent test_mediarecorder_record_no_timeslice.html | uncaught exception - InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable at http://mochi.test:8888/tests/content/media/test/test_mediarecorder_record_no_ti
Categories
(Core :: Audio/Video: Recording, defect)
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: RyanVM, Assigned: bechen)
References
Details
(Keywords: intermittent-failure)
Attachments
(1 file, 5 obsolete files)
4.40 KB,
patch
|
bechen
:
review+
|
Details | Diff | Splinter Review |
https://tbpl.mozilla.org/php/getParsedLog.php?id=44230148&tree=Mozilla-Inbound Android 2.3 Emulator mozilla-inbound opt test mochitest-5 on 2014-07-20 13:29:23 PDT for push 131e77486177 slave: tst-linux64-spot-316 14:26:47 INFO - 2687 INFO SimpleTest START 14:26:47 INFO - 2688 INFO TEST-START | /tests/content/media/test/test_mediarecorder_record_no_timeslice.html 14:26:47 INFO - 2689 INFO dumping last 2 message(s) 14:26:47 INFO - 2690 INFO if you need more context, please use SimpleTest.requestCompleteLog() in your test 14:26:47 INFO - 2691 INFO Started Sun Jul 20 2014 13:37:32 GMT-0700 (PDT) (1405888652.128s) | undefined 14:26:47 INFO - 2692 INFO TEST-PASS | /tests/content/media/test/test_mediarecorder_record_no_timeslice.html | [started detodos.opus-0] Length of array should match number of running tests 14:26:47 INFO - 2693 INFO TEST-UNEXPECTED-FAIL | /tests/content/media/test/test_mediarecorder_record_no_timeslice.html | uncaught exception - InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable at http://mochi.test:8888/tests/content/media/test/test_mediarecorder_record_no_timeslice.html:95 14:26:47 INFO - TEST-INFO | expected PASS
Comment 1•10 years ago
|
||
Looks like something wrong to the life cycle of |mediaRecorder|. Please have a check.
Assignee: nobody → bechen
Assignee | ||
Comment 2•10 years ago
|
||
Here is my guess: |element.oncanplaythrough| will start a Session that holds a reference to MR. Before the |element.oncanplaythrough| is called, the MR is destroyed because there is no Session inside. So I guess the MR is destroyed at the gap between |element.play()| to |element.oncanplaythrough|.
Comment 3•10 years ago
|
||
Indeed, it looks like the test case must be modified in a more robust way.
Assignee | ||
Comment 4•10 years ago
|
||
test_mediarecorder_reocrd_immediate_stop.html test_mediarecorder_record_session.html test_mediarecorder_record_timeslice.html These 3 testcases have the same problem.
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Assignee | ||
Comment 10•10 years ago
|
||
update status: The "uncaught exception - InvalidStateError" triggered by here. http://dxr.mozilla.org/mozilla-central/source/content/media/MediaRecorder.cpp?from=Mediarecorder.cpp&case=true#736
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Assignee | ||
Comment 13•10 years ago
|
||
(In reply to Benjamin Chen [:bechen] from comment #10) > update status: > The "uncaught exception - InvalidStateError" triggered by here. > > http://dxr.mozilla.org/mozilla-central/source/content/media/MediaRecorder. > cpp?from=Mediarecorder.cpp&case=true#736 // testcase: if (element.ended) { } else { mediaRecorder.start(); } /// The code snip in testcase shows the MediaElement is not ended, neither the MediaDecoder. Means that the MediaDecoder::PlaybackEnded function doesn't been invoked to finish/destroy the MediaStream. But in the MediaRecorder::Start() function, we return error because the MediaStream is finished/destroyed...
Comment 14•10 years ago
|
||
Before MediaDecoder::PlaybackEnded() [1] is dispatched, StopAudioThread() is called which will end the audio/video tracks [2]. So, there is a race between stream end media element end on the main thread. Therefore, it is possible to see stream end on the main thread while media element is not ended. [1] http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/MediaDecoderStateMachine.cpp#l2481 [2] http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/MediaDecoderStateMachine.cpp#l418
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment 18•10 years ago
|
||
(In reply to JW Wang [:jwwang] from comment #14) > Before MediaDecoder::PlaybackEnded() [1] is dispatched, StopAudioThread() is > called which will end the audio/video tracks [2]. So, there is a race > between stream end media element end on the main thread. Therefore, it is > possible to see stream end on the main thread while media element is not > ended. > > [1] > http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/ > MediaDecoderStateMachine.cpp#l2481 > [2] > http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/ > MediaDecoderStateMachine.cpp#l418 Correction: In the case of decoding to a stream, the state machine is not responsible for sending MediaDecoder::PlaybackEnded(). See [3]. [3] http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/MediaDecoderStateMachine.cpp#l2466
Assignee | ||
Comment 19•10 years ago
|
||
(In reply to JW Wang [:jwwang] from comment #18) > (In reply to JW Wang [:jwwang] from comment #14) > > Before MediaDecoder::PlaybackEnded() [1] is dispatched, StopAudioThread() is > > called which will end the audio/video tracks [2]. So, there is a race > > between stream end media element end on the main thread. Therefore, it is > > possible to see stream end on the main thread while media element is not > > ended. > > > > [1] > > http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/ > > MediaDecoderStateMachine.cpp#l2481 > > [2] > > http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/ > > MediaDecoderStateMachine.cpp#l418 > > Correction: > In the case of decoding to a stream, the state machine is not responsible > for sending MediaDecoder::PlaybackEnded(). See [3]. > > [3] > http://hg.mozilla.org/mozilla-central/file/5e704397529b/content/media/ > MediaDecoderStateMachine.cpp#l2466 Yeah, the MediaDecoder::PlaybackEnded() should come from : MediaDecoderStateMachine::SendStreamData => ... => => MediaStreamGraphImpl::UpdateCurrentTimeForStreams => MediaDecoder::DecodedStreamGraphListener::DoNotifyFinished()
Assignee | ||
Comment 20•10 years ago
|
||
So our conclusion is that because the "finish event" comes earlier than MediaDecoder::PlaybackEnded(), it is possible that the testcase check the "element.ended" returns false but the MediaStream had finished. I'll try to modify these testcases to not rely on the "element.ended".
Comment hidden (Legacy TBPL/Treeherder Robot) |
Assignee | ||
Comment 22•10 years ago
|
||
Assignee | ||
Comment 23•10 years ago
|
||
Comment hidden (Legacy TBPL/Treeherder Robot) |
Comment 25•10 years ago
|
||
Comment on attachment 8497396 [details] [diff] [review] bug-1041362.v01.patch Review of attachment 8497396 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/test/test_mediarecorder_record_immediate_stop.html @@ +107,5 @@ > 'Media recorder stream = element stream post recording'); > }; > > element.addEventListener('canplaythrough', canPlayThrough, false); > + mediaRecorder.start(); As my old memorize, this line would fail due to principle check fail... Does this behavior change?
Assignee | ||
Comment 26•10 years ago
|
||
(In reply to Randy Lin [:rlin] from comment #25) > Comment on attachment 8497396 [details] [diff] [review] > bug-1041362.v01.patch > > Review of attachment 8497396 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: content/media/test/test_mediarecorder_record_immediate_stop.html > @@ +107,5 @@ > > 'Media recorder stream = element stream post recording'); > > }; > > > > element.addEventListener('canplaythrough', canPlayThrough, false); > > + mediaRecorder.start(); > > As my old memorize, this line would fail due to principle check fail... > Does this behavior change? http://dxr.mozilla.org/mozilla-central/source/content/html/content/src/HTMLMediaElement.cpp#1851 The principle should be set in HTMLMediaElement::CaptureStreamInternal?
Assignee | ||
Comment 27•10 years ago
|
||
push to try: https://tbpl.mozilla.org/?tree=Try&rev=a186449fc559
Assignee | ||
Comment 28•10 years ago
|
||
(In reply to Randy Lin [:rlin] from comment #25) > Comment on attachment 8497396 [details] [diff] [review] > bug-1041362.v01.patch > > Review of attachment 8497396 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: content/media/test/test_mediarecorder_record_immediate_stop.html > @@ +107,5 @@ > > 'Media recorder stream = element stream post recording'); > > }; > > > > element.addEventListener('canplaythrough', canPlayThrough, false); > > + mediaRecorder.start(); > > As my old memorize, this line would fail due to principle check fail... > Does this behavior change? You are right, try server shows failures. The MediaElement doesn't have principle before we play it. Now I'm going to set "preload metadata" and start the MediaElement when metadata loaded.
Assignee | ||
Comment 29•10 years ago
|
||
Attachment #8497396 -
Attachment is obsolete: true
Attachment #8498703 -
Flags: feedback?(rlin)
Assignee | ||
Comment 30•10 years ago
|
||
tryserver: https://tbpl.mozilla.org/?tree=Try&rev=12e7b7f4ce5a
Attachment #8497397 -
Attachment is obsolete: true
Comment 31•10 years ago
|
||
Comment on attachment 8498703 [details] [diff] [review] bug-1041362.v02.patch LGTM
Attachment #8498703 -
Flags: feedback?(rlin) → feedback+
Comment 32•10 years ago
|
||
Comment on attachment 8498703 [details] [diff] [review] bug-1041362.v02.patch Review of attachment 8498703 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/test/test_mediarecorder_record_immediate_stop.html @@ +116,1 @@ > element.play(); You should play() in onloadedmetadata(), otherwise it is possible for the media stream to finish before recording starts.
Assignee | ||
Comment 33•10 years ago
|
||
Address comment 32. try server: https://tbpl.mozilla.org/?tree=Try&rev=2f8462d2cfbb
Attachment #8498703 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8498725 -
Flags: review?(roc)
Attachment #8498725 -
Flags: review?(roc) → review+
Assignee | ||
Comment 34•10 years ago
|
||
r=roc
Attachment #8498725 -
Attachment is obsolete: true
Attachment #8505367 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Attachment #8498704 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 35•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5ab9da505d34
Keywords: checkin-needed
Comment 36•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5ab9da505d34
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Reporter | ||
Updated•10 years ago
|
status-b2g-v2.1:
--- → affected
status-b2g-v2.2:
--- → fixed
status-firefox33:
--- → wontfix
status-firefox34:
--- → affected
status-firefox35:
--- → affected
status-firefox36:
--- → fixed
status-firefox-esr31:
--- → unaffected
Reporter | ||
Comment 37•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/fc77b3aa0211 https://hg.mozilla.org/releases/mozilla-beta/rev/c3fa7201e034
Reporter | ||
Comment 38•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/c3fa7201e034
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(bechen)
You need to log in
before you can comment on or make changes to this bug.
Description
•