Commit e62484a3 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

Add crash dump error reporting for OOP-R deserialization failures

There was a recent issue where this was happening due to cache bugs.
This is something that should never happen, so it would be nice to have
it be more noisy when it fails.

Bug: 906510
Change-Id: Ie4e8aaf415c491d4ba192d1b57c115cec7d81ca9
Reviewed-on: https://chromium-review.googlesource.com/c/1351386Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611217}
parent 39e24c5c
...@@ -184,8 +184,10 @@ class CC_PAINT_EXPORT PaintOp { ...@@ -184,8 +184,10 @@ class CC_PAINT_EXPORT PaintOp {
SkStrikeClient* strike_client); SkStrikeClient* strike_client);
TransferCacheDeserializeHelper* transfer_cache = nullptr; TransferCacheDeserializeHelper* transfer_cache = nullptr;
ServicePaintCache* paint_cache = nullptr; ServicePaintCache* paint_cache = nullptr;
uint32_t raster_color_space_id = gfx::ColorSpace::kInvalidId;
SkStrikeClient* strike_client = nullptr; SkStrikeClient* strike_client = nullptr;
uint32_t raster_color_space_id = gfx::ColorSpace::kInvalidId;
// Do a DumpWithoutCrashing when serialization fails.
bool crash_dump_on_failure = false;
}; };
// Indicates how PaintImages are serialized. // Indicates how PaintImages are serialized.
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <algorithm> #include <algorithm>
#include "base/bits.h" #include "base/bits.h"
#include "base/debug/dump_without_crashing.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "cc/paint/image_transfer_cache_entry.h" #include "cc/paint/image_transfer_cache_entry.h"
#include "cc/paint/paint_cache.h" #include "cc/paint/paint_cache.h"
...@@ -613,6 +614,8 @@ void PaintOpReader::AlignMemory(size_t alignment) { ...@@ -613,6 +614,8 @@ void PaintOpReader::AlignMemory(size_t alignment) {
} }
inline void PaintOpReader::SetInvalid() { inline void PaintOpReader::SetInvalid() {
if (valid_ && options_.crash_dump_on_failure)
base::debug::DumpWithoutCrashing();
valid_ = false; valid_ = false;
} }
......
...@@ -2564,8 +2564,8 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id, ...@@ -2564,8 +2564,8 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id,
TransferCacheDeserializeHelperImpl impl(raster_decoder_id_, transfer_cache()); TransferCacheDeserializeHelperImpl impl(raster_decoder_id_, transfer_cache());
cc::PaintOp::DeserializeOptions options(&impl, paint_cache_.get(), cc::PaintOp::DeserializeOptions options(&impl, paint_cache_.get(),
font_manager_->strike_client()); font_manager_->strike_client());
options.crash_dump_on_failure = true;
int op_idx = 0;
size_t paint_buffer_size = raster_shm_size; size_t paint_buffer_size = raster_shm_size;
while (paint_buffer_size > 0) { while (paint_buffer_size > 0) {
size_t skip = 0; size_t skip = 0;
...@@ -2573,9 +2573,8 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id, ...@@ -2573,9 +2573,8 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id,
paint_buffer_memory, paint_buffer_size, &data[0], paint_buffer_memory, paint_buffer_size, &data[0],
sizeof(cc::LargestPaintOp), &skip, options); sizeof(cc::LargestPaintOp), &skip, options);
if (!deserialized_op) { if (!deserialized_op) {
std::string msg = LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glRasterCHROMIUM",
base::StringPrintf("RasterCHROMIUM: bad op: %i", op_idx); "RasterCHROMIUM: serialization failure");
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glRasterCHROMIUM", msg.c_str());
return; return;
} }
...@@ -2584,7 +2583,6 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id, ...@@ -2584,7 +2583,6 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id,
paint_buffer_size -= skip; paint_buffer_size -= skip;
paint_buffer_memory += skip; paint_buffer_memory += skip;
op_idx++;
} }
} }
......
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