aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/handler
diff options
context:
space:
mode:
authorTobias Sargeant <tobiasjs@google.com>2017-01-18 15:19:51 +0000
committerTobias Sargeant <tobiasjs@chromium.org>2017-01-18 15:41:07 +0000
commit833cadc0a11f0a061cc8057ee56debe89e412973 (patch)
treeeea313877d37bac5564fc4ea2e9bb9bbb8d14e16 /src/client/linux/handler
parentAdded classes to support reading unloaded module lists in minidumps. (diff)
downloadbreakpad-833cadc0a11f0a061cc8057ee56debe89e412973.tar.xz
Add API to skip dump if crashing thread doesn't reference a given module
This CL makes it possible to skip a dump if the crashing thread doesn't have any pointers to a given module. The concrete use case is WebView where we would like to skip generating microdump output when webview is unreferenced by the stack and thus cannot be responsible for the crash in a way that would be debuggable. The range of interesting addresses is chosen by examining the process mappings to find the one that contains a pointer that is known to be in the right shared object (i.e. an appropriately chosen function pointer) passed from the client. If the extracted stack does not contain a pointer in this range, then we do not generate a microdump. If the stack extraction fails, we still generate a microdump (without a stack). BUG=664460 Change-Id: If19406a13168264f7751245fc39591bd6cdbf5df Reviewed-on: https://chromium-review.googlesource.com/419476 Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Primiano Tucci <primiano@chromium.org>
Diffstat (limited to 'src/client/linux/handler')
-rw-r--r--src/client/linux/handler/exception_handler.cc2
-rw-r--r--src/client/linux/handler/microdump_extra_info.h14
-rw-r--r--src/client/linux/handler/minidump_descriptor.h43
3 files changed, 42 insertions, 17 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index c8cb768a..8565bbb0 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -592,6 +592,8 @@ bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
context,
context_size,
mapping_list_,
+ minidump_descriptor_.skip_dump_if_principal_mapping_not_referenced(),
+ minidump_descriptor_.address_within_principal_mapping(),
*minidump_descriptor_.microdump_extra_info());
}
if (minidump_descriptor_.IsFD()) {
diff --git a/src/client/linux/handler/microdump_extra_info.h b/src/client/linux/handler/microdump_extra_info.h
index 40cba1c4..bf01f0c7 100644
--- a/src/client/linux/handler/microdump_extra_info.h
+++ b/src/client/linux/handler/microdump_extra_info.h
@@ -40,23 +40,11 @@ struct MicrodumpExtraInfo {
const char* gpu_fingerprint;
const char* process_type;
- // |interest_range_start| and |interest_range_end| specify a range
- // in the target process address space. Microdumps are only
- // generated if the PC or a word on the captured stack point into
- // this range, or |suppress_microdump_based_on_interest_range| is
- // false.
- bool suppress_microdump_based_on_interest_range;
- uintptr_t interest_range_start;
- uintptr_t interest_range_end;
-
MicrodumpExtraInfo()
: build_fingerprint(NULL),
product_info(NULL),
gpu_fingerprint(NULL),
- process_type(NULL),
- suppress_microdump_based_on_interest_range(false),
- interest_range_start(0),
- interest_range_end(0) {}
+ process_type(NULL) {}
};
}
diff --git a/src/client/linux/handler/minidump_descriptor.h b/src/client/linux/handler/minidump_descriptor.h
index 782a60a4..f601427c 100644
--- a/src/client/linux/handler/minidump_descriptor.h
+++ b/src/client/linux/handler/minidump_descriptor.h
@@ -53,14 +53,18 @@ class MinidumpDescriptor {
MinidumpDescriptor()
: mode_(kUninitialized),
fd_(-1),
- size_limit_(-1) {}
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false) {}
explicit MinidumpDescriptor(const string& directory)
: mode_(kWriteMinidumpToFile),
fd_(-1),
directory_(directory),
c_path_(NULL),
- size_limit_(-1) {
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false) {
assert(!directory.empty());
}
@@ -68,14 +72,18 @@ class MinidumpDescriptor {
: mode_(kWriteMinidumpToFd),
fd_(fd),
c_path_(NULL),
- size_limit_(-1) {
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false) {
assert(fd != -1);
}
explicit MinidumpDescriptor(const MicrodumpOnConsole&)
: mode_(kWriteMicrodumpToConsole),
fd_(-1),
- size_limit_(-1) {}
+ size_limit_(-1),
+ address_within_principal_mapping_(0),
+ skip_dump_if_principal_mapping_not_referenced_(false) {}
explicit MinidumpDescriptor(const MinidumpDescriptor& descriptor);
MinidumpDescriptor& operator=(const MinidumpDescriptor& descriptor);
@@ -101,6 +109,23 @@ class MinidumpDescriptor {
off_t size_limit() const { return size_limit_; }
void set_size_limit(off_t limit) { size_limit_ = limit; }
+ uintptr_t address_within_principal_mapping() const {
+ return address_within_principal_mapping_;
+ }
+ void set_address_within_principal_mapping(
+ uintptr_t address_within_principal_mapping) {
+ address_within_principal_mapping_ = address_within_principal_mapping;
+ }
+
+ bool skip_dump_if_principal_mapping_not_referenced() {
+ return skip_dump_if_principal_mapping_not_referenced_;
+ }
+ void set_skip_dump_if_principal_mapping_not_referenced(
+ bool skip_dump_if_principal_mapping_not_referenced) {
+ skip_dump_if_principal_mapping_not_referenced_ =
+ skip_dump_if_principal_mapping_not_referenced;
+ }
+
MicrodumpExtraInfo* microdump_extra_info() {
assert(IsMicrodumpOnConsole());
return &microdump_extra_info_;
@@ -132,6 +157,16 @@ class MinidumpDescriptor {
off_t size_limit_;
+ // This member points somewhere into the main module for this
+ // process (the module that is considerered interesting for the
+ // purposes of debugging crashes).
+ uintptr_t address_within_principal_mapping_;
+
+ // If set, threads that do not reference the address range
+ // associated with |address_within_principal_mapping_| will not have their
+ // stacks logged.
+ bool skip_dump_if_principal_mapping_not_referenced_;
+
// The extra microdump data (e.g. product name/version, build
// fingerprint, gpu fingerprint) that should be appended to the dump
// (microdump only). Microdumps don't have the ability of appending