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

Issue 823403 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Crash in track_audio_renderer.cc(75)] Check failed

Project Member Reported by rtoy@chromium.org, Mar 19 2018

Issue description

Forking this from https://bugs.chromium.org/p/chromium/issues/detail?id=766198#c100

I can reproduce the crash there using a debug build from ToT today.  Just keep pressing "Toggle Play", with or without a delay between presses.

The backtrace I get is:

[1:25:0319/112822.867115:WARNING:PushPullFIFO.cpp(189)] PushPullFIFO: underflow while pulling (underflowCount=1, availableFrames=0, requestedFrames=512, fifoLength=12288)
[1:24:0319/112852.875709:FATAL:track_audio_renderer.cc(75)] Check failed: audio_thread_checker_.CalledOnValidThread(). 
#0 0x7f922d7d247d base::debug::StackTrace::StackTrace()
#1 0x7f922d7d0a3c base::debug::StackTrace::StackTrace()
#2 0x7f922d8585da logging::LogMessage::~LogMessage()
#3 0x7f9228eeffe2 content::TrackAudioRenderer::OnData()
#4 0x7f9228ea5169 content::MediaStreamAudioDeliverer<>::OnData()
#5 0x7f9228ea3cb3 content::MediaStreamAudioTrack::OnData()
#6 0x7f9228ea0b11 content::MediaStreamAudioDeliverer<>::OnData()
#7 0x7f9228e9e63f content::MediaStreamAudioSource::DeliverDataToTracks()
#8 0x7f9228f1cb04 content::WebAudioMediaStreamSource::DeliverRebufferedAudio()
#9 0x7f922838545f _ZN4base8internal13FunctorTraitsIMN7content34PepperTCPServerSocketMessageFilterEFvRKN5ppapi4host19ReplyMessageContextEiEvE6InvokeIPS3_JS8_iEEEvSA_OT_DpOT0_
#10 0x7f92283853ba _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKMN7content34PepperTCPServerSocketMessageFilterEFvRKN5ppapi4host19ReplyMessageContextEiEJPS5_SA_iEEEvOT_DpOT0_
#11 0x7f9228f1ded5 _ZN4base8internal7InvokerINS0_9BindStateIMN7content25WebAudioMediaStreamSourceEFvRKN5media8AudioBusEiEJNS0_17UnretainedWrapperIS4_EEEEEFvS8_iEE7RunImplIRKSA_RKNSt3__15tupleIJSC_EEEJLm0EEEEvOT_OT0_NSJ_16integer_sequenceImJXspT1_EEEES8_Oi
#12 0x7f9228f1de53 _ZN4base8internal7InvokerINS0_9BindStateIMN7content25WebAudioMediaStreamSourceEFvRKN5media8AudioBusEiEJNS0_17UnretainedWrapperIS4_EEEEEFvS8_iEE3RunEPNS0_13BindStateBaseES8_i
#13 0x7f922380838e _ZNKR4base17RepeatingCallbackIFvRKN5media8AudioBusEiEE3RunES4_i
#14 0x7f92238081d6 media::AudioPushFifo::Push()
#15 0x7f9228f1dca6 content::WebAudioMediaStreamSource::ConsumeAudio()
#16 0x7f921667bf16 blink::ConsumerWrapper::ConsumeAudio()
#17 0x7f9216a3b343 blink::MediaStreamSource::ConsumeAudio()
#18 0x7f9215928c6e blink::MediaStreamAudioDestinationHandler::Process()
#19 0x7f92158b3f72 blink::AudioHandler::ProcessIfNecessary()
#20 0x7f9215919187 blink::DeferredTaskHandler::ProcessAutomaticPullNodes()
#21 0x7f92158ae13f blink::AudioDestinationHandler::Render()
#22 0x7f92165c7185 blink::AudioDestination::RequestRender()
#23 0x7f92165c68f9 blink::AudioDestination::Render()
#24 0x7f9228c986df content::RendererWebAudioDeviceImpl::Render()
#25 0x7f92238aba3f media::SilentSinkSuspender::Render()
#26 0x7f92238adddf _ZN4base8internal13FunctorTraitsIMN5media19SilentSinkSuspenderEFiNS_9TimeDeltaENS_9TimeTicksEiPNS2_8AudioBusEEvE6InvokeIPS3_JRKS4_RKS5_RKiRKDnEEEiS9_OT_DpOT0_
#27 0x7f92238adce1 _ZN4base8internal13FunctorTraitsINS0_18IgnoreResultHelperIMN5media19SilentSinkSuspenderEFiNS_9TimeDeltaENS_9TimeTicksEiPNS3_8AudioBusEEEEvE6InvokeIRKSB_JPS4_RKS5_RKS6_RKiRKDnEEEvOT_DpOT0_
#28 0x7f92238adc2d _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIRKNS0_18IgnoreResultHelperIMN5media19SilentSinkSuspenderEFiNS_9TimeDeltaENS_9TimeTicksEiPNS5_8AudioBusEEEEJPS6_RKS7_RKS8_RKiRKDnEEEvOT_DpOT0_
#29 0x7f92238adbad _ZN4base8internal7InvokerINS0_9BindStateINS0_18IgnoreResultHelperIMN5media19SilentSinkSuspenderEFiNS_9TimeDeltaENS_9TimeTicksEiPNS4_8AudioBusEEEEJNS0_17UnretainedWrapperIS5_EES6_S7_iDnEEEFvvEE7RunImplIRKSC_RKNSt3__15tupleIJSE_S6_S7_iDnEEEJLm0ELm1ELm2ELm3ELm4EEEEvOT_OT0_NSL_16integer_sequenceImJXspT1_EEEE
#30 0x7f92238ad9bc _ZN4base8internal7InvokerINS0_9BindStateINS0_18IgnoreResultHelperIMN5media19SilentSinkSuspenderEFiNS_9TimeDeltaENS_9TimeTicksEiPNS4_8AudioBusEEEEJNS0_17UnretainedWrapperIS5_EES6_S7_iDnEEEFvvEE3RunEPNS0_13BindStateBaseE
#31 0x7f92237338bd _ZNKR4base17RepeatingCallbackIFvvEE3RunEv
#32 0x7f9223838a1e media::FakeAudioWorker::Worker::DoRead()
#33 0x7f922374fd8f _ZN4base8internal13FunctorTraitsIMN5media20AudioInputControllerEFvvEvE6InvokeI13scoped_refptrIS3_EJEEEvS5_OT_DpOT0_
#34 0x7f922374fd04 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIMN5media20AudioInputControllerEFvvEJ13scoped_refptrIS5_EEEEvOT_DpOT0_
#35 0x7f922374fcb0 _ZN4base8internal7InvokerINS0_9BindStateIMN5media20AudioInputControllerEFvvEJ13scoped_refptrIS4_EEEEFvvEE7RunImplIS6_NSt3__15tupleIJS8_EEEJLm0EEEEvOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE
#36 0x7f92237592bc _ZN4base8internal7InvokerINS0_9BindStateIMN5media16AudioInputDeviceEFvvEJ13scoped_refptrIS4_EEEEFvvEE3RunEPNS0_13BindStateBaseE
#37 0x7f92237338bd _ZNKR4base17RepeatingCallbackIFvvEE3RunEv
#38 0x7f92237bcba5 _ZN4base8internal22CancelableCallbackImplINS_17RepeatingCallbackIFvvEEEE16ForwardRepeatingIJEEEvDpT_
#39 0x7f922373750f _ZN4base8internal13FunctorTraitsIMN5media12AliveCheckerEFvvEvE6InvokeINS_7WeakPtrIS3_EEJEEEvS5_OT_DpOT0_
#40 0x7f922373742a _ZN4base8internal12InvokeHelperILb1EvE8MakeItSoIMN5media12AliveCheckerEFvvENS_7WeakPtrIS5_EEJEEEvOT_OT0_DpOT1_
#41 0x7f92237373c0 _ZN4base8internal7InvokerINS0_9BindStateIMN5media12AliveCheckerEFvvEJNS_7WeakPtrIS4_EEEEEFvvEE7RunImplIS6_NSt3__15tupleIJS8_EEEJLm0EEEEvOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE
#42 0x7f92237bcc6c _ZN4base8internal7InvokerINS0_9BindStateIMNS0_22CancelableCallbackImplINS_17RepeatingCallbackIFvvEEEEEFvvEJNS_7WeakPtrIS7_EEEEES5_E3RunEPNS0_13BindStateBaseE
#43 0x7f9223838e7e _ZNO4base17RepeatingCallbackIFvvEE3RunEv
#44 0x7f92238388d3 media::FakeAudioWorker::Worker::DoStart()
#45 0x7f922374fd8f _ZN4base8internal13FunctorTraitsIMN5media20AudioInputControllerEFvvEvE6InvokeI13scoped_refptrIS3_EJEEEvS5_OT_DpOT0_
#46 0x7f922374fd04 _ZN4base8internal12InvokeHelperILb0EvE8MakeItSoIMN5media20AudioInputControllerEFvvEJ13scoped_refptrIS5_EEEEvOT_DpOT0_
#47 0x7f922374fcb0 _ZN4base8internal7InvokerINS0_9BindStateIMN5media20AudioInputControllerEFvvEJ13scoped_refptrIS4_EEEEFvvEE7RunImplIS6_NSt3__15tupleIJS8_EEEJLm0EEEEvOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE
#48 0x7f92237592bc _ZN4base8internal7InvokerINS0_9BindStateIMN5media16AudioInputDeviceEFvvEJ13scoped_refptrIS4_EEEEFvvEE3RunEPNS0_13BindStateBaseE
#49 0x7f922d7811ae _ZNO4base12OnceCallbackIFvvEE3RunEv
#50 0x7f922d7d635f base::debug::TaskAnnotator::RunTask()
#51 0x7f922d874b59 base::internal::IncomingTaskQueue::RunTask()
#52 0x7f922d87dd05 base::MessageLoop::RunTask()
#53 0x7f922d87df88 base::MessageLoop::DeferOrRunPendingTask()
#54 0x7f922d87e2b9 base::MessageLoop::DoWork()
#55 0x7f922d8802f7 base::MessagePumpDefault::Run()
#56 0x7f922d87d4cc base::MessageLoop::Run()
#57 0x7f922d9334ed base::RunLoop::Run()
#58 0x7f922d9f1438 base::Thread::Run()
#59 0x7f922d9f20a5 base::Thread::ThreadMain()
#60 0x7f922d9e812d base::(anonymous namespace)::ThreadFunc()
#61 0x7f922dd27494 start_thread


 

