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

Issue 117470 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Email to this user bounced
Closed: Mar 2012
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment

Chrome: AudioManagerBase::MakeAudioOutputStream(AudioParameters const &)

Project Member Reported by dharani@google.com, Mar 8 2012

Issue description

might be from http://src.chromium.org/viewvc/chrome?view=rev&revision=125389

Product, Version	 Chrome ,  19.0.1063.0
Stack Signature	 `anonymous namespace'::PureCall()-4E32440
New Stack Signature	 `anonymous namespace'::PureCall() 
d44fcfe8_d06d756c_0684e5dd_64a428ac_850f96ba
Report Time (UTC)	 2012/03/08 19:23:30, Thu
Uptime	 1286365 ms
OS Name, Version	 Windows NT ,  6.1.7600
CPU Architecture, Info	 x86 ,  GenuineIntel family 6 model 23 stepping 10
channel	 canary
plat	 Win32
ptype	 browser

http://crash/reportdetail?reportid=b561ffd1635d6475#crashing_thread

Thread 4 *CRASHED* ( EXCEPTION_BREAKPOINT @ 0x62aacd35 )

0x62aacd35	 [chrome.dll	 - startup_helper_win.cc:24	`anonymous namespace'::PureCall()
0x62a4ba43	 [chrome.dll	 - purevirt.c:47	_purecall
0x630d9786	 [chrome.dll	 - audio_manager_base.cc:76	AudioManagerBase::MakeAudioOutputStream(AudioParameters const &)
0x630e814e	 [chrome.dll	 - audio_output_dispatcher.cc:139	AudioOutputDispatcher::CreateAndOpenStream()
0x630e83f4	 [chrome.dll	 - audio_output_dispatcher.cc:42	AudioOutputDispatcher::StreamOpened()
0x630e8945	 [chrome.dll	 - audio_output_proxy.cc:29	AudioOutputProxy::Open()
0x630dac00	 [chrome.dll	 - audio_output_controller.cc:126	media::AudioOutputController::DoCreate(AudioManager *,AudioParameters const &)
0x61f84708	 [chrome.dll	 - bind_internal.h:1384	base::internal::Invoker<3,base::internal::BindState<base::internal::RunnableAdapter<void ( PluginServiceImpl::*)(base::MessageLoopProxy *,base::Callback<void (std::vector<webkit::WebPluginInfo,std::allocator<webkit::WebPluginInfo> > const &)> const &)>,void (PluginServiceImpl *,base::MessageLoopProxy *,base::Callback<void (std::vector<webkit::WebPluginInfo,std::allocator<webkit::WebPluginInfo> > const &)> const &),void (base::internal::UnretainedWrapper<PluginServiceImpl>,scoped_refptr<base::MessageLoopProxy>,base::Callback<void (std::vector<webkit::WebPluginInfo,std::allocator<webkit::WebPluginInfo> > const &)>)>,void (PluginServiceImpl *,base::MessageLoopProxy *,base::Callback<void (std::vector<webkit::WebPluginInfo,std::allocator<webkit::WebPluginInfo> > const &)> const &)>::Run(base::internal::BindStateBase *)
0x61ed670f	 [chrome.dll	 - message_loop.cc:458	MessageLoop::RunTask(base::PendingTask const &)
0x61ed551d	 [chrome.dll	 - message_loop.cc:660	MessageLoop::DoWork()
0x61eea560	 [chrome.dll	 - message_pump_default.cc:55	base::MessagePumpDefault::Run(base::MessagePump::Delegate *)
0x61ed508a	 [chrome.dll	 - message_loop.cc:390	MessageLoop::RunHandler()
0x61ed5037	 [chrome.dll	 - message_loop.cc:300	MessageLoop::Run()
0x61ed6348	 [chrome.dll	 - thread.cc:126	base::Thread::Run(MessageLoop *)
0x61ed6309	 [chrome.dll	 - thread.cc:161	base::Thread::ThreadMain()
0x61ed626d	 [chrome.dll	 - platform_thread_win.cc:58	base::`anonymous namespace'::ThreadFunc(void *)
0x76ea1113	 [kernel32.dll	 + 0x00051113]	BaseThreadInitThunk
0x77d5b298	 [ntdll.dll	 + 0x0005b298]	__RtlUserThreadStart
0x77d5b26b	 [ntdll.dll	 + 0x0005b26b]	_RtlUserThreadStart
 

Comment 1 by dharani@google.com, Mar 12 2012

any updates?

Comment 2 by xians@chromium.org, Mar 12 2012

Cc: tommi@chromium.org
Sorry, I missed the first notification.

+Tommi,

It is a bit weird to me, it looks like it gets into a pure virtual MakeLinearOutputStream(), which have been implemented in AudioManagerWin;

dharani, does this problem happens only in windows NT? Is it easy to reproduced?

Tommi, do you have any idea? 

Comment 3 by dharani@google.com, Mar 12 2012

Yes, it happens only in Windows NT. I don't have a windows machine to reproduce this crash.

Comment 4 by xians@chromium.org, Mar 12 2012

From the crash thread report:
base::Thread::Stop()
0x630d982b	 [chrome.dll	 - audio_manager_base.cc:177]	AudioManagerBase::Shutdown()
0x630d9847	 [chrome.dll	 - audio_manager_base.cc:33]	AudioManagerBase::~AudioManagerBase()
0x630e8bcb	 [chrome.dll	 + 0x01238bcb]	AudioManagerWin::`scalar deleting destructor'(unsigned int)
0x62f58b09	 [chrome.dll	 - browser_main_loop.cc:230]	content::BrowserMainLoop::~BrowserMainLoop()
0x62f58b49	 [chrome.dll	 + 0x010a8b49]	content::BrowserMainLoop::`scalar deleting destructor'(unsigned int)
0x61ecc93c	 [chrome.dll	 - scoped_ptr.h:160]	scoped_ptr<WifiDataProviderCommon::WlanApiInterface>::reset(WifiDataProviderCommon::WlanApiInterface *)
0x62f61f81	 [chrome.dll	 - browser_main_runner.cc:110]	`anonymous namespace'::BrowserMainRunnerImpl::Shutdown()

It looks like another thread is deleting the AudioManager while the AudioManager is creating the output stream.
I believe this problem is not related to my CL, but mainly on the synchronization between main thread and AudioManager::audio_thread_.

Comment 5 by xians@chromium.org, Mar 13 2012

Status: Started
Thanks Tommi for the help.

The problem is because the destruction of the AudioManager classes happens in order of AudioManagerWin, AudioManagerBase, then AudioManager. And we stop the audio thread in AudioManagerBase. So when AudioManagerWin goes away, the audio thread is still running, so it crashes when it tries to create a stream through AudioManagerWin.
And the same things can happen on all platforms.

CL https://chromiumcodereview.appspot.com/9692038/ is out and should fix the issue.


Project Member

Comment 6 by bugdroid1@chromium.org, Mar 14 2012

The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=126635

------------------------------------------------------------------------
r126635 | xians@chromium.org | Wed Mar 14 07:07:39 PDT 2012

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/speech/speech_recognizer_impl_unittest.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/android/audio_manager_android.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/mac/audio_manager_mac.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/fake_audio_input_stream.h?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/audio_manager_base.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/win/audio_manager_win.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/fake_audio_output_stream.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/media/audio_renderer_host_unittest.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/simple_sources_unittest.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/fake_audio_output_stream.h?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/audio_manager_base.h?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/openbsd/audio_manager_openbsd.cc?r1=126635&r2=126634&pathrev=126635
 M http://src.chromium.org/viewvc/chrome/trunk/src/media/audio/fake_audio_input_stream.cc?r1=126635&r2=126634&pathrev=126635

Stopping the audio thread before destroying the AudioManager<Platform>.

The destruction of the AudioManager family happens in order of: AudioManager<Platform>, AudioManagerBase, AudioManager.
So before getting into the destruction of AudioManagerBase, we have make sure the audio thread has been stopped before AudioManager<Platform> is gone, otherwise it will end up into unexpected behavior, for example, crash because of pure virtual function.


BUG= 117470 
TEST=media_unittests, Address Sanitizer

Review URL: http://codereview.chromium.org/9692038
------------------------------------------------------------------------

Comment 7 by xians@chromium.org, Mar 14 2012

Status: Fixed
Labels: testcasenotadded
Status: Verified
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 13 2012

Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-Internals -Mstone-19 -Feature-Media-Audio Cr-Internals-Media-Audio M-19 Cr-Internals
Project Member

Comment 11 by bugdroid1@chromium.org, Mar 14 2013

Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue

Sign in to add a comment