Commit graph

1916 commits

Author SHA1 Message Date
dmaclach
9315301a56 Fix up ~14 warnings about 'Implicit conversion loses integer precision' on iOS.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1281 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-18 22:52:02 +00:00
dmaclach
0c18b07255 When the Breakpad.h header gets compiled by standard C compilers
(instead of C++) it gets upset about the default argument. Instead of
using a default argument I split the function up into two separate
functions.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1280 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-18 21:34:43 +00:00
ted.mielczarek@gmail.com
5fcdc4f567 Make Linux ExceptionHandler::HandleSignal public
A=Jed Davis <jld@mozilla.com> R=ted at https://breakpad.appspot.com/1114003/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1279 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-05 12:11:48 +00:00
rsesek@chromium.org
299683dba6 Create a new tool to upload Mac system library symbols.
R=andybons@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1124002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1278 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-02-03 22:52:49 +00:00
mattdr.breakpad@gmail.com
9dd2ab720e Support statically-linked libcurl for HTTP uploads in Linux
https://breakpad.appspot.com/1064002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1277 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-29 20:34:07 +00:00
thestig@chromium.org
c590a7f322 Windows: Fix 64-bit compitation of crash_generation_app.
BUG=560
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1104002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1276 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-21 19:22:37 +00:00
thestig@chromium.org
0864f0afaa Fix missing semi-colons from r1267.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1094002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1275 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-17 23:20:24 +00:00
cdn@chromium.org
8b65346242 Refactor the Windows MinidumpGenerator interface to get rid of the overloads when generating dumps.
All required params are now passed to the constructor and the various options are set through new methods.

BUG=N/A
TEST=Existing minidump generation tests
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1074002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1274 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-17 22:39:11 +00:00
cdn@chromium.org
d9f582edce Fix VS project generation for the crash generation app.
BUG=N/A
TEST=N/A
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/1084002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1273 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-17 21:57:47 +00:00
ivan.penkov@gmail.com
2b0db12678 Submitting on bahalf of Michele Aiello.
Fix Xcode 5.1 compilation issues.
Moving a couple of variable under #ifdef to avoid build warnings.

R=blundell@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/1054002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1272 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-13 19:30:06 +00:00
blundell@chromium.org
12528d19bd Add -[BreakpadController setParametersToAddAtUploadTime:] for iOS.
This provides the ability to add server parameters to a crash report when the
report is uploaded.

Patch by KiYun Roe <kiyun@chromium.org>

BUG=558
R=blundell@chromium.org

Review URL: https://breakpad.appspot.com/974002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1271 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-13 10:40:07 +00:00
mark@chromium.org
3ea04ec479 Don't do work inside assert(). Ever.
The Mac crash key manipulation code was intended to be thread-safe through the
provision of a mutex. The mutex operations were done inside an assert().
assert() is a no-op in NDEBUG (release) builds. Therefore, in release builds,
these operations were occurring without being protected by any mutex at all,
and were nowhere near thread-safe.

BUG=chromium:331268
R=rsesek@chromium.org

Review URL: https://breakpad.appspot.com/1034002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1270 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-10 19:54:20 +00:00
mark@chromium.org
1e99113fbe Fix #include order from r1268.
R=ted.mielczarek@gmail.com

Review URL: https://breakpad.appspot.com/1044002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1269 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-10 19:53:33 +00:00
ted.mielczarek@gmail.com
6f045df4f0 Fix compilation with macos-target=10.9
A=Nomis101, R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=952623

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1268 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-01-03 12:32:55 +00:00
thestig@chromium.org
4a0f9bf030 Windows: Fix remaining level 4 warnings.
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/954002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1267 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-18 22:43:56 +00:00
thestig@chromium.org
74f640a92e Use a proper ignore_result() to fix a ftruncate warn_unused_result warning with GCC 4.8.
BUG=492
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/944003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1266 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-18 19:52:36 +00:00
thestig@chromium.org
15873e0016 Switch scoped_ptr.h to a compatible google3 implementation.
This is Chromium's base/memory/scoped_ptr.h at r98718, which split off
from the google3 version at a later point than Breakpad's copy. It is a
drop in replacement and the only changes are:
- removal of WARN_UNUSED_RESULT.
- moving it into the google_breakpad namespace.

