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

Issue 837246 link

Starred by 4 users

Issue metadata

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



Sign in to add a comment

DCHECK support_grcontext_ when running with --show-paint-rects

Project Member Reported by pdr@chromium.org, Apr 26 2018

Issue description

--show-paint-rects is the flag that shows repaint rects and it uses the same infrastructure as the devtools "paint flashing" checkbox.

This is crashing for me on all pages on MacOS+content shell:
[26032:16387:0426/074841.020178:FATAL:context_provider_command_buffer.cc(419)] Check failed: support_grcontext_. 
0   libbase.dylib                       0x000000010532a39e base::debug::StackTrace::StackTrace(unsigned long) + 174
1   libbase.dylib                       0x000000010532a45d base::debug::StackTrace::StackTrace(unsigned long) + 29
2   libbase.dylib                       0x0000000104f277fc base::debug::StackTrace::StackTrace() + 28
3   libbase.dylib                       0x0000000104fa9e9c logging::LogMessage::~LogMessage() + 460
4   libbase.dylib                       0x0000000104fa7bf5 logging::LogMessage::~LogMessage() + 21
5   libcontent.dylib                    0x0000000111d83bb8 ui::ContextProviderCommandBuffer::GrContext() + 488
6   libcc.dylib                         0x0000000105c34323 cc::HeadsUpDisplayLayerImpl::UpdateHudTexture(cc::DrawMode, cc::LayerTreeFrameSink*, cc::LayerTreeResourceProvider*, bool, std::__1::vector<std::__1::unique_ptr<viz::RenderPass, std::__1::default_delete<viz::RenderPass> >, std::__1::allocator<std::__1::unique_ptr<viz::RenderPass, std::__1::default_delete<viz::RenderPass> > > > const&) + 9059
7   libcc.dylib                         0x0000000105f2c5bf cc::LayerTreeHostImpl::DrawLayers(cc::LayerTreeHostImpl::FrameData*) + 3279
8   libcc.dylib                         0x000000010602a5d7 cc::ProxyImpl::DrawInternal(bool) + 1015
9   libcc.dylib                         0x000000010602a19a cc::ProxyImpl::ScheduledActionDrawIfPossible() + 666
10  libcc.dylib                         0x0000000105da01d7 cc::Scheduler::DrawIfPossible() + 407
11  libcc.dylib                         0x0000000105d98ee9 cc::Scheduler::ProcessScheduledActions() + 1529
12  libcc.dylib                         0x0000000105d98748 cc::Scheduler::OnBeginImplFrameDeadline() + 360
13  libcc.dylib                         0x0000000105d9ce9c cc::Scheduler::BeginImplFrameWithDeadline(viz::BeginFrameArgs const&) + 268
14  libcc.dylib                         0x0000000105d9c6a4 cc::Scheduler::OnBeginFrameDerivedImpl(viz::BeginFrameArgs const&) + 1940
15  libviz_common.dylib                 0x00000001087090d6 viz::BeginFrameObserverBase::OnBeginFrame(viz::BeginFrameArgs const&) + 1494

This dcheck is recent:
http://crrev.com/7d3d2502e2e1dbcb42aec4b8f50b2677c1c29ed5
 
Any clue as to what is causing this issue?

This is also affecting Chromecast with the --show-fps-counter flag.

On a release build this eventually hits a CHECK later on in blink:[15538:15538:FATAL:local_window_proxy.cc(233)] Check failed: !context.IsEmpty()

Comment 2 by rog...@vewd.com, May 24 2018

Not sure this information helps but I can reproduce this on ToT (68.0.3440.0) in a locally built Linux content_shell by running:
./content_shell --enable-gpu-rasterization --show-fps-counter

I bisected it down to the revision mentioned in the description.

Comment 3 by pdr@chromium.org, May 24 2018

Cc: junov@chromium.org
Owner: piman@chromium.org
Antoine, is this something you could investigate?

Comment 4 by rog...@vewd.com, May 29 2018

Some more clues, by changing the following support_grcontext to true I don't get the dcheck anymore:
https://cs.chromium.org/chromium/src/content/renderer/render_thread_impl.cc?l=2095&rcl=4519c32f528e079f25cb2afc594ecf625f943782