Comment 1 by olka@chromium.org, Mar 20 2018

Owner: grunell@chromium.org
Henrik - could you PTAL?

Comment 2 by olka@chromium.org, Mar 20 2018

Labels: -Pri-3 Pri-2

Comment 3 by m...@chromium.org, Mar 20 2018

This looks similar to an issue that was being discussed in another bug. (The CHECK fail is because the wrong thread is calling into the method.)
Status: Assigned (was: Untriaged)
Yes, this should be forked from issue 766198 (comment 100).
Raymond, is it possible to say anything about when this started happening?

Could it be the RendererWebAudioDeviceImpl's usage of SilentSinkSuspender and then perhaps this CL[1]? It landed a year ago though.

[1] https://codereview.chromium.org/2501863003
Cc: rtoy@chromium.org
Oh, for crying out, forgot to add rtoy@ before. Adding now - can you answer comment #5?

Similar report in issue 832615.

Comment 7 by rtoy@chromium.org, Apr 16 2018

Don't know.  The first time I've seen this particular crash was when I filed this issue.  Don't recall ever seeing this before
Cc: grunell@chromium.org
Owner: dalecur...@chromium.org
I've dug a bit in this now. It happens when the SilentSinkSuspender decides to inject a FakeAudioWorker, which runs on another thread.