BUG=534
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/964002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1265 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-18 19:49:55 +00:00
thestig@chromium.org
6199766d99 Fix warnings from the Windows build.
These warnings are fatal in my GYP-generated debug build.
The warnings can be seen on Linux/Mac with -Wshorten-64-to-32.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/944002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1264 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 22:21:40 +00:00
thestig@chromium.org
53a689933f Run svn propdel svn:executable on source code files.
Review URL: https://breakpad.appspot.com/934002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1263 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 21:40:50 +00:00
thestig@chromium.org
a4d055f1c2 Fix error r1258.
BUG=556
R=cdn@chromium.org, mark@chromium.org

Review URL: https://breakpad.appspot.com/904004

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1262 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 19:04:11 +00:00
ivan.penkov@gmail.com
d6d6230272 Making the Mac build of crash_report work again after the last SVN sync. This includes correction of a method definition signature and adding missing code files to the project.
I'm commiting this on behalf of Thomas Schweitzer.
Review URL: https://breakpad.appspot.com/914002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1261 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-17 00:10:25 +00:00
thestig@chromium.org
3c613e7bdb Fix gcc vs clang cpuid.h discrepency.
For r1254, gcc defines bit_FXSAVE while clang defines bit_FXSR.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/924002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1260 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-14 19:17:42 +00:00
digit@chromium.org
ba1f54c093 Misc Android-related fixes.
- src/common/android/testing/mkdtemp.h:
  Fixes a compilation error when using the (recent) NDK r9b,
  see comments in the source file for details.

- android/test-driver, Makefile.am, Makefile.in:
  Autotools 1.12 changed the way tests are run during "make check"
  so add a new "custom test driver" to run tests on Android, and
  modify Makefile.am / Makefile.in accordingly. Otherwise,
  'make check' tried to run the tests on the host.

- android/test-shell.sh:
  Allow several tests to run in parallel on the device, by
  creating a custom test directory for each test process.
  This allows running "make check -j8" reliably.

- src/common/linux/file_id_unittest.cc:
  Disable the SelfStrip test on Android, since it assumes a 'strip'
  executable is available on the target system where the test runs.

BUG=NONE
R=mark@chromium.org, ted.mielczarek@gmail.com
TEST=android/run-checks.sh --ndk-dir=/path/to/android-ndk-r9b

Review URL: https://breakpad.appspot.com/904003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1259 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-13 16:49:11 +00:00
cdn@chromium.org
4bcf51dc79 Expose the ability to supply additional user streams in the windows dump generator.
BUG=N/A
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/894002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1258 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-12 20:04:42 +00:00
altse@chromium.org
b5e5d8bd30 Remove usage of gDebugLog and DEBUGLOG from Mac and iOS client code.
The inconsistent and duplicated references to gDebugLog caused
problems building on iOS and the current logging implementation
had little utility because it was never activated in debug builds.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1257 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-12 19:58:00 +00:00
blundell@chromium.org
88b8ac6182 Add -[BreakpadController resetConfiguration] for iOS.
Add a resetConfiguration method to BreakpadController for iOS. The new method
resets the controller configuration to its initial value, which is the
infoDictionary of the bundle of the application.

Patch by KiYun Roe <kiyun@chromium.org>

BUG=554

Review URL: https://breakpad.appspot.com/904002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1256 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-12 14:52:37 +00:00
vapier@chromium.org
4c048c9764 disable unittests under ASAN that use memory crashes
There are a bunch of tests that use invalid memory acesses (on purpose)
to trigger a crash so that we can detect things are dumped correctly.
When we run under ASAN, it catches those accesses and the breaks the
testing flow.

For now, use the existing ADDRESS_SANITIZER symbol to disable more tests.
Ideally we'd use a compile-time attribute to disable ASAN on a few funcs,
but that seems to be broken atm.

BUG=chromium:293519
BUG=chromium:304575
TEST=ran unittests under ASAN and they now pass
TEST=ran unittests w/out asan/clang and they still pass
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/884002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1255 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-11 05:38:34 +00:00
thestig@chromium.org
7f05071e8b Address additional comments from r1248. Fix the register to check and fix some style nits.
BUG=495
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/834003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1254 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 21:17:12 +00:00
mcgrathr@chromium.org
cd272586ee Conditionalize use of <cpuid.h> header
This header only exists for x86 environments, but was included
unconditionally.  That broke the builds for all non-x86 environments.

