New issue
Advanced search Search tips

Issue 882068 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 10
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Inconsistent use of RunLoop::QuitWhenIdle and RunLoop::QuitCurrent* causes GPU thread to crash in debug

Project Member Reported by dfried@chromium.org, Sep 8

Issue description

Chrome Version: 71.0.3546.0 (Developer Build) (64-bit)
Revision: d002ecc01eb4826bad9c8824f2fbbbcbd888563a-refs/heads/master@{#589698}
OS: Win10

What steps will reproduce the problem?
(1) get latest chrome code and build in debug
(2) run chrome with default settings
(3) do not interact with the computer for a minute or two

What is the expected result?

Chrome continues to run as normal.

What happens instead?

A DCHECK error box pops up (see attached file).


 
Untitled.png
37.7 KB View Download
The call stack for the crash is:
 	base.dll!base::RunLoop::QuitCurrentWhenIdleDeprecated() Line 219	C++
 	service.dll!viz::GpuServiceImpl::GetGpuSupportedRuntimeVersion(base::OnceCallback<void (const gpu::GPUInfo &)> callback) Line 545	C++
 	service.dll!base::internal::FunctorTraits<void (viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>),void>::Invoke<void (viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>),base::WeakPtr<viz::GpuServiceImpl>,base::OnceCallback<void (const gpu::GPUInfo &)> >(void(viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>) method, base::WeakPtr<viz::GpuServiceImpl> && receiver_ptr, base::OnceCallback<void (const gpu::GPUInfo &)> && args) Line 516	C++
 	service.dll!base::internal::InvokeHelper<1,void>::MakeItSo<void (viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>),base::WeakPtr<viz::GpuServiceImpl>,base::OnceCallback<void (const gpu::GPUInfo &)> >(void(viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>) && functor, base::WeakPtr<viz::GpuServiceImpl> && weak_ptr, base::OnceCallback<void (const gpu::GPUInfo &)> && args) Line 639	C++
 	service.dll!base::internal::Invoker<base::internal::BindState<void (viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>),base::WeakPtr<viz::GpuServiceImpl>,base::OnceCallback<void (const gpu::GPUInfo &)> >,void ()>::RunImpl<void (viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>),std::tuple<base::WeakPtr<viz::GpuServiceImpl>,base::OnceCallback<void (const gpu::GPUInfo &)> >,0,1>(void(viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>) && functor, std::tuple<base::WeakPtr<viz::GpuServiceImpl>,base::OnceCallback<void (const gpu::GPUInfo &)> > && bound, std::integer_sequence<unsigned long long,0,1>) Line 689	C++
 	service.dll!base::internal::Invoker<base::internal::BindState<void (viz::GpuServiceImpl::*)(base::OnceCallback<void (const gpu::GPUInfo &)>),base::WeakPtr<viz::GpuServiceImpl>,base::OnceCallback<void (const gpu::GPUInfo &)> >,void ()>::RunOnce(base::internal::BindStateBase * base) Line 658	C++
 	base.dll!base::OnceCallback<void ()>::Run() Line 100	C++
 	base.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, base::PendingTask * pending_task) Line 103	C++
 	base.dll!base::MessageLoop::RunTask(base::PendingTask * pending_task) Line 436	C++
 	base.dll!base::MessageLoop::DeferOrRunPendingTask(base::PendingTask pending_task) Line 448	C++
 	base.dll!base::MessageLoop::DoWork() Line 517	C++
 	base.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate) Line 37	C++
 	base.dll!base::MessageLoop::Run(bool application_tasks_allowed) Line 388	C++
 	base.dll!base::RunLoop::Run() Line 105	C++
 	content.dll!content::GpuMain(const content::MainFunctionParams & parameters) Line 350	C++
 	content.dll!content::RunOtherNamedProcessTypeMain(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & process_type, const content::MainFunctionParams & main_function_params, content::ContentMainDelegate * delegate) Line 563	C++
 	content.dll!content::ContentMainRunnerImpl::Run(bool start_service_manager_only) Line 898	C++
 	content.dll!content::ContentServiceManagerMainDelegate::RunEmbedderProcess() Line 53	C++
 	embedder.dll!service_manager::Main(const service_manager::MainParams & params) Line 472	C++
 	content.dll!content::ContentMain(const content::ContentMainParams & params) Line 20	C++
 	chrome.dll!ChromeMain(HINSTANCE__ * instance, sandbox::SandboxInterfaceInfo * sandbox_info, __int64 exe_entry_point_ticks) Line 102	C++
 	chrome.exe!MainDllLoader::Launch(HINSTANCE__ * instance, base::TimeTicks exe_entry_point_ticks) Line 201	C++
 	chrome.exe!wWinMain(HINSTANCE__ * instance, HINSTANCE__ * prev, wchar_t *, int) Line 229	C++

Labels: -Type-Bug -Pri-3 M-71 Pri-1 Type-Bug-Regression
Status: Started (was: Untriaged)
Looks to be Windows-specific code still calling QuitCurrentWhenIdleDeprecated(). Will upload a patch to migrate those call-sites ASAP.

Thanks for the report!
This appears to be triggered by change in gpu_main.cc (https://chromium.googlesource.com/chromium/src/+/6979109b593d10aef2e923e777c421bc7f749a93%5E%21/#F6)

The added call to RunLoop::QuitClosure() sets a flag that causes all subsequent calls to RunLoop::QuitCurrent*Deprecated() to fail via DCHECK().
Thanks!
Issue 882297 has been merged into this issue.
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 10

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

commit d476f83e19616335082eef8db3f7f40f52a04699
Author: Wez <wez@chromium.org>
Date: Mon Sep 10 21:05:50 2018

Terminate GPU process via ExitProcess rather than RunLoop::QuitCurrent.

Quitting the RunLoop with QuitCurrent*Deprecated() triggers the DCHECK
against mixing the deprecated quit APIs with use of QuitClosure.

Use the GpuServiceImpl::ExitProcess() helper to quit the process
gracefully, instead.

Also removes the |is_exiting_| flag in favour of checking whether
|exit_callback_| is set, and adds a DCHECK for a non-null
|exit_callback| being passed at construction.

Bug:  882068 
Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Id8a87e4648fbac3283f41ce2f80cf03a153227ab
Reviewed-on: https://chromium-review.googlesource.com/1214750
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590061}
[modify] https://crrev.com/d476f83e19616335082eef8db3f7f40f52a04699/components/viz/service/gl/gpu_service_impl.cc
[modify] https://crrev.com/d476f83e19616335082eef8db3f7f40f52a04699/components/viz/service/gl/gpu_service_impl.h
[modify] https://crrev.com/d476f83e19616335082eef8db3f7f40f52a04699/components/viz/service/main/viz_main_impl.h

Status: Fixed (was: Started)

Sign in to add a comment