Commit 15d440a3 authored by Vasiliy Telezhnikov's avatar Vasiliy Telezhnikov Committed by Commit Bot

Crash on quick consecutive Reshape failures

We observe small amount of users generates thousands of errors
suggesting they are in tight loop recreating renderer and losing again
for some reason. This CL adds CHECK to crash in this case.

Bug: 1126490
Change-Id: I5bec28b04e23c5d8671cdff6f5721fd4e519f9a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416749Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807945}
parent 38722e1e
......@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind_helpers.h"
#include "base/debug/alias.h"
#include "build/build_config.h"
#include "components/viz/common/gpu/context_lost_reason.h"
#include "components/viz/service/display/dc_layer_overlay.h"
......@@ -33,6 +34,21 @@
namespace viz {
namespace {
base::TimeTicks g_last_reshape_failure = base::TimeTicks();
NOINLINE void CheckForLoopFailures() {
const auto threshold = base::TimeDelta::FromSeconds(1);
auto now = base::TimeTicks::Now();
if (!g_last_reshape_failure.is_null() &&
now - g_last_reshape_failure > threshold) {
CHECK(false);
}
g_last_reshape_failure = now;
}
} // namespace
SkiaOutputDeviceGL::SkiaOutputDeviceGL(
gpu::MailboxManager* mailbox_manager,
gpu::SharedImageRepresentationFactory* shared_image_representation_factory,
......@@ -138,7 +154,9 @@ bool SkiaOutputDeviceGL::Reshape(const gfx::Size& size,
if (!gl_surface_->Resize(size, device_scale_factor, color_space,
gfx::AlphaBitsForBufferFormat(buffer_format))) {
DLOG(ERROR) << "Failed to resize.";
CheckForLoopFailures();
// To prevent tail call, so we can see the stack.
base::debug::Alias(nullptr);
return false;
}
SkSurfaceProps surface_props =
......@@ -183,6 +201,9 @@ bool SkiaOutputDeviceGL::Reshape(const gfx::Size& size,
<< " " << framebuffer_info.fFBOID << " "
<< framebuffer_info.fFormat << " " << color_space.ToString()
<< " " << size.ToString();
CheckForLoopFailures();
// To prevent tail call, so we can see the stack.
base::debug::Alias(nullptr);
}
memory_type_tracker_->TrackMemFree(backbuffer_estimated_size_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment