Commit 883814d3 authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

Add crash keys to investigate why looking up a child's parent can crash

We're seeing some crashes where looking up a child's parent while
the child is being destroyed can crash. Curiously, stack traces suggest
that the "child" being destroyed could actually be the root.

Bug: 851958
Change-Id: I6b10f6e98ca3d969af0c17d60eb1266647391ca5
Reviewed-on: https://chromium-review.googlesource.com/1101173Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568164}
parent 9738ab66
...@@ -138,12 +138,31 @@ void RenderWidgetHostInputEventRouter::OnRenderWidgetHostViewBaseDestroyed( ...@@ -138,12 +138,31 @@ void RenderWidgetHostInputEventRouter::OnRenderWidgetHostViewBaseDestroyed(
// When a child iframe is destroyed, consider its parent to be to be the // When a child iframe is destroyed, consider its parent to be to be the
// most recent target, if possible. In some cases the parent might already // most recent target, if possible. In some cases the parent might already
// have been destroyed, in which case the last target is cleared. // have been destroyed, in which case the last target is cleared.
if (view != last_mouse_move_root_view_) if (view != last_mouse_move_root_view_) {
// TODO(851958): Remove crash keys once we understand why the following
// attempt to get the parent can crash.
static auto* target_key = base::debug::AllocateCrashKeyString(
"failed-parent-lookup-target", base::debug::CrashKeySize::Size32);
base::debug::ScopedCrashKeyString target_key_value(
target_key, base::StringPrintf("%p", last_mouse_move_target_));
static auto* root_key = base::debug::AllocateCrashKeyString(
"failed-parent-lookup-root", base::debug::CrashKeySize::Size32);
base::debug::ScopedCrashKeyString root_key_value(
root_key, base::StringPrintf("%p", last_mouse_move_root_view_));
static auto* target_is_child_key = base::debug::AllocateCrashKeyString(
"failed-parent-lookup-target-is-child",
base::debug::CrashKeySize::Size32);
base::debug::ScopedCrashKeyString target_is_child_key_value(
target_is_child_key,
std::to_string(
last_mouse_move_target_->IsRenderWidgetHostViewChildFrame()));
last_mouse_move_target_ = last_mouse_move_target_ =
static_cast<RenderWidgetHostViewChildFrame*>(last_mouse_move_target_) static_cast<RenderWidgetHostViewChildFrame*>(last_mouse_move_target_)
->GetParentView(); ->GetParentView();
else } else {
last_mouse_move_target_ = nullptr; last_mouse_move_target_ = nullptr;
}
if (!last_mouse_move_target_ || view == last_mouse_move_root_view_) if (!last_mouse_move_target_ || view == last_mouse_move_root_view_)
last_mouse_move_root_view_ = nullptr; last_mouse_move_root_view_ = nullptr;
......
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