aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Extract the exception record from the minidumpJoshua Peraza2020-01-033-0/+148
| | | | | | Change-Id: Ia622560960513e24b21184532f2272a09b9cdc95 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1986339 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* ios: build for arm64eJoshua Peraza2020-01-032-3/+20
| | | | | | | | | | | | | | When __DARWIN_OPAQUE_ARM_THREAD_STATE64 is set (by default when building for arm64e), fp, lr, sp, pc, and flags (but not x or cpsr) in thread state are prepended with "__opaque" and intended to be accessed via supplied getters which may also authenticate pointers. We don't want to authenticate those pointers (since we expect they may be invalid and want to recover those invalid values) so access them directly. Bug: b/140375065 Change-Id: Ibe6c1dbfb5d68a9d350614445fa06d48873f8549 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1986868 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add dwarf5 compilation-unit header handling.Sterling Augustine2019-12-195-18/+105
| | | | | | | | Fix a small typo in DW_LANG__Python. Change-Id: I1fe54e501a5e8da5057ecc9ac00c7e7259a9bb3f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1967975 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add new dwarf 5 enums, plus some dwarf4 enums.Sterling Augustine2019-12-121-0/+221
| | | | | | Change-Id: Ibe0b529664dd48a423cb453b786d08c5b7abec19 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1965462 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Enable reading DWARF4 CIEs with 32 bit addresses.Nelson Billing2019-12-053-18/+53
| | | | | | | | | | | | | - Reading DWARF4 CIEs was added in https://chromium-review.googlesource.com/c/breakpad/breakpad/+/406012 but it was only enabled for 64bit builds, since it would error out if the CIE address size was not 8 bytes. - Added a unit test to ensure that 32bit continues to work. Change-Id: I824bb40cdf12056d39da335adb55ed315970fb88 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1941034 Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* dump_syms: handle forward reference DWARF attributesMark Mentovai2019-12-022-13/+35
| | | | | | | | | | | | | | | | | | | | | | | DW_AT_specification and DW_AT_abstract_origin attributes carry references to other DIEs. Nothing prevents the DIEs referred to from appearing later in .debug_info than the DIE containing the referring attribute, but dump_syms incompletly implemented its handling of these references, and was only able to resolve them when they were back-references. This will fix the chronic warnings produced by dump_syms of the form: dump_syms: the DIE at offset <offset> has a {DW_AT_specification, DW_AT_abstract_origin} attribute referring to the die at offset <offset>, which either was not marked as {a declaration, an inline}, or comes later in the file Patch by Greg Clayton Bug: breakpad:441 Change-Id: I98957d64a234c22afb6d0153f1bdc09e6a600b1d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1946706 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix compilation of http_upload.cc with Windows gccJon Turney2019-11-221-34/+34
| | | | | | | | | | | | | Fix compilation of http_upload.cc with Windows gcc after 548ca6e3, by moving the definition of GetFileContents(), so it comes after the definition of WideToMBCP(), which it uses (under !_MSC_VER). common/windows/http_upload.cc: In function ‘bool {anonymous}::GetFileContents(const wstring&, std::vector<char>*)’: common/windows/http_upload.cc:80:19: error: ‘WideToMBCP’ was not declared in this scope Change-Id: I1646b39263e97bbf3bd8cb1ae209be238023110f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1928929 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* mac processor: Add mapping for EXC_BAD_ACCESS/KERN_CODESIGN_ERRORMark Mentovai2019-11-222-0/+5
| | | | | | | | | | This code indicates termination under “kill” semantics due to a module’s code signature becoming invalid. Bug: chromium:1023239 Change-Id: I3d453af9ef6c6925edcf9c08dbd78e563877522f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1930177 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Remove dependency of uploader.mm on GTMLoggerSylvain Defresne2019-11-121-12/+12
| | | | | | | | | | | | | | | The file GTMLogger shipped with breakpad is a copy of the version from google_toolbox_for_mac. Having uploader.mm depend on GTMLogger causes pain to iOS projects that want to integrate both breakpad and google_toolbox_for_mac. Since the file uploader.mm mixed uses of fprintf and GTMLogger to log errors and warning, convert it to only use fprintf to stderr. Bug: none Change-Id: I68313ccf6951676a2859f44225281813722096ba Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1911755 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add fallthrough annotations on new C++ switchesChristopher Grant2019-11-053-41/+100
| | | | | | | | | | | | A recent commit converted some source from C to C++. Chrome has checks against unannotated switch case fallthroughs in C++ code, so the converted source needs annotations. Bug: 990190 Change-Id: Ib92435b4877be936f837928a70b552ec4975d42a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1898429 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Revert "Remove use of "register" keyword, deprecated in C++17"Mark Mentovai2019-11-011-1/+1
| | | | | | | | | | | | | | This reverts commit 07411862eaa9a9a38e84caed2e97e836e456656f. We were a bit overzealous in removing “register” here. Both clang and GCC correctly disallow “register” as a storage class specifier in C++17 mode by producing an error in ordinary use. However, they require “register” to be specified for explicit register variables, and do not produce an error in this case. Change-Id: I223f2652c6da4215d6e8788d902e767c94b8c29d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1894875 Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux, client: set module name from DT_SONAMEJoshua Peraza2019-10-302-24/+32
| | | | | | | | | | | | | | | | | | 3e56ef9d changed dump_syms to set the module name from DT_SONAME expecting that clients were already using DT_SONAME when it was present. The Breakpad client previously only used DT_SONAME as the name for a module if it detected that it was likely mapped from a zip file. This patch updates the Breakpad Linux client to always use the DT_SONAME in minidumps if it's present. Also included are changes to address comments that were missed from that review. Bug: 1016924 Change-Id: I4aae8c05e6793d4b0598049a8964ddd4cb0c6194 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1889231 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* linux, dump_syms: Make style consistent in module unittestChristopher Grant2019-10-291-63/+63
| | | | | | | | | | | | | | | Make the following consistent within the file: - 0x...ULL for unsigned literals. - On pointers, put the asterisk with the type. Context: Made a previous change and saw a mix of styles. Make it consistent for the sake of visual consistency. Bug: None Change-Id: I0f80aedc0ca0295be3c70bd88822cbb82d0415ba Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1888434 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* linux, dump_syms: Filter module entries outside specified rangesChristopher Grant2019-10-294-0/+120
| | | | | | | | | | | | | | | | | | | | Partitioned libraries generated with lld and llvm-objcopy currently contain a superset of debug information, beyond what applies to the library itself. This is because objcopy cannot split up debug information by partition - instead, it places a copy of all debug information into each partition. In lieu of potential future support for lld or objcopy becoming able to split up debug information, let dump_syms do the next best thing: - Find the address ranges of all PT_LOAD segments in the lib. - Supply these to the Module being generated. - Filter additions to the Module based on these ranges. Bug: 990190 Change-Id: Ib5f279f42e3f6ea79eed9665efbcc23c3c5d25dc Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1884699 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Add options to set OS and filenameJake Ehrlich2019-10-244-26/+73
| | | | | | | | | This allows Fuchsia to use dump_syms directly without a postprocessing step. Change-Id: I84507f8bedddfcdcdb237119457c8ddf8ac354d5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1850718 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* linux, dump_syms: set module name from DT_SONAMEJoshua Peraza2019-10-244-44/+78
| | | | | | | | | | | | | The Breakpad and Crashpad clients will use an object's DT_SONAME as the name for a module if it exists. Previously, linux dump_syms would assume the basename of an input elf file matches that value, causing symbol lookups to fail if they were mismatched. This patch updates dump_syms to use DT_SONAME as the module name, if present. Bug: 1016924 Change-Id: I5eff0cf06c703841df3fb552cb5a8e1e50a20c64 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1876763 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* convert_UTF: rewrite in C++Mike Frysinger2019-09-045-22/+31
| | | | | | | | | This allows us to namespace the symbols properly. Bug: google-breakpad:725 Change-Id: Iea8052547eef6c0acb299c1995781735c6d8994f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1769236 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Remove use of "register" keyword, deprecated in C++17Mark Mentovai2019-08-121-1/+1
| | | | | | | | | | "register" as a storage class specifier has been deprecated since C++11, and has been removed from C++17 while remaining a reserved word. See C++17 5.11 and C.4.3. Change-Id: I2dbab8a7061cb680d902644d39ea1a7fbc930e5c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1749329 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Mac dump_syms: accept __DWARF segment without __debug_info sectionMark Mentovai2019-08-072-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | A .dSYM may validly contain a __DWARF segment without any __debug_info section. This can occur for Chromium Framework in a component build of Chromium, because in that case, all of the code is in other libraries that Chromium Framework depends on. This was previously tested by an assertion, but the assertion did not trigger in NDEBUG (release) builds. In NDEBUG builds, this condition would lead to an out-of-bounds read, detected by AddressSanitizer. Instead of an assertion, the check is now always done at runtime. Instead of being fatal, it's now just a warning, because it's been established that __DWARF without __debug_info can occur. (In the Chromium case, it remains pointless to run dump_syms via the "chrome_dump_syms" target on a component build, as it'll only attempt to symbolize Chromium Framework, and not any of the libraries that Chromium Framework depends on that actually contain the code.) Bug: chromium:991206 Change-Id: I6c9c75f0be7901813e3eaae54aff38c1afe73ca9 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1741610 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* string_conversion: fix pointer mathMike Frysinger2019-08-053-2/+67
| | | | | | | | | | | | | | | | | | | | | | | Since target_ptr is of type uint16_t* already, we don't need to scale the byte count as the language does that for us. If it were void*, we would need this code, but it's not. In practice it's probably not a big deal due to how we preallocated memory: when converting UTF8->UTF16, we'd reserve the same number of code units, and UTF8 takes more code units per codepoint than UTF16, so the UTF16 vector is always oversized. When converting UTF32->UTF16, we also reserve the same number of code units, but since one UTF32 code unit could require two UTF16 code units (for U+10000 codepoints and higher), we would probably corrupt memory in the process. The APIs in this module don't seem to take into account that range in general, so for now I'm only fixing the memory corruption. Bug: google-breakpad:768 Change-Id: Ibfaea4e866733ff8d99b505e72c500bd40d11a74 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1732888 Reviewed-by: Mark Mentovai <mark@chromium.org>
* guid_creater: include string.h for memcpyMike Frysinger2019-08-041-0/+1
| | | | | | | Bug: google-breakpad:779 Change-Id: If0cfb036ee924178033c89d4dc3e2ce75ddd46f2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1732887 Reviewed-by: Mark Mentovai <mark@chromium.org>
* minidump_processor: fix typo in BUS_ADRALNMike Frysinger2019-08-041-1/+1
| | | | | | | Bug: google-breakpad:787 Change-Id: I9f7144b3456abb750142eae9f989133bf4f27885 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1734586 Reviewed-by: Mark Mentovai <mark@chromium.org>
* arm64: strip PACs from link register valuesJoshua Peraza2019-07-232-1/+33
| | | | | | | | | | | | | | | | | | | | | | Pointer authentication codes are used to validate pointers against accidental or malicious modification by storing a hash of the address and a secret value in the pointer's unused, upper bits. The exact bits used may vary by implementation and depend on the size of the virtual address space of the target system, and whether other tagged pointer features are in use. Apple has implemented PACs in the Apple A12. https://developer.apple.com/documentation/security/preparing_your_app_to_work_with_pointer_authentication The documented method of stripping PACs from a pointer is to call ptrauth_strip(), which ultimately emits an `xpaci` instruction, but this option isn't available to the Breakpad processor not running on the device. Instead, this patch selects likely address bits from link register values by examining the address range of loaded modules. Change-Id: I054bd1a03605719937fc85dcc8d8b9fe927f44be Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1713650 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Improving the support for Fuchsia in Breakpad Processor.Ivan Penkov2019-07-125-7/+124
| | | | | | | | Now decoding the OS name and exception codes for Fuchsia. Still not decoding exception flags (can be added later, if needed). Change-Id: If66cb000828be18f0c1b35d1b1f52b3ca3e1fd67 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1699049 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Remove base_logging::LogMessageMark Mentovai2019-07-121-13/+1
| | | | | | | | | | | This is deprecated in the downstream consumer that it was introduced to support. This undoes b41ad66e93562. Change-Id: I3e0fa068b134014700128d1d75cae6a20d591d12 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1687125 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix Windows symupload after PE-only MD refactor.Nelson Billing2019-07-011-1/+1
| | | | | | | | | - I think I previously fixed this for dump_syms, but must have missed the symupload one because it didn't have a gn target. Change-Id: Ibf4daa0dc874f329c2ee7c7b3d4de1ee6bc68d13 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1682717 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Explicitly LoadLibrary dbghelp.dll in symbol converter.Nelson Billing2019-06-281-0/+54
| | | | | | | | | | | | | | | | | | - This is a workaround to an issue with gn/clang build of Windows symbol converter where dbghelp.dll is loaded from system32/syswow64 instead of alongside the process exe. - Why do we care where dbghelp.dll is loaded from? Two considerations: 1. dbghelp.dll will only load symsrv.dll from the directory where it resides. 2. symsrv.dll requires a file called "symsrv.yes" to be in the directory where it resides in order to work with MS symbol stores. Therefore if we load dbghelp.dll from syswow64, then we must also ensure there is a symsrv.dll and symsrv.yes file in syswow64. Change-Id: Ia283a2c11e276c855a48157aa7be77897af4b02e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1680670 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix clang build warnings/errors for windows symbol converter.Nelson Billing2019-06-274-26/+25
| | | | | | Change-Id: Ib7f6e37af1466b5bed3e7d2921e0d9774394ad1e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1680056 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix windows symbol converter blacklisting.Nelson Billing2019-06-251-2/+3
| | | | | | | | - Was attempting "full match" when we meant to do "partial match". Change-Id: Ia748a7fc8707e11f44c205e57f218f5f4bbc5612 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1676936 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix dump_syms clang Windows build.Nelson Billing2019-06-253-23/+13
| | | | | | | | | - Put FileHeaderMachineToCpuString definition in header. - Remove extra semi-colon. Change-Id: I726ad0f73c57908576414fd828052dff09f5c51f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1673142 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix breakpad client build.Nelson Billing2019-06-241-1/+1
| | | | | | | | - Was broken by a rename in http upload util code. Change-Id: I72c275fe45638c83e535901e79817893b00ee62e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1673138 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Add PE-only MD support to Windows symbol converter.Nelson Billing2019-06-2412-56/+314
| | | | | | | | | | | | | | | | - Only 64-bit PEs supported. - Re-add some scripts that were missed in initial move of code. - Change msdia120.dll dependency to msdia140.dll. - Add tests for Intel, AMD, and NVidia Microsoft Symbol Stores. - Windows symbol converter now attempts to fall back to PE-only metadata when it fails to locate a PDB. - Remove the 'binary' folder under converter_exe. Need to think more about how a deployment should look and what tool(s) to use in creating one. Change-Id: I52e42cbe5e759874a25114c2483e8b50d73fdf77 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1670098 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix 'debug_file' in PESourceLineWriter.Nelson Billing2019-06-193-15/+29
| | | | | | | | | | | - Add a #define to testing.gyp to avoid warnings about TR1 deprecation. - PESourceLineWriter now reads debug_file from CodeView record instead of using code_file value. - Updated PE-only MD reading unit test. Change-Id: Ib4e6201df3e3fd651e160f310584b5a67b16c842 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1668347 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix symbol converter after PE-only MD refactor.Nelson Billing2019-06-182-2/+2
| | | | | | Change-Id: Ib6d3359f6a8ad7e0d2c2d6a4e92af37bc451db28 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1666353 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix common_windows.gyp.Nelson Billing2019-06-183-1/+1
| | | | | | | | | - Rename two files from '.cpp' to '.cc' and insert missing comma in between lines in source files list. Change-Id: I169a738b565f52292cb0292b34c4397e9dc05370 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1666351 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Move Windows Symbol Converter to breakpadNelson Billing2019-06-1821-0/+3056
| | | | | | | | | | - First step, this is just enough to get it generating a msbuild project with GYP, which in turn can build the executable. - Tests need to be redesigned because there isn't an available server. Change-Id: I45440fd32b3ede29666c127703bcd441f0e4288e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1661134 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Mac upload_system_symbols: make dump of /Library/QuickTime optionalMark Mentovai2019-06-181-4/+16
| | | | | | | | /Library/QuickTime is gone in 10.15b2 19A487l. Change-Id: I927350a9cb383b93e8b18aef5f36c77bb67fede1 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1663996 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Mac upload_system_symbols: use log.Fatalf where formatting is desiredMark Mentovai2019-06-181-7/+7
| | | | | | Change-Id: I5623da3109feeb4b80137fa67501b8fd7aa5c8ec Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1663995 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Enable PE-only metadata dumping for 64bit (aka. PE32+ format) PEs files.Nelson Billing2019-06-1212-328/+1020
| | | | | | | | | | | | | | | | | - Implement in common_windows_lib-- added class "PESourceLineWriter". - Add command-line switch to tell dump_syms to use PESourceLineWriter. Symbol data created this way will contain information to correlate the module with ones found in minidumps, along with frame info that allows much higher quality stack-walking in those minidumps. - Significant refactor of PDBSourceLineWriter-- all code concerned with extracting metadata from PE files has been moved into utility functions. This is to allow sharing of this functionality with newly- added PESourceLineWriter. - Added a unit test to dump_syms for the PE-only scenario. Change-Id: If0855f05d424d32d23f484995be5f34232179a37 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1525325 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Port new symbol upload API to Windows symupload tool.Nelson Billing2019-06-126-385/+853
| | | | | | | | | - CL for Linux change, including new documentation for API, at: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1422400/3 Change-Id: I579744fec74c64757b8bc31de63d7a07ef9a0f1f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1487982 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Removed unused includes/declarationsJoshua Peraza2019-06-112-4/+0
| | | | | | Change-Id: I2ada9f96efe97c25c885eef561af725418a46bec Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1652667 Reviewed-by: Mark Mentovai <mark@chromium.org>
* fix build failuresJoshua Peraza2019-06-114-0/+4
| | | | | | Change-Id: I9e745d2a4b3f780941ba286bbafa5d4169d172f7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1653863 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Enable truncation of module rangesJoshua Peraza2019-06-1112-108/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ELF modules are loaded in memory in several, possibly discontiguous, segments. If the holes between segments are large enough, other things, possibly other ELF modules may be mapped in that space. Crashpad records the range of modules as the base address of the lowest mapped segment to the high address of the highest mapped segment. This means that when one module is mapped into a hole in another, it appears to the Breakpad processor as overlapping modules. Module ranges are relevant to the Breakpad processor during stackwalking for identifying which module a particular program counter belongs to (i.e. mapping the address to a module's text segment). This patch addresses this issue of overlapping modules by truncating the range of the module with the lower base address. A typical module's text segment is the first loaded segment which would leave the text segment range unaffected. Module producers can restrict the size of holes in their ELF modules with the flag "-Wl,-z,max-page-size=4096", preventing other modules from being mapped in their address range. Properly contemplating ELF module address ranges would require extensions to the minidump format to encode any holes. crbug.com/crashpad/298 This patch also renames the concept of "shrinking down" (which truncated the upper of two overlapping ranges) to "truncate upper". Change-Id: I4599201f1e43918db036c390961f8b39e3af1849 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1646932 Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux: fix broken testsJoshua Peraza2019-06-042-4/+4
| | | | | | | | Fixes errors for comparisons between signed and unsigned ints. Change-Id: I7ef151ba84a48a0c8cc449cfaf12b9fef775d5a7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1642361 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix a build break with SDK 10.14.Ivan Penkov2019-05-291-2/+2
| | | | | | | | | | | | * Updated the minimal target version from 10.5 to 10.7. * Reference for the similar issue: https://github.com/uglide/RedisDesktopManager/issues/4284 Fix provided by Hiroyuki Komatsu. Change-Id: Ie08f8f6084e66d439d8b6282f1f4734b2dfe778f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1633390 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix orphaned crash reports.John Z Wu2019-05-151-1/+13
| | | | | | | | | | | The path NSCachesDirectory may change across app updates and sometimes even across app launches. As a result, the Config-XXX files may end up with an outdated path to the associated minidump file. Change-Id: I0befde26b2ac406c154ce7c7e9be0063ee99892d Bug:850379 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1592561 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Increase timeout of HTTPMultipartUpload from 10s to 60s.John Z Wu2019-05-131-1/+1
| | | | | | | | | | | | | | | This, hopefully, will reduce occurrences of UnfinishedReportUploads. It will not eliminate it completely because uploads are never retried if they fail. 60s is actually the default value. Before iOS6, 240s was the default and minimum applied to requests with a body. Reference: https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1414063-timeoutinterval?language=objc Bug:850379 Change-Id: I2f16fda7d7e8cbb8b8a6fc917111d9f646fbdad0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1609876 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Linux breakpad_unittests: fix ThreadSanitizer problemsMark Mentovai2019-04-265-9/+52
| | | | | | | | | | | | | | | | Some tests were failing because they had expectations about the number of threads in a process, but TSan, and in some cases, ASan, introduce their own threads. Where a sanitizer affects this, the expectations are now used as minimum thread counts, not exact thread counts. See https://www.brooklinen.com/blogs/brookliving/best-thread-count-for-sheets. These problems were detected by ThreadSanitizer at https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8915151099544583616/+/steps/breakpad_unittests__with_patch_/0/stdout Bug: chromium:949098 Change-Id: Ie40f1766bea27e9bcb112bf9e0b8b846fb343012 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1585948 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Linux MinidumpWriter: fix stack-use-after-scope violationMark Mentovai2019-04-261-2/+4
| | | | | | | | | | | | | | | | | | One form of google_breakpad::WriteMinidump() passed MappingList and AppMemoryList objects by reference to a MinidumpWriter object, instantiating them directly as constructor parameters. The MinidumpWriter stored these objects internally as references, and the underlying objects went out of scope after MinidumpWriter construction. The MinidumpWriter outlived them, causing a violation on any attempt to access them following construction. This bug was detected by AddressSanitizer at https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8915150848087289472/+/steps/breakpad_unittests__with_patch_/0/stdout Bug: chromium:949098 Change-Id: I072ea9f1b64e1eae3e89d4a2b158764ff7970db5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1585946 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* [Breakpad iOS] Add a callback on report upload completion.Olivier Robin2019-04-236-23/+88
| | | | | | | | | | | | | This CL adds a result callback on report upload completion. On failure, Breakpad deletes the configuration file and does retry to upload a report. Using this callback, the client will be able to log some metrics and to act on upload failure. Bug: 954175 Change-Id: I95a3264b65d4c06ba5d8dde8377440d23f1e2081 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1572661 Reviewed-by: Mark Mentovai <mark@chromium.org>