I can repro by just going to https://jsfiddle.net/dLvLr0n7/ and wait for 30 seconds (the timeout used by WebAudio).

Using a FakeAudioWorker was enabled for all platforms (previously Android only) in https://chromium-review.googlesource.com/c/chromium/src/+/568817.

A solution for handling the thread switch is needed. Maybe it should be disabled again until that's in place.
Issue 832615 has been merged into this issue.
And, since it also happens when toggling playing there seems to be a problem with false positives in the detection of silence.
I think the solution is to just delete the thread checker (which does nothing in release mode anyways). The code shouldn't care what thread the audio data callback is running on.
I suppose the point is to ensure that OnSetFormat is called on the same thread.
Hmm that doesn't seem right -- that thread doesn't have a task runner so you can't post tasks. There also seems to be only one call and it isn't posted and seems to be the wrong thread? :O

https://cs.chromium.org/chromium/src/content/renderer/pepper/pepper_media_stream_audio_track_host.cc?type=cs&sq=package:chromium&l=364

Am I missing something or should this just be deleted?
Cc: maxmorin@chromium.org
+Max

Hmm, yes according to code search. But I got this call stack:

#0 0x7f4d76b8b5bc base::debug::StackTrace::StackTrace()
#1 0x7f4d752d5380 content::TrackAudioRenderer::OnSetFormat()
#2 0x7f4d752b433d content::MediaStreamAudioDeliverer<>::OnData()
#3 0x7f4d752b262e content::MediaStreamAudioDeliverer<>::OnData()
#4 0x7f4d752e8d3f content::WebAudioMediaStreamSource::DeliverRebufferedAudio()
#5 0x7f4d72a81487 media::AudioPushFifo::Push()
#6 0x7f4d752e95ff content::WebAudioMediaStreamSource::ConsumeAudio()
#7 0x7f4d6d6fe6b2 blink::ConsumerWrapper::ConsumeAudio()
#8 0x7f4d6d88cfbe blink::MediaStreamSource::ConsumeAudio()
#9 0x7f4d6d15f229 blink::MediaStreamAudioDestinationHandler::Process()
#10 0x7f4d6d1147ee blink::AudioHandler::ProcessIfNecessary()
#11 0x7f4d6d153c43 blink::DeferredTaskHandler::ProcessAutomaticPullNodes()
#12 0x7f4d6d10f86e blink::AudioDestinationHandler::Render()
#13 0x7f4d6d68cc9e blink::AudioDestination::RequestRender()
#14 0x7f4d6d68c72b blink::AudioDestination::Render()
#15 0x7f4d751cb709 content::RendererWebAudioDeviceImpl::Render()
#16 0x7f4d72abb58a media::SilentSinkSuspender::Render()
#17 0x7f4d72a500d0 media::AudioOutputDevice::AudioThreadCallback::Process()
#18 0x7f4d72a36002 media::AudioDeviceThread::ThreadMain()