R=mark@chromium.org
BUG=

Review URL: https://breakpad.appspot.com/824003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1253 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 18:25:45 +00:00
ted.mielczarek@gmail.com
b76bb512a0 autoreconf -f -i
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1252 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 17:53:50 +00:00
ted.mielczarek@gmail.com
07bb2311f8 Use AM_MAINTAINER_MODE so configure supports --enable-maintainer-mode
A=mcgrathr
R=bradnelson at https://breakpad.appspot.com/864003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1251 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 12:28:11 +00:00
vapier@chromium.org
302124aff1 check for and enable Large File Support automatically
If you try to process a file using a 32bit build that is larger than
2GiB in size, the linux kernel will reject things:
$ strace -eopen dump_syms ./chrome ./ > chrome.sym
...
open(".//chrome.debug", O_RDONLY)       = -1 EOVERFLOW (Value too large for defined data type)

So let's use the existing autoconf macro to check for and enable support
as need be.

We have to shift the existing m32 logic up to before we start doing
feature test macros though otherwise a simple configure won't work:
$ ./configure --enable-m32
This is because it first tests LFS and such w/out the -m32 flags.

BUG=chromium:266064
TEST=`./configure --enable-m32 && make && make check` passes
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/619002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1250 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 06:28:08 +00:00
thestig@chromium.org
8d22ec9227 Fix Windows release build error due to unreferenced variables.
BUG=544
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/874002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1249 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-09 21:59:48 +00:00
thestig@chromium.org
0348c801bd Add MMX detection when getting registers in Linux.
For CPUs that don't support the MMX instruction set, such pre-Pentium III or industrial x86 embedded PCs, the minidump fails when it tries to retrieve MMX specific registers.

This patch adds MMX detection for that call.

Tested on Ubuntu 12.04 with i686, and on a custom Linux distro on a Vortex86DX microcontroller.

Original review: https://breakpad.appspot.com/455002/
A=aras.vaichas
BUG=495

Review URL: https://breakpad.appspot.com/864002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1248 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-09 20:22:43 +00:00
mark@chromium.org
cca536ba9d Back out r1244
------------------------------------------------------------------------
r1244 | mark@chromium.org | 2013-12-05 18:13:18 -0500 (Thu, 05 Dec 2013) | 7 lines

Avoid redefinition of global static debug flag and remove unneeded
#import "GTMDefines.h

Patch by Alistair Tse <altse@chromium.org>

Review URL: https://breakpad.appspot.com/824002

------------------------------------------------------------------------

Breakage documented at https://breakpad.appspot.com/824002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1247 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-09 14:08:10 +00:00
mark@chromium.org
186f1cb206 Switch armv7 setting to arm_version==7.
Patch by Mostyn Bramley-Moore <mostynb@opera.com>

BUG=chromium:234135

Review URL: https://breakpad.appspot.com/844002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1246 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-08 19:28:36 +00:00
mark@chromium.org
616400ed2f Add include guards and avoid redefinition of false/true in convert_UTF.
Patch by Alistair Tse <altse@chromium.org>

Review URL: https://breakpad.appspot.com/834002


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1245 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-05 23:16:03 +00:00
mark@chromium.org
31a477e889 Avoid redefinition of global static debug flag and remove unneeded
#import "GTMDefines.h

Patch by Alistair Tse <altse@chromium.org>

Review URL: https://breakpad.appspot.com/824002


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1244 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-05 23:13:18 +00:00
qsr@chromium.org
d9d0a61f97 Do not read CFI section when not outputing CFI information.
This revert revision 1182 and fix setting the module load address
whether CFI information is needed or not.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/641002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1243 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-04 14:05:23 +00:00
ivan.penkov@gmail.com
08ce8e35eb Fix unused method warning.
Review URL: https://breakpad.appspot.com/814002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1242 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 22:27:01 +00:00
ivan.penkov@gmail.com
b91429acb0 Fixing several instances of wrong printf format specifiers.
Review URL: https://breakpad.appspot.com/794002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1241 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 21:13:59 +00:00
mark@chromium.org
8a0b196e22 Add missing #include of eintr_wrapper.h to auto_testfile.h. Since it's
Linux-specific, shuffle the files around a bit.

