Apply some breakpad patches to generate better symbol files and process more minidumps

This commit is contained in:
Asher Baker 2019-01-13 12:55:39 +00:00
parent 6faeace858
commit 53a6f29ab7
4 changed files with 109 additions and 0 deletions

View File

@ -20,10 +20,15 @@ cmd /c depot_tools\fetch --nohooks breakpad
@IF %errorlevel% neq 0 EXIT /b %errorlevel%
GOTO DONESRC
:HASSRC
git -C src checkout origin/master
@IF %errorlevel% neq 0 EXIT /b %errorlevel%
cmd /c depot_tools\gclient sync --nohooks
@IF %errorlevel% neq 0 EXIT /b %errorlevel%
:DONESRC
git -C src am -3 ../../patches/*.patch
@IF %errorlevel% neq 0 EXIT /b %errorlevel%
@IF EXIST gyp\NUL GOTO HASGYP
git clone --depth=1 --branch=master https://chromium.googlesource.com/external/gyp.git gyp
@IF %errorlevel% neq 0 EXIT /b %errorlevel%

View File

@ -14,9 +14,12 @@ fi
if [ ! -d "src" ]; then
PYTHONDONTWRITEBYTECODE=1 python2.7 ./depot_tools/fetch.py --nohooks breakpad
else
git -C src checkout origin/master
PYTHONDONTWRITEBYTECODE=1 python2.7 ./depot_tools/gclient.py sync --nohooks
fi
git -C src am -3 ../../patches/*.patch
if [ ! -d "build" ]; then
mkdir build
fi

View File

@ -0,0 +1,51 @@
From 58a7ad704435fa7c7c401683cdf4bcad5f67718d Mon Sep 17 00:00:00 2001
From: Asher Baker <asherkin@limetech.io>
Date: Sun, 13 Jan 2019 12:34:45 +0000
Subject: [PATCH 1/2] Ignore invalid modules rather than bailing on the entire
module list
---
src/processor/minidump.cc | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index afc5f038..63d4a426 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -2766,7 +2766,7 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
BPLOG(ERROR) << "MinidumpModuleList could not read required module "
"auxiliary data for module " <<
module_index << "/" << module_count;
- return false;
+ continue;
}
// It is safe to use module->code_file() after successfully calling
@@ -2778,7 +2778,14 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
BPLOG(ERROR) << "MinidumpModuleList found bad base address for module "
<< module_index << "/" << module_count << ", "
<< module.code_file();
- return false;
+ continue;
+ }
+
+ if (module_size == static_cast<uint32_t>(-1)) {
+ BPLOG(ERROR) << "MinidumpModuleList found bad size for module "
+ << module_index << "/" << module_count << ", "
+ << module.code_file();
+ continue;
}
// Some minidumps have additional modules in the list that are duplicates.
@@ -2805,7 +2812,7 @@ bool MinidumpModuleList::Read(uint32_t expected_size) {
<< module_index << "/" << module_count << ", "
<< module.code_file() << ", " << HexString(base_address)
<< "+" << HexString(module_size);
- return false;
+ continue;
}
// If failed due to apparent range overlap the cause may be the client
--
2.17.2

View File

@ -0,0 +1,50 @@
From 372a974415a35dac48fdef49a774f8d974734ea6 Mon Sep 17 00:00:00 2001
From: Asher Baker <asherkin@limetech.io>
Date: Sun, 13 Jan 2019 12:35:05 +0000
Subject: [PATCH 2/2] Write FUNC records instead of PUBLIC for ELF symbols with
sizes
---
src/common/linux/elf_symbols_to_module.cc | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/common/linux/elf_symbols_to_module.cc b/src/common/linux/elf_symbols_to_module.cc
index 562875e1..e11a5265 100644
--- a/src/common/linux/elf_symbols_to_module.cc
+++ b/src/common/linux/elf_symbols_to_module.cc
@@ -156,19 +156,28 @@ bool ELFSymbolsToModule(const uint8_t *symtab_section,
while(!iterator->at_end) {
if (ELF32_ST_TYPE(iterator->info) == STT_FUNC &&
iterator->shndx != SHN_UNDEF) {
- Module::Extern *ext = new Module::Extern(iterator->value);
- ext->name = SymbolString(iterator->name_offset, strings);
+ string name = SymbolString(iterator->name_offset, strings);
#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
int status = 0;
char* demangled =
- abi::__cxa_demangle(ext->name.c_str(), NULL, NULL, &status);
+ abi::__cxa_demangle(name.c_str(), NULL, NULL, &status);
if (demangled) {
if (status == 0)
- ext->name = demangled;
+ name = demangled;
free(demangled);
}
#endif
+#if 1
+ if (iterator->size) {
+ Module::Function *fun = new Module::Function(name, iterator->value);
+ fun->ranges.push_back(Module::Range(iterator->value, iterator->size));
+ module->AddFunction(fun);
+ }
+#else
+ Module::Extern *ext = new Module::Extern(iterator->value);
+ ext->name = name;
module->AddExtern(ext);
+#endif
}
++iterator;
}
--
2.17.2