So also MediaStreamAudioDeliverer<>::OnData() calls it:

https://cs.chromium.org/chromium/src/content/renderer/media/stream/media_stream_audio_deliverer.h?l=118
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 24 2018

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

commit e89ee8fdd0ae9ef05de23cda4b7d09d49daf9516
Author: Dale Curtis <dalecurtis@chromium.org>
Date: Tue Apr 24 05:12:08 2018

Remove base::ThreadChecker usage from the audio thread.

There's no gaurantee on what thread OnData() is called from and the
way the thread checker is used ends up only checking OnData() instead
of OnData() and OnSetFormat() since it always detaches in OnSetFormat.

BUG= 823403 
TEST=none

Change-Id: I5665ca4a2b5ffa8472404102d88dcf37604d83d2
Reviewed-on: https://chromium-review.googlesource.com/1022472
Reviewed-by: Henrik Grunell <grunell@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553002}
[modify] https://crrev.com/e89ee8fdd0ae9ef05de23cda4b7d09d49daf9516/content/renderer/media/stream/track_audio_renderer.cc
[modify] https://crrev.com/e89ee8fdd0ae9ef05de23cda4b7d09d49daf9516/content/renderer/media/stream/track_audio_renderer.h

Status: Fixed (was: Assigned)
[bulk-edit: disregard if N/A] Can the owner please set milestone to this bug if applicable?

Sign in to add a comment