diff options
author | Ivan Penkov <ivanpe@chromium.org> | 2016-06-20 11:14:47 -0700 |
---|---|---|
committer | Ivan Penkov <ivanpe@chromium.org> | 2016-06-20 11:14:47 -0700 |
commit | 24f5931c5e0120982c0cbf1896641e3ef2bdd52f (patch) | |
tree | 68b24e2ded67b0cabcfb7c6e534e17640997e7b9 /src/google_breakpad/processor/minidump.h | |
parent | linux-syscall-support: pull in latest version (diff) | |
download | breakpad-24f5931c5e0120982c0cbf1896641e3ef2bdd52f.tar.xz |
Server-side workaround to handle overlapping modules.
This change is resolving an issue that was caused by the combination of:
- Android system libraries being relro packed in N+.
- Breakpad dealing with relro packed libraries in a hack way.
This is a fix for http://crbug/611824.
I also found an use-after-free issue (bug in Minidump::SeekToStreamType). I disallowed the MinidumpStreamInfo copy and assign constructors and the compiler detected another similar issue in Minidump::Print. Then I disabled the copy and assign constructors for most classes in minidump.h (just in case). There are a couple of classes where I couldn't disallow them (since assign is used). This will require a small refactor so I left it out of this CL.
R=mark@chromium.org
Review URL: https://codereview.chromium.org/2060663002 .
Diffstat (limited to 'src/google_breakpad/processor/minidump.h')
-rw-r--r-- | src/google_breakpad/processor/minidump.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h index 2b5025e4..88a3926a 100644 --- a/src/google_breakpad/processor/minidump.h +++ b/src/google_breakpad/processor/minidump.h @@ -151,6 +151,8 @@ class MinidumpStream : public MinidumpObject { // that implements MinidumpStream can compare expected_size to a // known size as an integrity check. virtual bool Read(uint32_t expected_size) = 0; + + DISALLOW_COPY_AND_ASSIGN(MinidumpStream); }; @@ -191,6 +193,8 @@ class MinidumpContext : public DumpContext { // for access to data about the minidump file itself, such as whether // it should be byte-swapped. Minidump* minidump_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpContext); }; @@ -358,6 +362,8 @@ class MinidumpThreadList : public MinidumpStream { // The list of threads. MinidumpThreads* threads_; uint32_t thread_count_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList); }; @@ -392,7 +398,14 @@ class MinidumpModule : public MinidumpObject, virtual string debug_file() const; virtual string debug_identifier() const; virtual string version() const; - virtual const CodeModule* Copy() const; + virtual CodeModule* Copy() const; + + // Getter and setter for shrink_down_delta. This is used when the address + // range for a module is shrunk down due to address range conflicts with + // other modules. The base_address and size fields are not updated and they + // should always reflect the original values (reported in the minidump). + virtual uint64_t shrink_down_delta() const; + virtual void SetShrinkDownDelta(uint64_t shrink_down_delta); // The CodeView record, which contains information to locate the module's // debugging information (pdb). This is returned as uint8_t* because @@ -501,6 +514,13 @@ class MinidumpModuleList : public MinidumpStream, virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const; virtual const CodeModules* Copy() const; + // Returns a vector of all modules which address ranges needed to be shrunk + // 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(); @@ -525,6 +545,8 @@ class MinidumpModuleList : public MinidumpStream, MinidumpModules *modules_; uint32_t module_count_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList); }; @@ -587,6 +609,8 @@ class MinidumpMemoryList : public MinidumpStream { // The list of regions. MemoryRegions *regions_; uint32_t region_count_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList); }; @@ -626,6 +650,8 @@ class MinidumpException : public MinidumpStream { MDRawExceptionStream exception_; MinidumpContext* context_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpException); }; // MinidumpAssertion wraps MDRawAssertionInfo, which contains information @@ -666,6 +692,8 @@ class MinidumpAssertion : public MinidumpStream { string expression_; string function_; string file_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpAssertion); }; @@ -719,6 +747,8 @@ class MinidumpSystemInfo : public MinidumpStream { // A string identifying the CPU vendor, if known. const string* cpu_vendor_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfo); }; @@ -752,6 +782,8 @@ class MinidumpMiscInfo : public MinidumpStream { string daylight_name_; string build_string_; string dbg_bld_str_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfo); }; @@ -784,6 +816,8 @@ class MinidumpBreakpadInfo : public MinidumpStream { bool Read(uint32_t expected_size_); MDRawBreakpadInfo breakpad_info_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpBreakpadInfo); }; // MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information @@ -854,6 +888,8 @@ class MinidumpMemoryInfoList : public MinidumpStream { MinidumpMemoryInfos* infos_; uint32_t info_count_; + + DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoList); }; // MinidumpLinuxMaps wraps information about a single mapped memory region @@ -1061,6 +1097,9 @@ class Minidump { // Print a human-readable representation of the object to stdout. void Print(); + // Is the OS Android. + bool IsAndroid(); + private: // MinidumpStreamInfo is used in the MinidumpStreamMap. It lets // the Minidump object locate interesting streams quickly, and @@ -1074,6 +1113,9 @@ class Minidump { // Pointer to the stream if cached, or NULL if not yet populated MinidumpStream* stream; + + private: + DISALLOW_COPY_AND_ASSIGN(MinidumpStreamInfo); }; typedef vector<MDRawDirectory> MinidumpDirectoryEntries; @@ -1121,6 +1163,8 @@ class Minidump { // construction or after a failed Read(); true following a successful // Read(). bool valid_; + + DISALLOW_COPY_AND_ASSIGN(Minidump); }; |