aboutsummaryrefslogtreecommitdiff
path: root/src/processor/stackwalker_x86_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-52/+52
| | | | | | | | | | 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>
* Provide initial EBX value to FPO frame data evaluatorScott Graham2016-10-141-2/+139
| | | | | | | | | | | | | EBX is sometimes used in "WIN FRAME 4" programs. Not providing the initial value was causing the evaluation in some frames of ntdll, resulting in a fallback to scanning and a failed stack walk. R=mark@chromium.org BUG=chromium:651453 Change-Id: I94a8184e1eed72b0d0e3212fe323fbdd10d56da5 Reviewed-on: https://chromium-review.googlesource.com/398059 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Increasing the Breakpad stack walker max scan limit from 30 to 40.Ivan Penkov2015-10-051-3/+3
| | | | | | | | | | | | | | | | | | | | | Chrome started hitting some crashes in v8 jitted code which happens to be non ABI compliant and debuggers (including WinDBG) are unable to produce meaningful stack traces. The Breakpad stack walker has some builtin heuristics to deal with such cases. More specifically, when unable to find a good parent frame, it scans the raw stack to find a suitable parent frame. The max scan size was set at 30 pointers which was (apparently) not enough to recover in this case. I'm increasing it to 40 pointers. I confirmed that at 34 pointers it was able to recover however I'm setting it to 40 in order to it some slack. I needed to update two unittests which were expecting the previous scan limit. BUG= R=mark@chromium.org Review URL: https://codereview.chromium.org/1379433005 .
* Use register %ebp (instead of %esp) when calculating the value ofivan.penkov@gmail.com2013-11-051-5/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .raSearchStart in the cases where there are alignment operators in the program string. If alignment operators are found in the program string, the current value of %ebp must be valid and it is the only reliable data point that can be used for getting to the previous frame. Previously, the .raSearchStart calculation was based on %esp and when %esp is aligned in the current frame (which is a lossy operation) the resulting .raSearchStart cannot was incorrect. There is code that is trying to work around this problem (scanning of up to 3 words for a return address) which is unreliable and it doesn't work in many cases (e.g. when the alignment is on a 64-byte boundary). This fix is already deployed in Google and it was measured to reduce the number of wrong stack traces (for Windows crashes) by 45%. No regressions have been found so far. Here is an example of an issue that was fixed by this change (where register %esp is aligned on the 64-byte boundary and the workarounds that we already had didn't work): https://code.google.com/p/chromium/issues/detail?id=311359 0:013> uf chrome_59630000!base::MessagePumpForIO::DoRunLoop 518 59685c39 55 push ebp 518 59685c3a 8bec mov ebp,esp 518 59685c3c 83e4c0 and esp,0FFFFFFC0h <== 64-byte boundary 518 59685c3f 83ec34 sub esp,34h 518 59685c42 53 push ebx 518 59685c43 56 push esi Program string contains 64-byte alignment: $T1 .raSearch = $T0 $T1 4 - 64 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + = $20 $T0 56 - ^ = $23 $T0 60 - ^ = $24 $T0 64 - ^ = Review URL: https://breakpad.appspot.com/694002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1232 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/+56
| | | | | | 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-28/+116
| | | | | | | | | | | | | | | | | | | | | 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
* More robust stack walks when the IP address in the context frame is invalid ↵ivan.penkov@gmail.com2013-06-261-82/+307
| | | | | | | | | | | | | (or not in a known module). This is achieved by: 1. Extending the span of the scan for return address in the conext frame. Initially, I wanted to extend the span of the scan for all frames but then I noticed that there is code for ARM already that is extending the search only for the context frame. This kind of makes sense so I decided to reuse the same idea everywhere. 2. Attempting to restore the EBP chain after a successful scan for return address so that the stackwalker can switch back to FRAME_TRUST_CFI for the rest of the frames when possible. I also fixed the lint errors in the files touched. Review URL: https://breakpad.appspot.com/605002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1193 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-16/+57
| | | | | | | | 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-2/+2
| | | | | | 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/+17
| | | | | | r=mkrebs at https://breakpad.appspot.com/413002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1077 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Wrong %ebp after skipping a frame for which the instruction pointer is not ↵ivan.penkov@gmail.com2012-11-021-0/+234
| | | | | | | | | | in a known module. http://breakpad.appspot.com/494002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1076 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor the logic of resolving source line info into helper class.SiyangXie@gmail.com2012-10-101-14/+29
| | | | | | | 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
* This is a fix for a stackwalker_x86 issue which has toivan.penkov@gmail.com2012-06-121-295/+507
| | | | | | | | | | do with FPO (frame-pointer-omission) optimized context frames where the context frame represents a Windows System call stub. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@971 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Support for .raSearch in the x86 stackwalkermark@chromium.org2012-02-231-0/+61
| | | | | | | Patch by Benjamin Smedberg <bsmedberg@gmail.com> git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@927 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some apparently longstanding crash bugs in Stackwalker implementations ↵ted.mielczarek2011-01-241-1/+21
| | | | | | | | 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
* Double stack scanning length in stackwalkerted.mielczarek2010-10-191-0/+57
| | | | | | R=jimb at http://breakpad.appspot.com/215001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@715 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
* Refactor some bits of StackWalkerX86 / StackFrameX86 out into their ↵ted.mielczarek2010-10-011-19/+19
| | | | | | | | 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: Add minidump processor support for DWARF Call Frame Information.jimblandy2010-03-161-20/+209
| | | | | | | | | | | | | | | | | | | | | | | | Add a CFIFrameInfo class (named for symmetry with WindowsFrameInfo) to represent the set of STACK CFI rules in effect at a given instruction, and apply them to a set of register values. Provide a SimpleCFIWalker class template, to allow the essential CFI code to be shared amongst the different architectures. Teach BasicSourceLineResolver to partially parse 'STACK CFI' records, and produce the set of rules in effect at a given instruction on demand, by combining the initial rule set and the appropriate rule deltas in a CFIFrameInfo object. Adapt StackwalkerX86 and StackFrameX86 to retrieve, store, and apply CFI stack walking information. Add validity flags for all the general-purpose registers to StackFrameX86::ContextValidity. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@549 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Unit tests for StackwalkerX86.jimblandy2010-03-161-0/+704
Issue 53001 (http://breakpad.appspot.com/53001) defines the TestAssembler classes; those, along with a new set of mock classes defined in stackwalker_unittest_utils.h, make it possible for us to actually do proper unit testing of a stack walker. These tests get us full code coverage for stackwalker_x86.cc. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@548 4c0a9323-5329-0410-9bdc-e9ce6186880e