(The implementation is actually POSIX-specific, but it's currently only used
on Linux.)

R=blundell@chromium.org

Review URL: https://breakpad.appspot.com/804002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1240 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 19:01:17 +00:00
mark@chromium.org
036dec3ecc Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.
It is incorrect to wrap close in HANDLE_EINTR on Linux.

Unnecessary #includes of eintr_wrapper.h are also removed. The variable naming
within the macro is also updated per Chromium r178174.

einter_wrapper.h contains a non-mechanical change. Mechanical changes were
generated by running:

sed -E -i '' \
    -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \
    -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \
    -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \
    $(grep -rl HANDLE_EINTR.*close . --exclude-dir=.svn)

sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \
    $(grep -EL '(HANDLE|IGNORE)_EINTR' \
        $(grep -Elr '#include.*eintr_wrapper\.h"' . --exclude-dir=.svn))

BUG=chromium:269623
R=ted.mielczarek@gmail.com

Review URL: https://breakpad.appspot.com/784002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1239 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-03 14:12:08 +00:00
blundell@chromium.org
b303174e32 Re-enable ios_exception_minidump_generator being built on non-ARM.
This file gets built on x86 as part of building Chromium for the iOS simulator,
which I had forgotten in the course of https://breakpad.appspot.com/664002/.

R=mark@chromium.org

Review URL: https://breakpad.appspot.com/774002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1238 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-02 16:02:48 +00:00
qsr@chromium.org
f546e072ce In iOS, BREAKPAD_OUTPUT_DUMP_FILE value contains a malformed full path to the dump file.
The std::string dumpFilename already contains the full pathname to the dump file.  Appending it to the dumpDirAsNSString creates a string with the path portion duplicated, e.g.:

/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/0A406D28-437D-48EE-9989-23F7F871818E.dmp

Instead of this:

/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/0A406D28-437D-48EE-9989-23F7F871818E.dmp

R=markus@chromium.org, qsr@chromium.org

Review URL: https://breakpad.appspot.com/744002

Patch from Akiva <scirsw@gmail.com>.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1237 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-26 10:38:55 +00:00
mark@chromium.org
e9165f4353 Process minidumps generated on ARM64 in iOS apps.
Patch by Colin Blundell <blundell@chromium.org>

BUG=542

Review URL: https://breakpad.appspot.com/704002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1236 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-23 01:45:20 +00:00
mark@chromium.org
77022ac0df Generate minidumps for 64-bit ARM apps on iOS.
Adds an ARM64-specific definition of MDRawContext and support for writing out a
minidump when running on ARM64. Additionally, extends the iOS minidump generator
for NSExceptions to work on ARM64 as well as ARM.

Patch by Colin Blundell <blundell@chromium.org>

BUG=542

Review URL: https://breakpad.appspot.com/664002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1235 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-21 17:44:57 +00:00
mark@chromium.org
8e28cb3898 Provide BreakpadGetCrashReportCount() and -[BreakpadController
getCrashReportCount:]

This provides the ability for clients to query the number of crash reports
that are waiting to upload.

Patch by KiYun Roe <kiyun@chromium.org>

BUG=547

Review URL: https://breakpad.appspot.com/714002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1234 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-20 16:34:13 +00:00
thestig@chromium.org
46821f78b1 Allow SIGABRT to abort the program.
SIGABRT can be generated internally, usually by calling abort(),
or externally by another process.  When the signal is generated
by the kernel, info->si_pid is 0 and the signal is treated in the
same way as an exception (SIGSEGV, etc.), but the assumption
that the exception happens again upon return from the handler
is wrong, so we must have a special case for this.

Original CL: https://breakpad.appspot.com/734002/

BUG=chromium:303075
TEST=tested with Alt-VolumeUp-X on Chrome OS
A=semenzato@chromium.org
R=semenzato@google.com

Review URL: https://breakpad.appspot.com/754002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1233 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-07 22:50:13 +00:00
ivan.penkov@gmail.com
fd9f3d8b17 Use register %ebp (instead of %esp) when calculating the value of
.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
2013-11-05 23:50:49 +00:00