8 Commits

Author SHA1 Message Date
Justin Cohen
17a515d33d [ios] Bring up first draft Mach exception server.
Add Mach exception server and fill out exceptions snapshot.

Note that:
 - The 'capture' portion of this CL will be moved out of the snapshot
   interface and into a separate in-process dump to disk location.
 - All of the pointer dereferences need to be wrapped in vm_read.
 - The read-fast-and-dump logic in exception_snapshot will end up in a
   different file completely, but until we pick a
   serialization/deserialization method, keep it as-is.

Bug: crashpad:31
Change-Id: I44203aa44036a341d6b4517fde7ab0cb9d7e94d7
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2160122
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-25 23:38:48 +00:00
Justin Cohen
ea4af71c2a Add another iOS library path sinkhole.
Add another sinkhole for _UIGestureEnvironmentUpdate.

Bug: crashpad:31
Change-Id: Ic4a424da034249295b6e45f8fe0860a4d4696b93
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2145017
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2020-04-16 15:25:57 +00:00
Mark Mentovai
dc9176b063 iOS: “namespace” Objective-C test classes by prefixing with CPTest
Re:
https://chromium-review.googlesource.com/c/2028183/4/test/ios/crash_type_xctest.mm#13

We previously discussed using the CP prefix for Objective-C class and
protocol names, and CPTest for those restricted to tests. This is
intended to parallel our C++ code’s use of the crashpad and
crashpad::test namespaces, but with name prefixing because Objective-C
doesn’t support any other form of namespacing.

These class names are changed:

ApplicationDelegate→CPTestApplicationDelegate
CrashViewController→CPTestCrashViewController
CrashpadUnitTestDelegate→CPTestUnitTestApplicationDelegate

Filenames and #include guards are also adjusted to match.

This also has include-what-you-use fixes and more modern pointer
handling in CPTestSharedObject, which was already named correctly.

Bug: crashpad:31
Change-Id: I3645ee830a30eccb594d679e0d52ba1a2dd1225d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2144453
Commit-Queue: Mark Mentovai <mark@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
2020-04-15 15:19:35 +00:00
Justin Cohen
de43cd3723 Fix Chromium Roll.
- Fix -Wundeclared-selector in Chromium roll.
- Convert TEST to TEST_F in crashpad_client_ios_test.mm

Also rolls mini_chromim 731e08f06..641fcf9bb (3 commits)
  2020-04-14 mark Mark static const class/struct members as constexpr
  2020-04-09 justincohen Add PlatformTest to mini_chromium.
  2020-04-09 jperaza Replace ScopedClearErrno with ScopedClearLastError

Change-Id: Ib8ac742eb97359be47e1ff01ae6f10518761a302
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2144452
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-14 14:28:34 +00:00
Justin Cohen
b2fd7d5307 [ios] Bring up first half of UncaughtExceptionHandler.
When code raises an Objective-C exception, unwind the stack looking for
any exception handlers. If an exception handler is encountered, test to
see if it is a function known to be a catch-and-rethrow 'sinkhole'
exception handler. Various routines in UIKit and elsewhere do this, and
they obscure the exception stack, since the original throw location is
no longer present on the stack (just the re-throw) when Crashpad
captures the crash report. In the case of sinkholes, trigger an
immediate exception to capture the original stack.

The is an improvement over the alternative,
NSSetUncaughtExceptionHandler, which passes along the stack frames, but
not the stack memory contents and full exception context itself.

The details of what happens after a fatal exception is triggered are
unresolved in this CL.  For now, simply call std::terminate.

This code was inspired by chromium/src/chrome/browser/mac/
exception_processor.mm.

Bug: crashpad:31
Change-Id: Ieebc6476a0507c466c8219c10f790ec0a624e58c
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2125254
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-04-08 20:57:21 +00:00
Justin Cohen
9ed8290547 Bring up skeleton crashpad_client_ios.
First steps at bringing up the crashpad_client on iOS.  Also updates
the XCUITest to trigger various crashes, with some swizzling
necessary to allow crashes.

Change-Id: I87dd36bed1c052b509d14bfa29679ed81e58a377
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2039470
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
2020-02-18 20:03:41 +00:00
Rohit Rao
39116ab723 Adds support for running iOS unittests via XCTest.
Using XCTest allows us to drive tests from the commandline via
xcodebuild, and it also simplifies running tests on physical devices.

Tests put themselves into "XCTest-mode" if the
"XCTestConfigurationFilePath" environment variable is present.  This
variable is only set when XCTests are running.

Change-Id: If55199a7470f0479f107097eef1dfb1a705015e9
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2033427
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-01-31 20:14:04 +00:00
Justin Cohen
75ea787a80 Adds plumbing for xcuitests with a placeholder test.
Also adds basic integration for EDO.

Change-Id: If3d193a4967a566b55d6d446585e2988dacad6e6
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2028183
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2020-01-31 03:39:51 +00:00