aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux
Commit message (Collapse)AuthorAgeFilesLines
* Add crash reason and address to microdumps.Tobias Sargeant2017-08-144-0/+111
| | | | | | | | | | | | This will allow us to provide the right information for webview renderer crashes. At the moment the crash information for the browser process is captured (from the debuggerd output) instead. BUG=754715 Change-Id: I409546311b6e38fe1cf804097c18d7bb2a015d83 Reviewed-on: https://chromium-review.googlesource.com/612381 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* A couple of minor fixesLeonard Mosescu2017-07-111-1/+1
| | | | | | | | | | | | | | | | 1. Fixing ExceptionHandlerTest.FirstChanceHandlerRuns: exit() is not an async-signal-safe function (http://man7.org/linux/man-pages/man7/signal-safety.7.html) 2. Fixing entry point signature in minidump_dump Changed "const char* argv[]" to "char* argv[]" to match the standard entry point signature 3. Updating .gitignore to exclude unit test artifacts Change-Id: I9662898d0bd97769621fb6476a720105821c60f0 Reviewed-on: https://chromium-review.googlesource.com/562356 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Fix asan buildsEric Holk2017-06-221-23/+23
| | | | | | | | | | | | | When rolling this into Chrome, we got compile failures due to DoNullPointerDereference being undefined but the new FirstChanceHandlerRuns tests depends on this and was still defined. The fix is to only enable the FirstChanceHandlerRuns test on non-asan builds. Bug: Change-Id: I5a3da0a21e2d0dd663ffc01137496d16905293a6 Reviewed-on: https://chromium-review.googlesource.com/544186 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add first chance exception handler APIEric Holk2017-06-193-0/+44
| | | | | | | | | | | | | | This change adds the option for Breakpad hosts to register a callback that gets the first chance to handle an exception. The handler will return true if it handled the exception and false otherwise. The primary use case is V8's trap-based bounds checking support for WebAssembly. Bug: Change-Id: I5aa5b87d1229f1cef905a00404fa2027ee86be56 Reviewed-on: https://chromium-review.googlesource.com/509994 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Merge exec and non-exec segments while merging executable bit.Peter Collingbourne2017-05-261-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bfd and gold linkers create segments like this: r/x, r/w where the r/x segment covers the start of the ELF file. lld's segments look like this: r, r/x, r/w where the r segment covers the start of the ELF file. So we cannot rely on the location of the r/x to tell where the start of the ELF is. But we can still rely on the r and r/x mappings being adjacent. So what we do is when we see an r segment followed by an r/x, merge the r into the r/x and claim that it is executable. This way, the minidump writer will continue to see a single executable segment covering the entire executable. Testing: "make check" passes when breakpad is compiled with lld compiled from trunk (requires bug fix from LLVM r303689). Also patched change into chromium and tested these builds: $ cat args.gn is_chrome_branded = true is_debug = false is_official_build = true use_lld = true allow_posix_link_time_opt = false is_cfi = false $ cat args.gn target_os = "android" target_cpu = "arm" is_debug = false is_official_build = true is_chrome_branded = true With both builds breakpad_unittests passes and chrome/chrome_modern_public_apk create good minidumps after navigating to chrome://inducebrowsercrashforrealz (checked that minidump contains stack trace entry for content::HandleDebugURL). Bug: chromium:716484 Change-Id: Ib6ed3a8420b83acf4a5962843930fb006734cb95 Reviewed-on: https://chromium-review.googlesource.com/513610 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Don't attempt to use PTRACE_GETREGS if it isn't defined.John Budorick2017-05-251-1/+5
| | | | | | | | | | | Follow up to https://chromium-review.googlesource.com/c/484479/, which does not compile on arm64. Bug: chromium:725754 Change-Id: Iaa6fbc332564909a10e2602a1026c14fb25625f4 Reviewed-on: https://chromium-review.googlesource.com/515044 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Simplify ELF parser code.Peter Collingbourne2017-05-251-5/+4
| | | | | | | | | | | | | The layout of Elf32_Nhdr and Elf64_Nhdr is the same, so remove templating and code that extracts the elfclass from the ELF file. Testing: "make check" and breakpad_unittests when patched into chromium. Bug: chromium:716484 Change-Id: I41442cfff48afc6ae1a5b604d22b67550a910376 Reviewed-on: https://chromium-review.googlesource.com/514450 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use __NR_exit_group in MinidumpWriterTest.MinidumpStacksSkippedIfRequested.John Budorick2017-05-241-10/+24
| | | | | | | | | Also adds waits for all child processes spawned in MinidumpWriterTest. Bug: 725754 Change-Id: I3248925993dede2c113ab1989b322a9d9c8f24bd Reviewed-on: https://chromium-review.googlesource.com/513480 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix race in ExceptionHandler::GenerateDump()Lars Volker2017-05-101-3/+9
| | | | | | | | | | | | | | | | | | | | | When writing a minidump on Linux, we called clone() in linux/handler/exception_handler.cc with the CLONE_FILES flag. If the parent process died while the child waited for the continuation signal, the write side of the pipe 'fdes' stayed open in the child. The child would not receive a SIGPIPE and would wait forever. To fix this, we clone without CLONE_FILES and then close the read-side of fdes in the master before the ptrace call. That way, if the master dies, the child will receive a SIGPIPE and will die, too. To test this I added a sleep() call before SendContinueSignalToChild() and then killed the master, manually observing that the child would die, too. Bug: 728 Change-Id: Ifd72de835a34e7d9852ae1a362e707fdc6c96c7e Reviewed-on: https://chromium-review.googlesource.com/464708 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Fixing breakpad on old linux kernelAndrew Ermakovich2017-04-212-29/+53
| | | | | | | | | | Try to read the trace's registers by PTRACE_GETREGS if kernel doesn't support PTRACE_GETREGSET. Bug: Change-Id: I881f3a868789747ca217f22a93370c6914881f9a Reviewed-on: https://chromium-review.googlesource.com/484479 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Treat the process stack as the top of memory for free space histograms.Tobias Sargeant2017-03-292-1/+22
| | | | | | | | | | | | | Because we can't determine the top of userspace mappable memory directly, we rely on the fact that the process stack is allocated at the top of the address space (minus some randomization). Anything after that should not count as free space. BUG=695382 Change-Id: I68453aac9732c2bd4b87236b234518068dec6640 Reviewed-on: https://chromium-review.googlesource.com/446100 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Fix ASSERT_EQUAL that should have been ASSERT_EQ.Tobias Sargeant2017-03-241-1/+1
| | | | | | | | BUG=703599 Change-Id: I5623705edc41644495aa4f2389056d255e22da8e Reviewed-on: https://chromium-review.googlesource.com/459617 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Don't generate minidump if crash thread doesn't ref principal mapping.Tobias Sargeant2017-03-232-13/+105
| | | | | | | | | | | | | If the crashing thread doesn't reference the principal mapping we can assume that not only is that thread uninteresting from a debugging perspective, the whole crash is uninteresting. In that case we should not generate a minidump at all. BUG=703599 Change-Id: Ia25bbb8adb79d04dcaf3992c3d2474f3b9b1f796 Reviewed-on: https://chromium-review.googlesource.com/457338 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* [MIPS] Get (ptrace) value of $pc for a threadGordana Cmiljanovic2017-03-221-0/+2
| | | | | | | | | This change is fixing LinuxPtraceDumperTest.SanitizeStackCopy test case. Change-Id: I1eb3becfd4b3660bc5529b5d2a5e35db0b6eb6e0 Reviewed-on: https://chromium-review.googlesource.com/458277 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Improve stack sanitization unittests.Tobias Sargeant2017-02-242-47/+73
| | | | | | | | | | | | Rather than relying on the process stack having all the things that should/shouldn't be sanitized, create synthetic stacks to test all of the important cases. BUG=664460 Change-Id: I959266390e94d6fb83ca8ef11ac19fac89e68c31 Reviewed-on: https://chromium-review.googlesource.com/446108 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Make stack sanitization elide pointers to non-executable mappings.Tobias Sargeant2017-02-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The address space of every Android Java process is approximately 50% mapped, which means that sanitization tends to be ineffective because most string fragments are plausibly pointers into some mapping. For example, the zygote on 32 bit devices has the following mappings made by dalvik and this covers all 4 byte strings starting with a character between 0x13 and 0x52 (which includes all uppercase characters up to and including 'R'). 12c00000-12d16000 12d16000-32c00000 32c00000-32c01000 32c01000-52c00000 In order to perform stack unwinding we only need pointers into the stack of the thread in question, and pointers to executable mappings. If we reduce the set of considered mappings to those mappings alone, then only ~2% of the address space is left unelided. BUG=664460 Change-Id: I1cc27821659acfb91d658f42a83a24c176505a88 Reviewed-on: https://chromium-review.googlesource.com/446500 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Use the correct PC when determining whether to skip storing a stack.Tobias Sargeant2017-02-231-5/+7
| | | | | | | | | | | | This addresses a bug in commit 049a1532 that meant that the PC of the crashing thread was always used to determine whether to include a stack, instead of using the PC of the thread in question. BUG=664460 Change-Id: Idcbd5db751e5c00941a1be28607389961c0c75d7 Reviewed-on: https://chromium-review.googlesource.com/446499 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* fix write() unused-result warningMike Frysinger2017-02-081-1/+1
| | | | | | | | | | | src/client/linux/microdump_writer/microdump_writer_unittest.cc:98:47: error: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Werror=unused-result] write(STDOUT_FILENO, identifiable_string, 0); Change-Id: I3f2305fbec0dbd1464de9aeff051e7cba2ee69a2 Reviewed-on: https://chromium-review.googlesource.com/438545 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Address post-submit review comments related to CL #430050Tobias Sargeant2017-02-072-6/+13
| | | | | | | | | | See: https://chromium-review.googlesource.com/c/430050/ BUG=664460 Change-Id: I3cbfbd5b00725bd501f06427eebd976267c4f617 Reviewed-on: https://chromium-review.googlesource.com/438444 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Remove debugging fprintf in unittest code that prevents rolling breakpadTobias Sargeant2017-02-061-1/+0
| | | | | | | | BUG=664460 Change-Id: I40d8567c659e97415db65cb308c0d39391c44353 Reviewed-on: https://chromium-review.googlesource.com/438364 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Wire up stack sanitization and skipping to WriteMinidumpTobias Sargeant2017-02-035-40/+232
| | | | | | | | | | | | This makes the parameters stored in the MinidumpDescriptor structure functional for minidumps, analogously to how they are applied to microdumps. BUG=664460 Change-Id: I7578e7a1638cea8f0445b18d4bbdaf5e0a32d808 Reviewed-on: https://chromium-review.googlesource.com/435380 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Sanitize dumped stacks to remove data that may be identifiable.Tobias Sargeant2017-01-319-62/+362
| | | | | | | | | | | | | | | In order to sanitize the stack contents we erase any pointer-aligned word that could not be interpreted as a pointer into one of the processes' memory mappings, or a small integer (+/-4096). This still retains enough information to unwind stack frames, and also to recover some register values. BUG=682278 Change-Id: I541a13b2e92a9d1aea2c06a50bd769a9e25601d3 Reviewed-on: https://chromium-review.googlesource.com/430050 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Add API to skip dump if crashing thread doesn't reference a given module (2)Tobias Sargeant2017-01-191-0/+8
| | | | | | | | | | | Follow-up CL to add relevant code to the copy constructor and assignment operator for MinidumpDescriptor BUG=664460 Change-Id: I71c0ad01d8686a9215a718cebc9d11a215ea342c Reviewed-on: https://chromium-review.googlesource.com/430711 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Add API to skip dump if crashing thread doesn't reference a given moduleTobias Sargeant2017-01-1810-62/+149
| | | | | | | | | | | | | | | | | | | | | | | | This CL makes it possible to skip a dump if the crashing thread doesn't have any pointers to a given module. The concrete use case is WebView where we would like to skip generating microdump output when webview is unreferenced by the stack and thus cannot be responsible for the crash in a way that would be debuggable. The range of interesting addresses is chosen by examining the process mappings to find the one that contains a pointer that is known to be in the right shared object (i.e. an appropriately chosen function pointer) passed from the client. If the extracted stack does not contain a pointer in this range, then we do not generate a microdump. If the stack extraction fails, we still generate a microdump (without a stack). BUG=664460 Change-Id: If19406a13168264f7751245fc39591bd6cdbf5df Reviewed-on: https://chromium-review.googlesource.com/419476 Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Fix unit tests expecting no output when a microdump is suppressed.Tobias Sargeant2016-12-121-9/+9
| | | | | | | | BUG= Change-Id: Ie4d190c68ecbd8709874a3f1ceb872b94b36914f Reviewed-on: https://chromium-review.googlesource.com/419036 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Fix sign-compare compiler warning in MicrodumpWriterTestMike Percy2016-12-101-2/+2
| | | | | | | | | | | | | | Commit 7a8980997d0e0dcf3f3a5d8ccf3c1d8c2840ea27 introduced additional tests into MicrodumpWriterTest, two of which throw warnings which break "make check" under default settings on Linux, because the Makefiles are configured with -Werror=sign-compare. This patch just makes the signedness of the assertion arguments match. Change-Id: Ib522f44205c84f91bc9b93276fad60ebbf005f60 Reviewed-on: https://chromium-review.googlesource.com/418938 Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* crash_generation: fix bad call to closeMike Frysinger2016-12-091-1/+1
| | | | | | | | | If signal_fd is -1 still, we end up calling close(-1). Not generally a problem, but it's bad form, and coverity is upset by it. Change-Id: I46f9c7ca4be7b43af5b609dd8e3f03a0700af418 Reviewed-on: https://chromium-review.googlesource.com/414544 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Log a message when microdump output is suppressed.Tobias Sargeant2016-12-071-0/+1
| | | | | | | Change-Id: I11542ea9b702055e8f0b99c26cad2fea8681bce0 Reviewed-on: https://chromium-review.googlesource.com/417824 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Do not generate a microdump if there are no webview pointers on the stack.Tobias Sargeant2016-12-013-108/+208
| | | | | | | | | | | | | | The stack interest range is passed in MicrodumpExtraInfo from the client. If the extracted stack does not contain a pointer in this range, then we assume that this is not a WebView crash, and do not generate a microdump. If the stack extraction fails, we still generate a microdump (without a stack). BUG=664460 Change-Id: Ic762497f76f074a3621c7ec88a8c20ed768b9211 Reviewed-on: https://chromium-review.googlesource.com/412781 Reviewed-by: Primiano Tucci <primiano@chromium.org>
* Comment out an unused function argumentOrgad Shaneh2016-11-291-1/+1
| | | | | | Change-Id: I09c90d496edc67d4cad3e2b99f4347dc04713bdb Reviewed-on: https://chromium-review.googlesource.com/414357 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Add process type to MicroDumpExtraInfoPrimiano Tucci2016-07-192-1/+16
| | | | | | | BUG=616774 R=primiano@chromium.org, torne@chromium.org Review URL: https://codereview.chromium.org/2087413002 .
* Recover memory mappings before writing dump on ChromeOSTing-Yuan (Leo) Huang2016-07-181-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux, breakpad relies on /proc/[pid]/maps to associate symbols from addresses. ChromeOS' hugepage implementation replaces some segments with anonymous private pages, which is a restriction of current implementation in Linux kernel at the time of writing. Thus, breakpad can no longer symbolize addresses from those text segments replaced by hugepages. This patch tries to recover the mappings. Because hugepages are always inserted in between some .text sections, it tries to infer the names and offsets of the segments, by looking at segments immediately precede and succeed them. For example, a text segment before hugepage optimization 02001000-03002000 r-xp /opt/google/chrome/chrome can be broken into 02001000-02200000 r-xp /opt/google/chrome/chrome 02200000-03000000 r-xp 03000000-03002000 r-xp /opt/google/chrome/chrome BUG=crbug.com/628040 R=mark@chromium.org Review URL: https://codereview.chromium.org/2161713002 . Patch from Ting-Yuan (Leo) Huang <laszio@chromium.org>.
* Server-side workaround to handle overlapping modules.Ivan Penkov2016-06-201-0/+2
| | | | | | | | | | | | | | This change is resolving an issue that was caused by the combination of: - Android system libraries being relro packed in N+. - Breakpad dealing with relro packed libraries in a hack way. This is a fix for http://crbug/611824. I also found an use-after-free issue (bug in Minidump::SeekToStreamType). I disallowed the MinidumpStreamInfo copy and assign constructors and the compiler detected another similar issue in Minidump::Print. Then I disabled the copy and assign constructors for most classes in minidump.h (just in case). There are a couple of classes where I couldn't disallow them (since assign is used). This will require a small refactor so I left it out of this CL. R=mark@chromium.org Review URL: https://codereview.chromium.org/2060663002 .
* linux/android: add SIGTRAP to the list of signals handled by the clientPrimiano Tucci2016-06-081-1/+1
| | | | | | | | | | | | | __builtin_trap() causes a SIGTRAP on arm64 (at least with GCC 4.9). SIGTRAP is not handled by breakpad, causing crashes induced by __builtin_trap() to be missed. Note that on x86 and arm, instead, __builtin_trap() raises a SIGILL, which is already handled by breakapd. BUG=chromium:614865 R=vapier@chromium.org Review URL: https://codereview.chromium.org/2042853002 .
* Fixing an unused-variable warning in microdump_writer.ccIvan Penkov2016-05-241-1/+0
| | | | | | | BUG=https://bugs.chromium.org/p/google-breakpad/issues/detail?id=699 R=mark@chromium.org, primiano@chromium.org Review URL: https://codereview.chromium.org/2006333002 .
* Fix stack collection with size limitLars Volker2016-05-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | src/client/linux/minidump_writer/minidump_writer.cc:273 obtains the stack info by calling GetStackInfo(). That method will return the stack base address, aligned to the bottom of the memory page that 'stack_pointer' is in. After that it will cap the size of the memory area to be copied into the minidump to 'max_stack_len', starting from the base address, if the caller requested so. This will be the case when collecting reduced stacks, as introduced by this change: https://breakpad.appspot.com/487002/ In such cases the caller will request 2048 bytes of memory. However GetStackInfo() will have aligned the base address to the page boundary, by default 4096 bytes. If the stack, which grows towards the base address from the top ends before the 2048 bytes of the first block, then we will not collect any useful part of the stack. As a fix we skip chunks of 'max_stack_len' bytes starting from the base address until the stack_pointer is actually contained in the chunk, which we will add to the minidump file. BUG=https://bugs.chromium.org/p/google-breakpad/issues/detail?id=695 R=ivanpe@chromium.org Review URL: https://codereview.chromium.org/1959643004 . Patch from Lars Volker <lv@cloudera.com>.
* Functions only called by DumpFreeSpace need to be conditionally compiled.Tobias Sargeant2016-05-231-0/+6
| | | | | | | BUG=525938 R=mark@chromium.org Review URL: https://codereview.chromium.org/2008553002 .
* Add statistics about free space to microdump format.Primiano Tucci2016-05-231-2/+141
| | | | | | | | | | | | When a crash occurs as a result of an allocation failure, it is useful to know approximately what regions of the virtual address space remain available, so that we know whether the crash should be attributed to memory fragmentation, or some other cause. BUG=525938 R=primiano@chromium.org Review URL: https://codereview.chromium.org/1796803003 .
* breakpad: fix unittest errorsYunlian Jiang2016-05-041-4/+0
| | | | | | | | | | | This fixes the unittest error caused by https://codereview.chromium.org/1884283002/ TEST=unittest passes on falco board in ChromeOS. BUG= R=vapier@chromium.org Review URL: https://codereview.chromium.org/1952083002 .
* Revert of Extend mapping merge to include reserved but unused mappings. ↵Primiano Tucci2016-04-281-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://breakpad.appspot.com/7714003) Reason for revert: It is causing breakpad crash reports to be invalid (see the associated bug). Merging empty holes in r-x mappings was originally introduced in https://breakpad.appspot.com/7714003 to deal with the first generation of relro packing, which could introduce holes within a .so mapping: [libchrome.so] [guard region] [libchrome.so] However, the logic is broken for the case of two *different* adjacent .so mappings with a guard region in the middle: [libfoo.so] [guard region] [libchrome.so] In this case the guard region is mistakenly associated with libfoo.so, but that is not the right thing to do. In fact, the second generation of rerlo packing added the guard region to prevent mmaps from overlapping and to give room for the non-zero vaddr of relro-packed libraries, which require an anticipated load bias. As the first generation of relro packing is not used anymore, there is no reason to keep this buggy code, which causes failures in decoding crashes where an arbitrary library is mapped immediately before a rerlo packed library. Original issue's description: > Extend mapping merge to include reserved but unused mappings. > > When parsing /proc/pid/maps, current code merges adjacent entries that > refer to the same library and where the start of the second is equal to > the end of the first, for example: > > 40022000-40025000 r-xp 00000000 b3:11 827 /system/lib/liblog.so > 40025000-40026000 r--p 00002000 b3:11 827 /system/lib/liblog.so > 40026000-40027000 rw-p 00003000 b3:11 827 /system/lib/liblog.so > > When the system linker loads a library it first reserves all the address > space required, from the smallest start to the largest end address, using > an anonymous mapping, and then maps loaded segments inside that reservation. > If the loaded segments do not fully occupy the reservation this leaves > gaps, and these gaps prevent merges that should occur from occurring: > > 40417000-4044a000 r-xp 00000000 b3:11 820 /system/lib/libjpeg.so > > 4044a000-4044b000 ---p 00000000 00:00 0 > 4044b000-4044c000 r--p 00033000 b3:11 820 /system/lib/libjpeg.so > 4044c000-4044d000 rw-p 00034000 b3:11 820 /system/lib/libjpeg.so > > Where the segments that follow this gap do not contain executable code > the failure to merge does not affect breakpad operation. However, where > they do then the merge needs to occur. Packing relocations in a large > library splits the executable segment into two, resulting in: > > 73b0c000-73b21000 r-xp 00000000 b3:19 786460 > /data/.../libchrome.2160.0.so > > 73b21000-73d12000 ---p 00000000 00:00 0 > 73d12000-75a90000 r-xp 00014000 b3:19 786460 > /data/.../libchrome.2160.0.so > 75a90000-75c0d000 rw-p 01d91000 b3:19 786460 > /data/.../libchrome.2160.0.so > > Here the mapping at 73d12000-75a90000 must be merged into 73b0c000-73b21000 > so that breakpad correctly calculates the base address for text. > > This change enables the full merge by also merging anonymous maps which > result from unused reservation, identified as '---p' with offset 0, and > which follow on from an executable mapping, into that executable mapping. > > BUG=chromium:394703 BUG=chromium:499747 R=primiano@chromium.org, rmcilroy@chromium.org Review URL: https://codereview.chromium.org/1923383002 .
* Switch the Linux minidump writer to use MDCVInfoELF for CV data.Ted Mielczarek2016-04-057-91/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | This preserves full build ids in minidumps, which are useful for tracking down the right version of system libraries from Linux distributions. The default build id produced by GNU binutils' ld is a 160-bit SHA-1 hash of some parts of the binary, which is exactly 20 bytes: https://sourceware.org/binutils/docs-2.26/ld/Options.html#index-g_t_002d_002dbuild_002did-292 The bulk of the changes here are to change the signatures of the FileID methods to use a wasteful_vector instead of raw pointers, since build ids can be of arbitrary length. The previous change that added support for this in the processor code preserved the return value of `Minidump::debug_identifier()` as the current `GUID+age` treatment for backwards-compatibility, and exposed the full build id from `Minidump::code_identifier()`, which was previously stubbed out for Linux dumps. This change keeps the debug ID in the `dump_syms` output the same to match. R=mark@chromium.org, thestig@chromium.org BUG= Review URL: https://codereview.chromium.org/1688743002 .
* Don't merge the mappings if their exec bit are different.Primiano Tucci2016-03-081-1/+2
| | | | | | | BUG=585534 R=primiano@chromium.org Review URL: https://codereview.chromium.org/1750033002 .
* Add an optional root prefix to Linux dumpersDominik Laskowski2016-03-077-35/+58
| | | | | | | | | | | The Linux dumpers use absolute paths for shared libraries referenced by dumps, so they fail to locate them if the crash originated in a chroot. This CL enables callers to specify a root prefix, which is prepended to mapping paths before opening them. BUG=chromium:591792 TEST=make check Review URL: https://codereview.chromium.org/1761023002/
* Ensure Linux minidump writer flushes minidump header early.Ted Mielczarek2016-02-121-11/+18
| | | | | | | | | | | | | | | | If the Linux minidump writer crashes while writing a dump, the dump might contain some useful information, but the header will be empty because TypedMDRVA's destructor flushes the data, and the header var doesn't go out of scope until the end of the `Dump` method. This fixes that problem by putting the header in a shorter block scope. We've seen this problem in some Android dumps in the wild, like: https://crash-stats.mozilla.com/report/index/cef5b777-02d1-43c2-bf40-133ab2160209 R=thestig@chromium.org BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1247978 Review URL: https://codereview.chromium.org/1696573003 .
* [mips64] Support for mips n64Mike Frysinger2016-02-064-0/+24
| | | | | | | | | | Adding remaining mips n64 support including stackwalker. BUG=None TEST=manually tested on Linux/Android R=vapier@chromium.org Review URL: https://codereview.chromium.org/1418453011 .
* Fix compilation of breakpad on Linux.Sylvain Defresne2016-01-081-2/+2
| | | | | | | | | Fix some copy/paste errors from commit 41440eaa. BUG=None R=thestig@chromium.org Review URL: https://codereview.chromium.org/1564293002 .
* Use range-based for loops in linux/minidump_writer/minidump_writer.cc.Lei Zhang2016-01-071-45/+32
| | | | | | | | Also fix lint errors. R=mark@chromium.org Review URL: https://codereview.chromium.org/1562273002 .
* Avoid comparing size_t to be < 0 on AArch64.Lei Zhang2016-01-061-2/+2
| | | | | | | | | | | | cpu_features_entries is empty on AArch64 and causes tautological-compare warning when compiling with Clang. A=dskiba@google.com Original Review: https://codereview.chromium.org/1562223002/ BUG=chromium:539781 Review URL: https://codereview.chromium.org/1566893002 .
* Fix -Wunused-function warnings in ASAN builds.Lei Zhang2015-12-301-6/+2
| | | | | | | | A=thakis@chromium.org BUG=chromium:573250 Original Review: https://codereview.chromium.org/1551963002/ Review URL: https://codereview.chromium.org/1551983002 .
* Fix file descriptor leaks in linux CrashGenerationServerMike Frysinger2015-11-111-0/+3
| | | | | | R=ted.mielczarek@gmail.com Review URL: https://codereview.chromium.org/1137423004 .