New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624185 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

DCHECK in appendError()

Project Member Reported by sande...@chromium.org, Jun 28 2016

Issue description

With current ToT, a decode error while seeking on YouTube results in a DCHECK:

[41680:1295:0628/162013:ERROR:render_media_log.cc(25)] MediaEvent: PIPELINE_ERROR pipeline: decode error
[41680:1295:0628/162013:FATAL:SourceBuffer.cpp(993)] Check failed: false. DOMExeption should not be thrown.
 
I think what's happening is that a real decode error is occurring in parallel with asynchronous append processing.
The underlying chunkdemuxer is likely reaching SHUTDOWN state (due to the real decode error and as part of PipelineImpl::OnError processing) just after appendBuffer()'s synchronous part happened, so the delayed chunkdemuxer append returns false. At this point, MediaSource is no longer open, so endOfStreamInternal() throws exception, but there's an ASSERT_NO_EXCEPTION on that callstack from SourceBuffer::appendError(). So debug builds DCHECK at that point (with typo in the err message).

I wonder if the MSE spec wording allows for this exception to be issued in this path. I'll investigate there next.
Status: Assigned (was: Available)
Ping for update
Cc: xhw...@chromium.org kqyang@chromium.org
Labels: -Pri-3 M-61 Pri-2
Status: Started (was: Assigned)
I have a better repro today, and a better understanding.

Using b/62450277 (step 1 from comment #23, URL from comment #28, results in comment #31), I found debug build fails the ASSERT_NO_EXCEPTION from the SourceBuffer::appendError method's call to MediaSource::endOfStream, because MediaSource::endOfStreamInternal throws exception if open or updating -- before "running the end of stream algorithm". I think the solution is to extract out the "run the end of stream algorithm" subset of steps to allow appendError() to call them directly.
Cc: chcunningham@chromium.org
To clarify #4 a little further, I checked locally with some additional logging on a repro, and found that there's no guarantee that no *other* sourcebuffer is currently 'updating' when this sourcebuffer runs appendError(), hence MediaSource::IsUpdating() can be true, and the old code incorrectly could through a DOMException on appendError (which violates spec, and in debug mode violates ASSERT_NO_EXCEPTION at the call point). I'll have a fix out shortly for review.
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17f65f892acfa4948c130f988747d6f7811372db

commit 17f65f892acfa4948c130f988747d6f7811372db
Author: Matt Wolenetz <wolenetz@chromium.org>
Date: Thu Jun 29 00:12:50 2017

MSE: Don't throw exception on SourceBuffer::appendError()

appendError()'s last step is to run the end of stream algorithm,
according to spec. However, the code was structured such that it would
call the full MediaSource.endOfStream() method. That method has some
extra checks which can sometimes fail (and cause exception) in this
appendError() path. This change refactors to to expose publicly a
MediaSource method EndOfStreamAlgorithm, which
SourceBuffer::AppendError() now uses.

BUG= 624185 

Change-Id: Ic8d2a59906b6403d74a8a9c65a3a428258f9b4e3
Reviewed-on: https://chromium-review.googlesource.com/552824
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483210}
[modify] https://crrev.com/17f65f892acfa4948c130f988747d6f7811372db/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
[modify] https://crrev.com/17f65f892acfa4948c130f988747d6f7811372db/third_party/WebKit/Source/modules/mediasource/MediaSource.h
[modify] https://crrev.com/17f65f892acfa4948c130f988747d6f7811372db/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp

Status: Fixed (was: Started)

Sign in to add a comment