But I guess the proper fix is to use the worker_context_provider in cc::HeadsUpDisplayLayerImpl::UpdateHudTexture instead of the context_provider when gpu raster is enabled?

Comment 5 by piman@chromium.org, May 29 2018

Cc: piman@chromium.org
Owner: backer@chromium.org
->backer, could you take a look?

Comment 6 by junov@chromium.org, May 29 2018

This DCHECK fires when you try to use GrContext on a context provider that was initialized with "supports_grcontext = false".  It should just be a matter of flipping that bit at the call site where the context provider is set-up.  I'm not familiar with this code, so I'm not sure which calls site is the right one.

Perhaps this one:
https://cs.chromium.org/chromium/src/content/renderer/render_thread_impl.cc?dr=CSs&g=0&l=2095

Comment 7 by rog...@vewd.com, May 30 2018

Fyi, I pushed a CL with the suggested fix:
https://chromium-review.googlesource.com/c/chromium/src/+/1078267

Comment 8 by backer@chromium.org, May 30 2018

Looking...

Comment 9 by backer@chromium.org, May 30 2018

Cc: vmi...@chromium.org
It's also sufficient to disable this branch (always set |gpu_raster| to false). https://cs.chromium.org/chromium/src/cc/layers/heads_up_display_layer_impl.cc?rcl=d9732ad00f8dd2564a6283a67156697cfe85dbac&l=267

I tested by hand and ran cc_unittests. I think that it would be better to do this because we eventually want to remove all GrContext from the renderer. But eventually is a long time from now. And perhaps the HUD layer hurts performance when we use CPU raster the HUD layer but GPU raster the content.

+vmiura

Victor: Do you want to nix the HUD layer dependency on GrContext now or later?


Comment 10 by piman@chromium.org, May 30 2018

Cc: enne@chromium.org
+enne who may have an opinion.

Comment 11 by enne@chromium.org, May 30 2018

Cc: danakj@chromium.org
Agreed with backer that we want to remove all GrContext usage from the renderer.

The easiest solution does seem to be to just use software mode always as backer suggests (without removing all the other code that it supports).  Given that this DCHECK means that show paint rects from devtools is likely not working anymore, I think it's important to land a short term fix.

A better solution might be to lock and use the worker context provider.  We'd also need a third branch in that code to support oop raster when that's available.
Awkward cuz we just added hardware raster to the HUD, since the texture upload was destroying the fps meter's usefulness. Can it use OOPR?

Comment 13 by enne@chromium.org, May 30 2018

It could use ganesh now if it used the worker context provider.  We'd just also need to also fix it for oopr.
Consensus on #chromium is that the change in comment #7 should land and be backported to m68.

Then on ToT we can figure out how to remove GrContext from compositor thread.
Some suggestions for that centered around:

- maybe using worker context
- maybe using OOP-R
- maybe modifying RasterInterface to make the use of GPU raster or OOP-R easier from clients


Comment 15 by rog...@vewd.com, May 30 2018

The CL is in the CQ now. Regarding m68, I have no idea how you trigger backports so I think it would be best if one of you could help me with that.
Project Member

Comment 16 by bugdroid1@chromium.org, May 31 2018

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

commit 905b8cac7b58d60a0003c4c413da212b37889e53
Author: Roger Johannesson <rogerj@vewd.com>
Date: Thu May 31 13:28:54 2018

Enable GrContext support in the shared main thread context provider

This prevents a DCHECK when running with either --show-fps-counter or
--show-paint-rects together with --enable-gpu-rasterization. The DCHECK
is triggered by cc::HeadsUpDisplayLayerImpl::UpdateHudTexture that makes
use of the GrContext when gpu rasterization is enabled.

Bug:  837246 ,  810159 
Change-Id: I74d2b1390d975dd783736bb1c12114ed4c7cbb0a
Reviewed-on: https://chromium-review.googlesource.com/1078267
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Cr-Commit-Position: refs/heads/master@{#563207}
[modify] https://crrev.com/905b8cac7b58d60a0003c4c413da212b37889e53/content/renderer/render_thread_impl.cc

Status: Fixed (was: Assigned)
DCHECK no longer fires. 

Sign in to add a comment