Commit 66bc013d authored by tobiasjs's avatar tobiasjs Committed by Commit bot

Revert of Do not generate a microdump if there are no webview pointers on the...

Revert of Do not generate a microdump if there are no webview pointers on the stack. (patchset #6 id:100001 of https://codereview.chromium.org/2552753002/ )

Reason for revert:
Revert in preparation for modifying breakpad to infer the interest
region from mappings rather than being explicitly informed.

Linux ld.so refuses to relocate absolutely addressed symbols at offset 0,
causing the use of __executable_start to fail at load time on that platform.
We will need to find a better way to determine the extent of the text
section.

Original issue's description:
> Do not generate a microdump if there are no webview pointers on the stack.
>
> To determine the webview text section address range, we use the linker
> defines symbols __executable_start and __etext. These are passed to
> breakpad in the microdump extra info struct, causing it to not generate
> a microdump if the stack of the crashing thread does not contain a
> pointer into this region.
>
> BUG=664460
>
> Committed: https://crrev.com/19f0a50c6eab29917f459557b10cafc70428a4a2
> Committed: https://crrev.com/aca68a011a9fd116972e329871f67c73ca8ca389
> Cr-Original-Commit-Position: refs/heads/master@{#437003}
> Cr-Commit-Position: refs/heads/master@{#437234}

TBR=primiano@chromium.org,torne@chromium.org,rsesek@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=664460

Review-Url: https://codereview.chromium.org/2565353004
Cr-Commit-Position: refs/heads/master@{#438150}
parent 2e324fe8
...@@ -154,10 +154,6 @@ void AddGpuFingerprintToMicrodumpCrashHandler( ...@@ -154,10 +154,6 @@ void AddGpuFingerprintToMicrodumpCrashHandler(
breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint); breakpad::AddGpuFingerprintToMicrodumpCrashHandler(gpu_fingerprint);
} }
void SetWebViewTextAddrRange(uintptr_t start, uintptr_t end) {
breakpad::SetNativeCodeTextAddrRange(start, end);
}
bool DumpWithoutCrashingToFd(int fd) { bool DumpWithoutCrashingToFd(int fd) {
return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd); return g_crash_reporter_client.Pointer()->DumpWithoutCrashingToFd(fd);
} }
......
...@@ -14,7 +14,6 @@ void EnableMicrodumpCrashReporter(const std::string& process_type, ...@@ -14,7 +14,6 @@ void EnableMicrodumpCrashReporter(const std::string& process_type,
int crash_signal_fd); int crash_signal_fd);
void AddGpuFingerprintToMicrodumpCrashHandler( void AddGpuFingerprintToMicrodumpCrashHandler(
const std::string& gpu_fingerprint); const std::string& gpu_fingerprint);
void SetWebViewTextAddrRange(uintptr_t start, uintptr_t end);
bool DumpWithoutCrashingToFd(int fd); bool DumpWithoutCrashingToFd(int fd);
} // namespace crash_reporter } // namespace crash_reporter
} // namespace android_webview } // namespace android_webview
......
...@@ -46,21 +46,6 @@ ...@@ -46,21 +46,6 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/events/gesture_detection/gesture_configuration.h"
// These declarations just provide the addresses determined by the
// linker to this source file in order to determine the extent of the
// webview text section. The declared types are irrelevant - only the
// symbol names and the addresses they reference are important.
extern "C" {
#if defined(ARCH_CPU_MIPSEL)
// the mipsel linker script invoked as a result of chromium link args
// doesn't define __executable_start.
extern char _ftext;
#else
extern char __executable_start;
#endif
extern char __etext;
}
namespace android_webview { namespace android_webview {
namespace { namespace {
...@@ -224,15 +209,7 @@ int AwMainDelegate::RunProcess( ...@@ -224,15 +209,7 @@ int AwMainDelegate::RunProcess(
// crash handler on the same thread as the crash handler was initialized. // crash handler on the same thread as the crash handler was initialized.
crash_reporter::AddGpuFingerprintToMicrodumpCrashHandler( crash_reporter::AddGpuFingerprintToMicrodumpCrashHandler(
content_client_.gpu_fingerprint()); content_client_.gpu_fingerprint());
#if !defined(COMPONENT_BUILD)
crash_reporter::SetWebViewTextAddrRange(
#if defined(ARCH_CPU_MIPSEL)
reinterpret_cast<uintptr_t>(&_ftext),
#else
reinterpret_cast<uintptr_t>(&__executable_start),
#endif
reinterpret_cast<uintptr_t>(&__etext));
#endif
g_allow_wait_in_ui_thread.Get().reset( g_allow_wait_in_ui_thread.Get().reset(
new ScopedAllowWaitForLegacyWebViewApi); new ScopedAllowWaitForLegacyWebViewApi);
......
...@@ -110,11 +110,7 @@ class MicrodumpInfo { ...@@ -110,11 +110,7 @@ class MicrodumpInfo {
MicrodumpInfo() MicrodumpInfo()
: microdump_build_fingerprint_(nullptr), : microdump_build_fingerprint_(nullptr),
microdump_product_info_(nullptr), microdump_product_info_(nullptr),
microdump_gpu_fingerprint_(nullptr), microdump_gpu_fingerprint_(nullptr) {}
microdump_process_type_(nullptr),
interest_range_start_(0ul),
interest_range_end_(0ul),
suppress_microdump_based_on_interest_range_(false) {}
// The order in which SetGpuFingerprint and Initialize are called // The order in which SetGpuFingerprint and Initialize are called
// may be dependent on the timing of the availability of GPU // may be dependent on the timing of the availability of GPU
...@@ -130,7 +126,6 @@ class MicrodumpInfo { ...@@ -130,7 +126,6 @@ class MicrodumpInfo {
// which a microdump is generated, then the GPU fingerprint will be // which a microdump is generated, then the GPU fingerprint will be
// UNKNOWN. // UNKNOWN.
void SetGpuFingerprint(const std::string& gpu_fingerprint); void SetGpuFingerprint(const std::string& gpu_fingerprint);
void SetMicrodumpInterestRange(uintptr_t start, uintptr_t end);
void Initialize(const std::string& process_type, void Initialize(const std::string& process_type,
const char* product_name, const char* product_name,
const char* product_version, const char* product_version,
...@@ -142,9 +137,6 @@ class MicrodumpInfo { ...@@ -142,9 +137,6 @@ class MicrodumpInfo {
const char* microdump_product_info_; const char* microdump_product_info_;
const char* microdump_gpu_fingerprint_; const char* microdump_gpu_fingerprint_;
const char* microdump_process_type_; const char* microdump_process_type_;
uintptr_t interest_range_start_;
uintptr_t interest_range_end_;
bool suppress_microdump_based_on_interest_range_;
}; };
base::LazyInstance<MicrodumpInfo> g_microdump_info = base::LazyInstance<MicrodumpInfo> g_microdump_info =
...@@ -880,22 +872,6 @@ void MicrodumpInfo::SetGpuFingerprint(const std::string& gpu_fingerprint) { ...@@ -880,22 +872,6 @@ void MicrodumpInfo::SetGpuFingerprint(const std::string& gpu_fingerprint) {
} }
} }
void MicrodumpInfo::SetMicrodumpInterestRange(uintptr_t start, uintptr_t end) {
interest_range_start_ = start;
interest_range_end_ = end;
suppress_microdump_based_on_interest_range_ = true;
if (g_microdump) {
MinidumpDescriptor descriptor(g_microdump->minidump_descriptor());
google_breakpad::MicrodumpExtraInfo* microdump_extra_info =
descriptor.microdump_extra_info();
microdump_extra_info->interest_range_start = interest_range_start_;
microdump_extra_info->interest_range_end = interest_range_end_;
microdump_extra_info->suppress_microdump_based_on_interest_range = true;
g_microdump->set_minidump_descriptor(descriptor);
}
}
void MicrodumpInfo::Initialize(const std::string& process_type, void MicrodumpInfo::Initialize(const std::string& process_type,
const char* product_name, const char* product_name,
const char* product_version, const char* product_version,
...@@ -910,36 +886,31 @@ void MicrodumpInfo::Initialize(const std::string& process_type, ...@@ -910,36 +886,31 @@ void MicrodumpInfo::Initialize(const std::string& process_type,
process_type == kBrowserProcessType; process_type == kBrowserProcessType;
MinidumpDescriptor descriptor(MinidumpDescriptor::kMicrodumpOnConsole); MinidumpDescriptor descriptor(MinidumpDescriptor::kMicrodumpOnConsole);
google_breakpad::MicrodumpExtraInfo* microdump_extra_info =
descriptor.microdump_extra_info();
if (product_name && product_version) { if (product_name && product_version) {
microdump_product_info_ = microdump_product_info_ =
strdup((product_name + std::string(":") + product_version).c_str()); strdup((product_name + std::string(":") + product_version).c_str());
ANNOTATE_LEAKING_OBJECT_PTR(microdump_product_info_); ANNOTATE_LEAKING_OBJECT_PTR(microdump_product_info_);
microdump_extra_info->product_info = microdump_product_info_; descriptor.microdump_extra_info()->product_info = microdump_product_info_;
} }
microdump_process_type_ = microdump_process_type_ =
strdup(process_type.empty() ? kBrowserProcessType : process_type.c_str()); strdup(process_type.empty() ? kBrowserProcessType : process_type.c_str());
ANNOTATE_LEAKING_OBJECT_PTR(microdump_process_type_); ANNOTATE_LEAKING_OBJECT_PTR(microdump_process_type_);
microdump_extra_info->process_type = microdump_process_type_; descriptor.microdump_extra_info()->process_type = microdump_process_type_;
if (android_build_fp) { if (android_build_fp) {
microdump_build_fingerprint_ = strdup(android_build_fp); microdump_build_fingerprint_ = strdup(android_build_fp);
ANNOTATE_LEAKING_OBJECT_PTR(microdump_build_fingerprint_); ANNOTATE_LEAKING_OBJECT_PTR(microdump_build_fingerprint_);
microdump_extra_info->build_fingerprint = microdump_build_fingerprint_; descriptor.microdump_extra_info()->build_fingerprint =
microdump_build_fingerprint_;
} }
if (microdump_gpu_fingerprint_) { if (microdump_gpu_fingerprint_) {
microdump_extra_info->gpu_fingerprint = microdump_gpu_fingerprint_; descriptor.microdump_extra_info()->gpu_fingerprint =
microdump_gpu_fingerprint_;
} }
microdump_extra_info->interest_range_start = interest_range_start_;
microdump_extra_info->interest_range_end = interest_range_end_;
microdump_extra_info->suppress_microdump_based_on_interest_range =
suppress_microdump_based_on_interest_range_;
g_microdump = g_microdump =
new ExceptionHandler(descriptor, nullptr, MicrodumpCrashDone, new ExceptionHandler(descriptor, nullptr, MicrodumpCrashDone,
reinterpret_cast<void*>(is_browser_process), reinterpret_cast<void*>(is_browser_process),
...@@ -1963,10 +1934,6 @@ void AddGpuFingerprintToMicrodumpCrashHandler( ...@@ -1963,10 +1934,6 @@ void AddGpuFingerprintToMicrodumpCrashHandler(
const std::string& gpu_fingerprint) { const std::string& gpu_fingerprint) {
g_microdump_info.Get().SetGpuFingerprint(gpu_fingerprint); g_microdump_info.Get().SetGpuFingerprint(gpu_fingerprint);
} }
void SetNativeCodeTextAddrRange(uintptr_t start, uintptr_t end) {
g_microdump_info.Get().SetMicrodumpInterestRange(start, end);
}
#endif // OS_ANDROID #endif // OS_ANDROID
bool IsCrashReporterEnabled() { bool IsCrashReporterEnabled() {
......
...@@ -31,11 +31,6 @@ extern void InitMicrodumpCrashHandlerIfNecessary( ...@@ -31,11 +31,6 @@ extern void InitMicrodumpCrashHandlerIfNecessary(
extern void AddGpuFingerprintToMicrodumpCrashHandler( extern void AddGpuFingerprintToMicrodumpCrashHandler(
const std::string& gpu_fingerprint); const std::string& gpu_fingerprint);
// Inform breakpad of the extent of the text section that is
// considered interesting for the purpose of crashes so that this can
// be used to elide crashes that do not reference interesting code.
extern void SetNativeCodeTextAddrRange(uintptr_t start, uintptr_t end);
#endif #endif
// Checks if crash reporting is enabled. Note that this is not the same as // Checks if crash reporting is enabled. Note that this is not the same as
......
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