aboutsummaryrefslogtreecommitdiff
path: root/src/processor/stackwalker_amd64_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-23/+23
| | | | | | | | | | We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
* fix build failuresJoshua Peraza2019-06-111-0/+1
| | | | | | Change-Id: I9e745d2a4b3f780941ba286bbafa5d4169d172f7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1653863 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Sanity check frame pointer while stackwalkingJoshua Peraza2017-03-221-1/+2
| | | | | | | | BUG= Change-Id: Ib9b0fd5ba7f829f8be8cf856ab371c6540279ee5 Reviewed-on: https://chromium-review.googlesource.com/458526 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Make x86-64 frame pointer unwinding stricterTed Mielczarek2016-04-191-51/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The x86-64 frame pointer-based unwind method will accept values that aren't valid for the frame pointer register and the return address. This fixes it to reject non-8-byte-aligned frame pointers, as well as non-canonical addresses for the return address it finds. A colleague of mine asked me why Breakpad gave a bad stack for a crash in our crash-stats system: https://crash-stats.mozilla.com/report/index/a472c842-2c7b-4ca7-a267-478cf2160405 Digging in, it turns out that the function in frame 0 is a leaf function, so MSVC doesn't generate an entry in the unwind table for it, so dump_syms doesn't produce a STACK CFI entry for it in the symbol file. The stackwalker tries frame pointer unwinding, and %rbp is set to a value that sort-of works, so it produces a garbage frame 1 and then is lost. Either of the two checks in this patch would have stopped the stackwalker from using the frame pointer. It's possible we could do something smarter on the dump_syms side, like enumerating all functions and outputing some default STACK CFI rule for those that don't have unwind info, but that wouldn't fix crashes from existing builds without re-dumping symbols for them. In any event, these checks should always pass for valid frame pointer-using functions. R=mark@chromium.org BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1263001 Review URL: https://codereview.chromium.org/1902783002 .
* Issue in StackwalkerAMD64::GetCallerByFramePointerRecovery.Ivan Penkov2015-10-151-0/+132
| | | | | | | | | | | | | | There is an issue in StackwalkerAMD64::GetCallerByFramePointerRecovery. Occasionally it produces invalid frames (instruction pointer == 0) which prevents the AMD64 stack walker from proceeding to do stack scanning and instead leads to premature termination of the stack walking process. For more details: http://crbug/537444 BUG= R=mark@chromium.org Review URL: https://codereview.chromium.org/1408973002 .
* Add frame pointer recovery to the AMD64 Stackwalker.rsesek@chromium.org2014-07-181-1/+1
| | | | | | | | | BUG=https://code.google.com/p/chromium/issues/detail?id=393594 R=mark@chromium.org Review URL: https://breakpad.appspot.com/10664002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1350 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow setting a limit on the number of frames to be recovered by stack scanning.ted.mielczarek@gmail.com2013-08-191-0/+66
| | | | | | Patch by Julian Seward <jseward@acm.org> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=894264 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1206 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Detect corrupt symbol files during minidump processing. Recover from the ↵ivan.penkov@gmail.com2013-07-111-10/+33
| | | | | | | | | | | | | | | | | | | | | errors and use the good data if possible. More specifically: - Detect corrupt symbols during minidump processing and provide the list of modules with corrupt symbols in the ProcessState. This will allow listing the corrupt symbol files in the final crash report. - Skip and recover from symbol data parse errors - don't give up until 100 parse errors are seen. - In order to recover from '\0' (null terminator) in the middle of a symbol file, a couple of methods have to be updated to require both buffer pointer and length. Previously they required only a buffer pointer (char *) and the size of the buffer was evaluated using strlen which is not reliable when the data is corrupt. Most of the changes are due to these signature updates. - Added and updated unittests. Also, updated minidump_stackwalk to show a WARNING for corrupt symbols. Output looks like this: ... Loaded modules: 0x000da000 - 0x000dafff Google Chrome Canary ??? (main) 0x000e0000 - 0x0417dfff Google Chrome Framework 0.1500.0.3 (WARNING: Corrupt symbols, Google Chrome Framework, 4682A6B4136436C4BFECEB62D498020E0) 0x044a8000 - 0x04571fff IOBluetooth 0.1.0.0 ... Review URL: https://breakpad.appspot.com/613002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1200 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Avoid gmock warning "Uninteresting mock function call"ted.mielczarek@gmail.com2013-05-171-0/+5
| | | | | | Patch by Michael Krebs <mkrebs@chromium.org>, R=me at https://breakpad.appspot.com/397002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1183 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Keeping track of modules without symbols during crash report processing.ivan.penkov@gmail.com2013-03-061-7/+28
| | | | | | | | http://breakpad.appspot.com/534002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1126 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use stdint types everywhereted.mielczarek@gmail.com2013-03-061-6/+6
| | | | | | R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow processing dumps with missing stack memory for some threadsted.mielczarek@gmail.com2012-11-061-0/+18
| | | | | | r=mkrebs at https://breakpad.appspot.com/413002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1077 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor the logic of resolving source line info into helper class.SiyangXie@gmail.com2012-10-101-10/+17
| | | | | | | http://breakpad.appspot.com/459002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1068 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fixing a mem leak in test codeivan.penkov@gmail.com2012-06-291-3/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@975 4c0a9323-5329-0410-9bdc-e9ce6186880e
* This change allows compiling the google-breakpad code using a global ↵ivan.penkov@gmail.com2012-06-281-1/+1
| | | | | | ::string class instead of std::string. For more details take a look at common/using_std_string.h git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
* In the AMD64 stackwalker, use heuristics to provide %rbp more often, asjimblandy2012-04-251-5/+82
| | | | | | | | | | subsequent frames are usually unable to use CFI if they don't have an %rbp value. a=mrmiller, r=jimb git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@960 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some apparently longstanding crash bugs in Stackwalker implementations ↵ted.mielczarek2011-01-241-3/+25
| | | | | | | | when resolver is NULL. R=mark at http://breakpad.appspot.com/257001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@761 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor source line resolver, add interface in supplier and resolver.SiyangXie@gmail.com2010-10-071-3/+6
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@711 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add stack-scanning fallback to Stackwalker{AMD64,ARM}.ted.mielczarek2010-10-011-0/+123
| | | | | | R=jimb at http://breakpad.appspot.com/206001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@704 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor some bits of StackWalkerX86 / StackFrameX86 out into their ↵ted.mielczarek2010-10-011-0/+2
| | | | | | | | respective parent classes so they can be used by other architecture implementations. R=jimb at http://breakpad.appspot.com/205001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@703 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix unit tests that have not built since @610ted.mielczarek2010-07-231-3/+3
| | | | | | | A=kmixter R=ted http://breakpad.appspot.com/132001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@629 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad test support: Move test_assembler.{h,cc} from src/processor to ↵jimblandy2010-04-271-1/+1
| | | | | | | | | | | | | | src/common. The google_breakpad::TestAssembler classes are used in both the processor's and the Linux dumper's test suites, and will soon be used in the Mac dumper's tests as well. This patch moves their source files from src/processor to src/common. a=jimblandy, r=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@574 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Support AMD64 stack unwinding driven by DWARF CFI.jimblandy2010-03-161-0/+334
This adds support for 'STACK CFI' records (DWARF CFI) to the AMD64 stack walker. This is necessary for the stack trace to include any frames other than the youngest. Unit tests are included. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@554 4c0a9323-5329-0410-9bdc-e9ce6186880e