I hit the following DCHECK in a test:
[4984:5006:0110/172145.565081:FATAL:thread_restrictions.cc(105)] Check failed: !g_base_sync_primitives_disallowed.Get().Get(). Waiting on a //base sync primitive is not allowed on this thread to prevent jank and deadlock. If waiting on a //base sync primitive is unavoidable, do it within the scope of a ScopedAllowBaseSyncPrimitives. If in a test, use ScopedAllowBaseSyncPrimitivesForTesting.
#0 0x7f7292c7094c base::debug::StackTrace::StackTrace()
#1 0x7f7292c9ad1c logging::LogMessage::~LogMessage()
#2 0x7f7292d25356 base::internal::AssertBaseSyncPrimitivesAllowed()
#3 0x7f7292cf6f83 base::ConditionVariable::Wait()
#4 0x7f72871085f8 midi::TaskService::UnbindInstance()
#5 0x7f728710aab2 midi::MidiManagerAlsa::Finalize()
#6 0x7f72870ff87b midi::MidiManager::ShutdownOnSessionThread()
#7 0x7f72870ff6ee midi::MidiManager::Shutdown()
#8 0x7f728710790a midi::MidiService::EndSession()
#9 0x7f72913049e4 content::MidiHost::OnChannelClosing()
#10 0x7f7290b6c446 content::BrowserMessageFilter::Internal::OnChannelClosing()
#11 0x7f7293c5bec2 IPC::ChannelProxy::Context::OnChannelClosed()
#12 0x7f7293c5e4ab _ZN4base8internal7InvokerINS0_9BindStateIMN3IPC12_GLOBAL__N_132ChannelAssociatedGroupControllerEFvvEJ13scoped_refptrIS5_EEEEFvvEE3RunEPNS0_13BindStateBaseE
#13 0x7f7292c7126a base::debug::TaskAnnotator::RunTask()
#14 0x7f7292ca45e6 base::internal::IncomingTaskQueue::RunTask()
#15 0x7f7292ca8817 base::MessageLoop::RunTask()
It's caused because TaskService::UnbindInstance is waiting on condition variables on the IO thread, which is not allowed. I'm temporarily adding a base::ScopedAllowBaseSyncPrimitives to ignore the warning, but this should most likely be fixed in a different way.
Comment 1 by raymes@chromium.org
, Jan 11 2018Status: Duplicate (was: Assigned)