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 .
This commit is contained in:
Ivan Penkov 2016-06-20 11:14:47 -07:00
parent 67f738b7ad
commit 24f5931c5e
18 changed files with 239 additions and 39 deletions

View file

@ -48,6 +48,7 @@
#include "google_breakpad/processor/memory_region.h"
#include "google_breakpad/processor/symbol_supplier.h"
#include "google_breakpad/processor/system_info.h"
#include "processor/linked_ptr.h"
class MockMemoryRegion: public google_breakpad::MemoryRegion {
public:
@ -114,9 +115,11 @@ class MockCodeModule: public google_breakpad::CodeModule {
string debug_file() const { return code_file_; }
string debug_identifier() const { return code_file_; }
string version() const { return version_; }
const google_breakpad::CodeModule *Copy() const {
google_breakpad::CodeModule *Copy() const {
abort(); // Tests won't use this.
}
virtual uint64_t shrink_down_delta() const { return 0; }
virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
private:
uint64_t base_address_;
@ -126,11 +129,11 @@ class MockCodeModule: public google_breakpad::CodeModule {
};
class MockCodeModules: public google_breakpad::CodeModules {
public:
public:
typedef google_breakpad::CodeModule CodeModule;
typedef google_breakpad::CodeModules CodeModules;
void Add(const MockCodeModule *module) {
void Add(const MockCodeModule *module) {
modules_.push_back(module);
}
@ -157,9 +160,19 @@ class MockCodeModules: public google_breakpad::CodeModules {
return modules_.at(index);
}
const CodeModules *Copy() const { abort(); } // Tests won't use this.
CodeModules *Copy() const { abort(); } // Tests won't use this
private:
virtual std::vector<google_breakpad::linked_ptr<const CodeModule> >
GetShrunkRangeModules() const {
return std::vector<google_breakpad::linked_ptr<const CodeModule> >();
}
// Returns true, if module address range shrink is enabled.
bool IsModuleShrinkEnabled() const {
return false;
}
private:
typedef std::vector<const MockCodeModule *> ModuleVector;
ModuleVector modules_;
};