Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Issue 23691033: Fix threading races on WebAudioSourceProviderImpl::provideInput (Closed)

Created:
7 years, 3 months ago by haraken
Modified:
7 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Fix threading races on WebAudioSourceProviderImpl::provideInput According to the crash report (https://cluster-fuzz.appspot.com/testcase?key=4697390229487616), there is a threading race. Specifically, WebAudioSourceProviderImpl can be destructed by the main thread while WebAudioSourceProviderImpl::Stop() is being called by the audio thread. The core problem is that we're not calling WebAudioSourceProviderImpl::setClient(NULL) when HTMLMediaElement clears the audio source provider. BUG=284786 No tests because the crash depends on threading races and thus not reproducible.

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 1

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -0 lines) Patch
M Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
haraken
dalecurtis, scherkus: Would you mind taking a look? This is for fixing a P1 bug.
7 years, 3 months ago (2013-09-04 01:41:11 UTC) #1
haraken
7 years, 3 months ago (2013-09-04 01:41:57 UTC) #2
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/23691033/diff/1/content/renderer/media/webaudiosourceprovider_impl.cc File content/renderer/media/webaudiosourceprovider_impl.cc (right): https://codereview.chromium.org/23691033/diff/1/content/renderer/media/webaudiosourceprovider_impl.cc#newcode104 content/renderer/media/webaudiosourceprovider_impl.cc:104: bus_wrapper_->Zero(); This looks wrong. If the trylock fails, then ...
7 years, 3 months ago (2013-09-04 17:09:35 UTC) #3
DaleCurtis
I don't think this fixes the issue, just a symptom of it. There will still ...
7 years, 3 months ago (2013-09-04 18:31:29 UTC) #4
DaleCurtis
Here's an instance of a similar issue crogers@ fixed previously: https://codereview.chromium.org/15077011
7 years, 3 months ago (2013-09-04 18:50:56 UTC) #5
haraken
On 2013/09/04 18:50:56, DaleCurtis wrote: > Here's an instance of a similar issue crogers@ fixed ...
7 years, 3 months ago (2013-09-04 20:11:14 UTC) #6
DaleCurtis
Can we require setClient(NULL) to be called before destruction?
7 years, 3 months ago (2013-09-04 20:16:26 UTC) #7
haraken
On 2013/09/04 20:16:26, DaleCurtis wrote: > Can we require setClient(NULL) to be called before destruction? ...
7 years, 3 months ago (2013-09-04 21:45:34 UTC) #8
DaleCurtis
This should work, but may be considered papering over the problem. Should HTMLMediaElement::clearMediaPlayer() instead call ...
7 years, 3 months ago (2013-09-04 21:53:39 UTC) #9
haraken
On 2013/09/04 21:53:39, DaleCurtis wrote: > This should work, but may be considered papering over ...
7 years, 3 months ago (2013-09-04 22:26:00 UTC) #10
DaleCurtis
lgtm % #if protections https://codereview.chromium.org/23691033/diff/16001/Source/core/html/HTMLMediaElement.cpp File Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/23691033/diff/16001/Source/core/html/HTMLMediaElement.cpp#newcode346 Source/core/html/HTMLMediaElement.cpp:346: if (audioSourceProvider()) Both of these ...
7 years, 3 months ago (2013-09-04 22:33:09 UTC) #11
DaleCurtis
Also description needs an update.
7 years, 3 months ago (2013-09-04 22:33:35 UTC) #12
haraken
On 2013/09/04 22:33:35, DaleCurtis wrote: > Also description needs an update. Done. Thanks for all ...
7 years, 3 months ago (2013-09-04 22:38:32 UTC) #13
Ken Russell (switch to Gerrit)
LGTM
7 years, 3 months ago (2013-09-04 22:43:36 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/23691033/20001
7 years, 3 months ago (2013-09-04 22:44:29 UTC) #15
commit-bot: I haz the power
Failed to apply patch for Source/core/html/HTMLMediaElement.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; A Source ...
7 years, 3 months ago (2013-09-04 22:44:34 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/23691033/20001
7 years, 3 months ago (2013-09-04 22:47:36 UTC) #17
commit-bot: I haz the power
Failed to apply patch for Source/core/html/HTMLMediaElement.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; A Source ...
7 years, 3 months ago (2013-09-04 22:47:37 UTC) #18
DaleCurtis
Base URL still points to chromium (from the original patch set) rather than blink; I'm ...
7 years, 3 months ago (2013-09-04 22:50:30 UTC) #19
haraken
7 years, 3 months ago (2013-09-04 22:50:59 UTC) #20
On 2013/09/04 22:50:30, DaleCurtis wrote:
> Base URL still points to chromium (from the original patch set) rather than
> blink; I'm not sure if that's fixable without a new issue.

ok, will upload to a new issue.

Powered by Google App Engine
This is Rietveld 408576698