diff options
author | Joshua Peraza <jperaza@chromium.org> | 2019-06-11 11:48:14 -0700 |
---|---|---|
committer | Joshua Peraza <jperaza@chromium.org> | 2019-06-11 19:04:02 +0000 |
commit | c2467077b93523c9ab2b8a7548145201dc891328 (patch) | |
tree | 190c20f1a8628593db1aac0065852189828a32bf /src/google_breakpad/processor | |
parent | linux: fix broken tests (diff) | |
download | breakpad-c2467077b93523c9ab2b8a7548145201dc891328.tar.xz |
Enable truncation of module ranges
ELF modules are loaded in memory in several, possibly discontiguous,
segments. If the holes between segments are large enough, other things,
possibly other ELF modules may be mapped in that space. Crashpad
records the range of modules as the base address of the lowest mapped
segment to the high address of the highest mapped segment. This means
that when one module is mapped into a hole in another, it appears to
the Breakpad processor as overlapping modules. Module ranges are
relevant to the Breakpad processor during stackwalking for identifying
which module a particular program counter belongs to (i.e. mapping the
address to a module's text segment). This patch addresses this issue of
overlapping modules by truncating the range of the module with the
lower base address. A typical module's text segment is the first loaded
segment which would leave the text segment range unaffected. Module
producers can restrict the size of holes in their ELF modules with the
flag "-Wl,-z,max-page-size=4096", preventing other modules from being
mapped in their address range.
Properly contemplating ELF module address ranges would require
extensions to the minidump format to encode any holes.
crbug.com/crashpad/298
This patch also renames the concept of "shrinking down" (which
truncated the upper of two overlapping ranges) to "truncate upper".
Change-Id: I4599201f1e43918db036c390961f8b39e3af1849
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1646932
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r-- | src/google_breakpad/processor/code_modules.h | 3 | ||||
-rw-r--r-- | src/google_breakpad/processor/minidump.h | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/google_breakpad/processor/code_modules.h b/src/google_breakpad/processor/code_modules.h index 509137cb..74f113c1 100644 --- a/src/google_breakpad/processor/code_modules.h +++ b/src/google_breakpad/processor/code_modules.h @@ -101,9 +101,6 @@ class CodeModules { // down due to address range conflicts with other modules. virtual std::vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const = 0; - - // Returns true, if module address range shrink is enabled. - virtual bool IsModuleShrinkEnabled() const = 0; }; } // namespace google_breakpad diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index febdaeb7..d712cb66 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -523,9 +523,6 @@ class MinidumpModuleList : public MinidumpStream, // down due to address range conflicts with other modules. virtual vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const; - // Returns true, if module address range shrink is enabled. - virtual bool IsModuleShrinkEnabled() const; - // Print a human-readable representation of the object to stdout. void Print(); @@ -847,7 +844,6 @@ class MinidumpUnloadedModuleList : public MinidumpStream, GetModuleAtIndex(unsigned int index) const override; const CodeModules* Copy() const override; vector<linked_ptr<const CodeModule>> GetShrunkRangeModules() const override; - bool IsModuleShrinkEnabled() const override; protected: explicit MinidumpUnloadedModuleList(Minidump* minidump_); @@ -1268,6 +1264,10 @@ class Minidump { // Is the OS Android. bool IsAndroid(); + // Determines the platform where the minidump was produced. |platform| is + // valid iff this method returns true. + bool GetPlatform(MDOSPlatform* platform); + // Get current hexdump display settings. unsigned int HexdumpMode() const { return hexdump_ ? hexdump_width_ : 0; } |