mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-02 04:34:47 +01:00
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>
This commit is contained in:
parent
c2d969cb10
commit
833cadc0a1
10 changed files with 149 additions and 62 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 µdump_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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue