New issue
Advanced search Search tips

Issue 785023 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 760181



Sign in to add a comment

ContentBrowserTestSanityTest.SingleProcess crashes with --enable-viz

Project Member Reported by jonr...@chromium.org, Nov 14 2017

Issue description

ContentBrowserTestSanityTest.SingleProcess crashes with --enable-viz

[2117:2144:1114/172024.985874:FATAL:frame_sink_manager_impl.cc(51)] Check failed: (thread_checker_).CalledOnValidThread(). 
#0 0x7fd01e67c8ed base::debug::StackTrace::StackTrace()
#1 0x7fd01e67ae6c base::debug::StackTrace::StackTrace()
#2 0x7fd01e6ffb3d logging::LogMessage::~LogMessage()
#3 0x7fd00e744e32 viz::FrameSinkManagerImpl::~FrameSinkManagerImpl()
#4 0x7fd00e745209 viz::FrameSinkManagerImpl::~FrameSinkManagerImpl()
#5 0x7fd01934ac41 viz::VizMainImpl::~VizMainImpl()
#6 0x7fd0186f5b5c content::GpuChildThread::~GpuChildThread()
#7 0x7fd0186f5bc0 content::GpuChildThread::~GpuChildThread()
#8 0x7fd0186f5cb9 content::GpuChildThread::~GpuChildThread()
#9 0x7fd0188434d2 content::ChildProcess::~ChildProcess()
#10 0x7fd018710175 content::GpuProcess::~GpuProcess()
#11 0x7fd018710199 content::GpuProcess::~GpuProcess()
#12 0x7fd018716326 content::InProcessGpuThread::CleanUp()
#13 0x7fd01e8a0751 base::Thread::ThreadMain()
#14 0x7fd01e885ed1 base::(anonymous namespace)::ThreadFunc()
#15 0x7fd021486184 start_thread
#16 0x7fd00bbc0ffd clone

Shutdown in this test is occurring on the wrong thread.
 
Also all DomSerializerTests tests
Also: IndexedDBBrowserTestSingleProcess.RenderThreadShutdownTest
Also: RenderThreadImplDiscardableMemoryBrowserTest.*
Also:   RenderViewBrowserTest.ConfirmCacheInformationPlumbed
Also: ResourceFetcherTests.*
Also: SavableResourcesTest.*
Status: Assigned (was: Untriaged)
Cc: jonr...@chromium.org
Owner: sadrul@chromium.org
This is occurring because while GpuChildThread creates VizMainImpl, it never calls TearDown.

This is tricky though.
  -  InProcessGpuThread is creating VizMainImpl on the gpu thread
  -  InProcessGpuThread would be attempting to tear down VizMainImpl on the gpu thread.
  -  There is a race/blocking condition between the gpu and compositor threads. Due to this we need both advancing for tear down to work correctly.

So we need another thread to actually call VizMainImpl::TearDown in this situation.

Initialization stack:
  viz::VizMainImpl::VizMainImpl()
  content::GpuChildThread::GpuChildThread()
  content::GpuChildThread::GpuChildThread()
  content::InProcessGpuThread::Init()
  base::Thread::ThreadMain()
  base::(anonymous namespace)::ThreadFunc()
  start_thread
  clone

Shutdown stack:
  viz::VizMainImpl::~VizMainImpl()
  content::GpuChildThread::~GpuChildThread()
  content::GpuChildThread::~GpuChildThread()
  content::GpuChildThread::~GpuChildThread()
  content::ChildProcess::~ChildProcess()
  content::GpuProcess::~GpuProcess()
  content::GpuProcess::~GpuProcess()
  content::InProcessGpuThread::CleanUp()
  base::Thread::ThreadMain()
  base::(anonymous namespace)::ThreadFunc()
  start_thread
  clone

Passing to sadrul@ after discussions.

Also happened in a new test that was added, for some reason the cq didn't block it from landing

WebRtcCaptureFromElementBrowserTest.CaptureFromCanvas2DHandlesContextLoss
Cc: kylec...@chromium.org
Labels: -Pri-3 M-66 Pri-1
Owner: kylec...@chromium.org
I'll take a look at this.
Project Member

Comment 12 by bugdroid1@chromium.org, Feb 1 2018

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

commit e004637353199f8588dcf2f4510923905af0aea4
Author: kylechar <kylechar@chromium.org>
Date: Thu Feb 01 01:19:10 2018

viz: Shutdown properly with OOP-D.

Change GpuChildThread to shutdown VizMainImpl cleanly. VizMainImpl needs
to shutdown the GPU and compositor thread in a specific order, however
the implementation of VizMainImpl::TearDown() requird that it be called
from a third thread.

Reorder the VizMainImpl::Teardown() logic so it can be called from the
GPU thread and move it to the destructor. Remove most WaitableEvent
usage since we can rely on Thread::Stop() to synchronize with thread
destruction.

Also simplify GpuHost and WindowServer destruction.

Bug:  785023 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Idbac0d6b91fc32b403a359fdcf3d7ea62c17f682
Reviewed-on: https://chromium-review.googlesource.com/893520
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533509}
[modify] https://crrev.com/e004637353199f8588dcf2f4510923905af0aea4/components/viz/service/main/viz_main_impl.cc
[modify] https://crrev.com/e004637353199f8588dcf2f4510923905af0aea4/components/viz/service/main/viz_main_impl.h
[modify] https://crrev.com/e004637353199f8588dcf2f4510923905af0aea4/content/gpu/gpu_child_thread.cc
[modify] https://crrev.com/e004637353199f8588dcf2f4510923905af0aea4/services/ui/ws/gpu_host.cc
[modify] https://crrev.com/e004637353199f8588dcf2f4510923905af0aea4/services/ui/ws/gpu_host.h
[modify] https://crrev.com/e004637353199f8588dcf2f4510923905af0aea4/services/ui/ws/window_server.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Feb 1 2018

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

commit f55fc4750c0f574c4dfe246e2cb10587e26a5d04
Author: kylechar <kylechar@chromium.org>
Date: Thu Feb 01 16:42:30 2018

viz: Enable more viz_content_browsertests.

VizMainImpl thread shutdown issues have been fixed. Enabled tests that
were disabled because of that problem.

Bug:  785023 
Change-Id: I6dc21fabbfaacd7d0e458fb06697b03651a3f396
Reviewed-on: https://chromium-review.googlesource.com/893534
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533698}
[modify] https://crrev.com/f55fc4750c0f574c4dfe246e2cb10587e26a5d04/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter
[modify] https://crrev.com/f55fc4750c0f574c4dfe246e2cb10587e26a5d04/testing/buildbot/filters/viz.content_browsertests.filter

Status: Fixed (was: Assigned)

Sign in to add a comment