Commit 7e927f71 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

aw: Add DumpWithoutCrashing to debug terminator

Hopefully getting the stack and some info of of when a
!normal_termination and kInvalidSigno happens will be helpful to pin
down the cause.

Bug: 1115216
Change-Id: I4bda59c1e27782e7688d1594c8af6efba6c1c9c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2448058Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813865}
parent 8185af6b
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
#include "android_webview/browser/aw_browser_process.h" #include "android_webview/browser/aw_browser_process.h"
#include "android_webview/browser/aw_render_process_gone_delegate.h" #include "android_webview/browser/aw_render_process_gone_delegate.h"
#include "android_webview/common/aw_descriptors.h" #include "android_webview/common/aw_descriptors.h"
#include "android_webview/common/crash_reporter/crash_keys.h"
#include "base/android/scoped_java_ref.h" #include "base/android/scoped_java_ref.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -123,6 +126,20 @@ void AwBrowserTerminator::OnChildExit( ...@@ -123,6 +126,20 @@ void AwBrowserTerminator::OnChildExit(
LOG(ERROR) << "Renderer process (" << info.pid << ") crash detected (code " LOG(ERROR) << "Renderer process (" << info.pid << ") crash detected (code "
<< info.crash_signo << ")."; << info.crash_signo << ").";
if (info.crash_signo ==
crash_reporter::ChildExitObserver::TerminationInfo::kInvalidSigno) {
static auto* termination_info_key = base::debug::AllocateCrashKeyString(
crash_keys::kTerminationInfo, base::debug::CrashKeySize::Size32);
std::ostringstream stream;
stream << info.was_killed_intentionally_by_browser << " "
<< info.renderer_shutdown_requested << " "
<< info.threw_exception_during_init << " "
<< info.renderer_has_visible_clients;
base::debug::SetCrashKeyString(termination_info_key, stream.str());
base::debug::DumpWithoutCrashing();
base::debug::ClearCrashKeyString(termination_info_key);
}
std::vector<ScopedJavaGlobalRef<jobject>> java_web_contents; std::vector<ScopedJavaGlobalRef<jobject>> java_web_contents;
GetJavaWebContentsForRenderProcess(rph, &java_web_contents); GetJavaWebContentsForRenderProcess(rph, &java_web_contents);
......
...@@ -15,6 +15,7 @@ const char kAppPackageVersionCode[] = "app-package-version-code"; ...@@ -15,6 +15,7 @@ const char kAppPackageVersionCode[] = "app-package-version-code";
const char kAppProcessName[] = "app-process-name"; const char kAppProcessName[] = "app-process-name";
const char kAndroidSdkInt[] = "android-sdk-int"; const char kAndroidSdkInt[] = "android-sdk-int";
const char kTerminationInfo[] = "termination-info";
const char kSupportLibraryWebkitVersion[] = "androidx-webkit-version"; const char kSupportLibraryWebkitVersion[] = "androidx-webkit-version";
...@@ -28,6 +29,7 @@ const char* const kWebViewCrashKeyAllowList[] = { ...@@ -28,6 +29,7 @@ const char* const kWebViewCrashKeyAllowList[] = {
kAppProcessName, kAppProcessName,
kAndroidSdkInt, kAndroidSdkInt,
kSupportLibraryWebkitVersion, kSupportLibraryWebkitVersion,
kTerminationInfo,
// process type // process type
"ptype", "ptype",
......
...@@ -22,6 +22,7 @@ extern const char kAppPackageVersionCode[]; ...@@ -22,6 +22,7 @@ extern const char kAppPackageVersionCode[];
extern const char kAppProcessName[]; extern const char kAppProcessName[];
extern const char kAndroidSdkInt[]; extern const char kAndroidSdkInt[];
extern const char kTerminationInfo[];
extern const char kSupportLibraryWebkitVersion[]; extern const char kSupportLibraryWebkitVersion[];
......
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