Reviewers: ,
Description:
I'm not sure if this patch is really something we want to take, but we
started seeing some minidumps with missing stack memory for a few
threads (we're writing minidumps of the Flash player's sandboxed
subprocess without its cooperation, so there's probably some issues
there). This patch lets us get stacks for the threads that work. In
general I think getting some data out of a dump is better than nothing,
but as-implemented this kind of sucks because it just drops thraeds
without stack memory on the floor.
Please review this at
http://breakpad.appspot.com/413002/
Affected files:
M src/processor/minidump.cc
M src/processor/minidump_processor.cc
Index: src/processor/minidump.cc
===================================================================
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -1317,22 +1317,21 @@ bool MinidumpThread::Read() {
// Check for base + size overflow or undersize.
if (thread_.stack.memory.data_size == 0 ||
thread_.stack.memory.data_size > numeric_limits<u_int64_t>::max() -
thread_.stack.start_of_memory_range) {
BPLOG(ERROR) << "MinidumpThread has a memory region problem, " <<
HexString(thread_.stack.start_of_memory_range) << "+"
<<
HexString(thread_.stack.memory.data_size);
- return false;
+ } else {
+ memory_ = new MinidumpMemoryRegion(minidump_);
+ memory_->SetDescriptor(&thread_.stack);
}
- memory_ = new MinidumpMemoryRegion(minidump_);
- memory_->SetDescriptor(&thread_.stack);
-
valid_ = true;
return true;
}
MinidumpMemoryRegion* MinidumpThread::GetMemory() {
if (!valid_) {
BPLOG(ERROR) << "Invalid MinidumpThread for GetMemory";
Index: src/processor/minidump_processor.cc
===================================================================
--- a/src/processor/minidump_processor.cc
+++ b/src/processor/minidump_processor.cc
@@ -187,17 +187,17 @@ ProcessResult MinidumpProcessor::Process
MinidumpContext *ctx = exception->GetContext();
context = ctx ? ctx : thread->GetContext();
}
}
MinidumpMemoryRegion *thread_memory = thread->GetMemory();
if (!thread_memory) {
BPLOG(ERROR) << "No memory region for " << thread_string;
- return PROCESS_ERROR_NO_MEMORY_FOR_THREAD;
+ continue;
}
// Use process_state->modules_ instead of module_list, because the
// |modules| argument will be used to populate the |module| fields in
// the returned StackFrame objects, which will be placed into the
// returned ProcessState object. module_list's lifetime is only as
// long as the Minidump object: it will be deleted when this function
// returns. process_state->modules_ is owned by the ProcessState
object