Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: src/processor/minidump.cc

Issue 1275173005: Workaround for range map overlaps caused by Android package relocation. (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/processor/minidump.cc
===================================================================
--- src/processor/minidump.cc (revision 1462)
+++ src/processor/minidump.cc (working copy)
@@ -2517,6 +2517,7 @@
// MinidumpModule::ReadAuxiliaryData seeks around, and if it were
// included in the loop above, additional seeks would be needed where
// none are now to read contiguous data.
+ uint64_t last_end_address = 0;
for (unsigned int module_index = 0;
module_index < module_count;
++module_index) {
@@ -2554,12 +2555,29 @@
const string kDevAshmem("/dev/ashmem/");
if (module->code_file().compare(
0, kDevAshmem.length(), kDevAshmem) != 0) {
- BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
- module_index << "/" << module_count << ", " <<
- module->code_file() << ", " <<
- HexString(base_address) << "+" <<
- HexString(module_size);
- return false;
+ if (base_address < last_end_address) {
+ // If failed due to apparent range overlap the cause may be
+ // the client correction applied for Android packed relocations.
+ // If this is the case, back out the client correction and retry.
+ module_size -= last_end_address - base_address;
+ base_address = last_end_address;
+ if (!range_map_->StoreRange(base_address,
+ module_size, module_index)) {
+ BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
+ module_index << "/" << module_count << ", " <<
+ module->code_file() << ", " <<
+ HexString(base_address) << "+" <<
+ HexString(module_size) << ", after adjusting";
+ return false;
+ }
+ } else {
+ BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
+ module_index << "/" << module_count << ", " <<
+ module->code_file() << ", " <<
+ HexString(base_address) << "+" <<
+ HexString(module_size);
+ return false;
+ }
} else {
BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " <<
module_index << "/" << module_count << ", " <<
@@ -2568,6 +2586,7 @@
HexString(module_size);
}
}
+ last_end_address = base_address + module_size;
}
modules_ = modules.release();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698