From 30d41ec2436a6499b7293c20ba4c80d741badf38 Mon Sep 17 00:00:00 2001 From: "wfh@chromium.org" Date: Sat, 20 Dec 2014 00:47:07 +0000 Subject: [PATCH] Modify minidump_stackwalk to be more tolerant of overlapping ranges. These ranges can be seen in some Android minidumps. BUG=chromium:439531 R=mark@chromium.org Review URL: https://breakpad.appspot.com/9744002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1412 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/minidump.cc | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 8ae260d5..6b0389b8 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -2548,12 +2548,26 @@ bool MinidumpModuleList::Read(uint32_t expected_size) { } 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); - return false; + // Android's shared memory implementation /dev/ashmem can contain + // duplicate entries for JITted code, so ignore these. + // TODO(wfh): Remove this code when Android is fixed. + // See https://crbug.com/439531 + 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; + } else { + BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " << + module_index << "/" << module_count << ", " << + module->code_file() << ", " << + HexString(base_address) << "+" << + HexString(module_size); + } } }