Do not crash if the minidump is missing a module list

This commit is contained in:
Asher Baker 2019-01-06 14:29:44 +00:00
parent cfc925acff
commit 7aeabf23b5
2 changed files with 32 additions and 2 deletions

View File

@ -743,6 +743,21 @@ class UploadThread: public IThread
return kPRLocalError;
}
// Minidumps missing a module list are basically useless
if (!processState.modules()) {
return kPRLocalError;
}
std::string os_short = "";
std::string cpu_arch = "";
if (processState.system_info()) {
os_short = processState.system_info()->os_short;
if (os_short.empty()) {
os_short = processState.system_info()->os;
}
cpu_arch = processState.system_info()->cpu;
}
int requestingThread = processState.requesting_thread();
if (requestingThread == -1) {
requestingThread = 0;
@ -759,7 +774,7 @@ class UploadThread: public IThread
}
std::ostringstream summaryStream;
summaryStream << 2 << "|" << processState.time_date_stamp() << "|" << processState.system_info()->os_short << "|" << processState.system_info()->cpu << "|" << processState.crashed() << "|" << processState.crash_reason() << "|" << std::hex << processState.crash_address() << std::dec << "|" << requestingThread;
summaryStream << 2 << "|" << processState.time_date_stamp() << "|" << os_short << "|" << cpu_arch << "|" << processState.crashed() << "|" << processState.crash_reason() << "|" << std::hex << processState.crash_address() << std::dec << "|" << requestingThread;
std::map<const google_breakpad::CodeModule *, unsigned int> moduleMap;

View File

@ -175,6 +175,21 @@ int main(int argc, char *argv[])
continue;
}
// Minidumps missing a module list are basically useless
if (!processState.modules()) {
continue;
}
std::string os_short = "";
std::string cpu_arch = "";
if (processState.system_info()) {
os_short = processState.system_info()->os_short;
if (os_short.empty()) {
os_short = processState.system_info()->os;
}
cpu_arch = processState.system_info()->cpu;
}
int requestingThread = processState.requesting_thread();
if (requestingThread == -1) {
requestingThread = 0;
@ -191,7 +206,7 @@ int main(int argc, char *argv[])
}
std::ostringstream summaryStream;
summaryStream << 2 << "|" << processState.time_date_stamp() << "|" << processState.system_info()->os_short << "|" << processState.system_info()->cpu << "|" << processState.crashed() << "|" << processState.crash_reason() << "|" << std::hex << processState.crash_address() << std::dec << "|" << requestingThread;
summaryStream << 2 << "|" << processState.time_date_stamp() << "|" << os_short << "|" << cpu_arch << "|" << processState.crashed() << "|" << processState.crash_reason() << "|" << std::hex << processState.crash_address() << std::dec << "|" << requestingThread;
std::map<const CodeModule *, unsigned int> moduleMap;