Commit 149eba8a authored by Gang Wu's avatar Gang Wu Committed by Commit Bot

Revert "Update Crashpad to 11b8eb10d4ad6ed50ee43d3bb50d13967d638dfa"

This reverts commit d9deeea6.

Reason for revert: compile error on ios-device build
https://ci.chromium.org/p/chromium/builders/ci/ios-device/150149

Original change's description:
> Update Crashpad to 11b8eb10d4ad6ed50ee43d3bb50d13967d638dfa
> 
> 9ed829054711 Bring up skeleton crashpad_client_ios
> 22701bb0e448 fuchsia: Use zx_system_get_version_string
> f79cba47ba0d [lsan][crashpad] Suppress leak sanitizer on crashpad_test
> 0c20aeabd37a [UBSan] Temporarily disable UBSan for snapshot and minidump
> d632f625a2f2 Fix a Wrange-loop-analysis warning in crashpad
> 8bad6f140e0b [UBSan] Temporarily disable UBSan for gtest and file
> 11b8eb10d4ad Don’t use the disappearing MSVC_PUSH_DISABLE_WARNING()
>              macro
> 
> Change-Id: I5f0ba09aae2fcd1a8b91543f91a94ffe093f16b5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083654
> Commit-Queue: Mark Mentovai <mark@chromium.org>
> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#746133}

TBR=thakis@chromium.org,jperaza@chromium.org,mark@chromium.org

Change-Id: I48cc6cb41ab563964f50fa02cf3a7570c820a059
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083933Reviewed-by: default avatarGang Wu <gangwu@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746141}
parent cffaf486
...@@ -2017,8 +2017,6 @@ jumbo_component("base") { ...@@ -2017,8 +2017,6 @@ jumbo_component("base") {
} else { } else {
sources += [ "time/time_exploded_ios.cc" ] sources += [ "time/time_exploded_ios.cc" ]
} }
libs += [ "UIKit.framework" ]
} }
if (dep_libevent) { if (dep_libevent) {
......
...@@ -2,7 +2,7 @@ Name: Crashpad ...@@ -2,7 +2,7 @@ Name: Crashpad
Short Name: crashpad Short Name: crashpad
URL: https://crashpad.chromium.org/ URL: https://crashpad.chromium.org/
Version: unknown Version: unknown
Revision: 11b8eb10d4ad6ed50ee43d3bb50d13967d638dfa Revision: faed21a2862529b4ebead8cf178427b56fcacdca
License: Apache 2.0 License: Apache 2.0
License File: crashpad/LICENSE License File: crashpad/LICENSE
Security Critical: yes Security Critical: yes
......
...@@ -20,19 +20,6 @@ config("crashpad_config") { ...@@ -20,19 +20,6 @@ config("crashpad_config") {
include_dirs = [ "." ] include_dirs = [ "." ]
} }
# TODO(fuchsia:46805): Remove this once instances of UB have been cleaned up.
config("disable_ubsan") {
if (crashpad_is_in_fuchsia) {
cflags = [ "-fno-sanitize=undefined" ]
}
visibility = [
"snapshot:snapshot",
"minidump:minidump_test",
"third_party/gtest:gtest",
"util:util",
]
}
if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) { if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test("crashpad_tests") { test("crashpad_tests") {
deps = [ deps = [
...@@ -48,10 +35,6 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) { ...@@ -48,10 +35,6 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
"util:util_test", "util:util_test",
] ]
} }
if (crashpad_is_in_fuchsia) {
# TODO(fuchsia:46559): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
} }
if (crashpad_is_in_fuchsia) { if (crashpad_is_in_fuchsia) {
......
...@@ -43,10 +43,6 @@ static_library("client") { ...@@ -43,10 +43,6 @@ static_library("client") {
] ]
} }
if (crashpad_is_ios) {
sources += [ "crashpad_client_ios.cc" ]
}
if (crashpad_is_linux || crashpad_is_android) { if (crashpad_is_linux || crashpad_is_android) {
set_sources_assignment_filter([]) set_sources_assignment_filter([])
sources += [ sources += [
...@@ -141,9 +137,7 @@ source_set("client_test") { ...@@ -141,9 +137,7 @@ source_set("client_test") {
"../util", "../util",
] ]
if (!crashpad_is_ios) {
data_deps = [ "../handler:crashpad_handler" ] data_deps = [ "../handler:crashpad_handler" ]
}
if (crashpad_is_win) { if (crashpad_is_win) {
data_deps += [ "../handler:crashpad_handler_console" ] data_deps += [ "../handler:crashpad_handler_console" ]
......
...@@ -423,20 +423,8 @@ class CrashpadClient { ...@@ -423,20 +423,8 @@ class CrashpadClient {
//! //!
//! \param[in] unhandled_signals The set of unhandled signals //! \param[in] unhandled_signals The set of unhandled signals
void SetUnhandledSignals(const std::set<int>& unhandled_signals); void SetUnhandledSignals(const std::set<int>& unhandled_signals);
#endif // OS_LINUX || OS_ANDROID || DOXYGEN
#if defined(OS_IOS) || DOXYGEN #endif // OS_LINUX || OS_ANDROID || DOXYGEN
//! \brief Configures the process to direct its crashes to the iOS in-process
//! Crashpad handler.
//!
//! This method is only defined on iOS.
//!
//! \return `true` on success, `false` on failure with a message logged.
//!
//! TODO(justincohen): This method will need to take database, metrics_dir,
//! url and annotations eventually.
bool StartCrashpadInProcessHandler();
#endif
#if defined(OS_MACOSX) || DOXYGEN #if defined(OS_MACOSX) || DOXYGEN
//! \brief Sets the process’ crash handler to a Mach service registered with //! \brief Sets the process’ crash handler to a Mach service registered with
......
// Copyright 2020 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "client/crashpad_client.h"
#include <unistd.h>
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "client/client_argv_handling.h"
#include "util/posix/signals.h"
namespace crashpad {
namespace {
// A base class for Crashpad signal handler implementations.
class SignalHandler {
public:
// Returns the currently installed signal hander.
static SignalHandler* Get() {
static SignalHandler* instance = new SignalHandler();
return instance;
}
bool Install(const std::set<int>* unhandled_signals) {
return Signals::InstallCrashHandlers(
HandleSignal, 0, &old_actions_, unhandled_signals);
}
private:
SignalHandler() = default;
// The base implementation for all signal handlers, suitable for calling
// directly to simulate signal delivery.
void HandleCrash(int signo, siginfo_t* siginfo, void* context) {
// Do Something.
// Always call system handler.
Signals::RestoreHandlerAndReraiseSignalOnReturn(
siginfo, old_actions_.ActionForSignal(signo));
}
// The signal handler installed at OS-level.
static void HandleSignal(int signo, siginfo_t* siginfo, void* context) {
Get()->HandleCrash(signo, siginfo, context);
}
Signals::OldActions old_actions_ = {};
DISALLOW_COPY_AND_ASSIGN(SignalHandler);
};
} // namespace
CrashpadClient::CrashpadClient() {}
CrashpadClient::~CrashpadClient() {}
bool CrashpadClient::StartCrashpadInProcessHandler() {
return SignalHandler::Get()->Install(nullptr);
}
} // namespace crashpad
...@@ -19,7 +19,7 @@ config("compat_config") { ...@@ -19,7 +19,7 @@ config("compat_config") {
if (crashpad_is_mac) { if (crashpad_is_mac) {
include_dirs += [ "mac" ] include_dirs += [ "mac" ]
} else if (!crashpad_is_ios) { } else {
include_dirs += [ "non_mac" ] include_dirs += [ "non_mac" ]
} }
...@@ -43,7 +43,7 @@ config("compat_config") { ...@@ -43,7 +43,7 @@ config("compat_config") {
} }
template("compat_target") { template("compat_target") {
if (crashpad_is_mac || crashpad_is_ios) { if (crashpad_is_mac) {
# There are no sources to compile, which doesn’t mix will with a # There are no sources to compile, which doesn’t mix will with a
# static_library. # static_library.
group(target_name) { group(target_name) {
...@@ -67,7 +67,7 @@ compat_target("compat") { ...@@ -67,7 +67,7 @@ compat_target("compat") {
"mac/mach/mach.h", "mac/mach/mach.h",
"mac/sys/resource.h", "mac/sys/resource.h",
] ]
} else if (!crashpad_is_ios) { } else {
sources += [ sources += [
"non_mac/mach-o/loader.h", "non_mac/mach-o/loader.h",
"non_mac/mach/mach.h", "non_mac/mach/mach.h",
......
...@@ -140,8 +140,7 @@ source_set("handler_test") { ...@@ -140,8 +140,7 @@ source_set("handler_test") {
} }
} }
if (!crashpad_is_ios) { crashpad_executable("crashpad_handler") {
crashpad_executable("crashpad_handler") {
sources = [ "main.cc" ] sources = [ "main.cc" ]
deps = [ deps = [
...@@ -162,7 +161,6 @@ if (!crashpad_is_ios) { ...@@ -162,7 +161,6 @@ if (!crashpad_is_ios) {
[ "//third_party/mini_chromium/mini_chromium/build:win_windowed" ] [ "//third_party/mini_chromium/mini_chromium/build:win_windowed" ]
} }
} }
}
} }
# There is not any normal way to package native executables in an Android APK. # There is not any normal way to package native executables in an Android APK.
...@@ -194,8 +192,7 @@ if (crashpad_is_android) { ...@@ -194,8 +192,7 @@ if (crashpad_is_android) {
} }
} }
if (!crashpad_is_ios) { crashpad_executable("crashpad_handler_test_extended_handler") {
crashpad_executable("crashpad_handler_test_extended_handler") {
testonly = true testonly = true
sources = [ "crashpad_handler_test_extended_handler.cc" ] sources = [ "crashpad_handler_test_extended_handler.cc" ]
...@@ -208,7 +205,6 @@ if (!crashpad_is_ios) { ...@@ -208,7 +205,6 @@ if (!crashpad_is_ios) {
"../third_party/mini_chromium:base", "../third_party/mini_chromium:base",
"../tools:tool_support", "../tools:tool_support",
] ]
}
} }
if (crashpad_is_win) { if (crashpad_is_win) {
......
...@@ -164,6 +164,4 @@ source_set("minidump_test") { ...@@ -164,6 +164,4 @@ source_set("minidump_test") {
if (crashpad_is_win) { if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
} }
configs += [ "..:disable_ubsan" ]
} }
...@@ -25,15 +25,14 @@ ...@@ -25,15 +25,14 @@
#include "util/misc/pdb_structures.h" #include "util/misc/pdb_structures.h"
#include "util/misc/uuid.h" #include "util/misc/uuid.h"
#if defined(COMPILER_MSVC)
// C4200 is "nonstandard extension used : zero-sized array in struct/union". // C4200 is "nonstandard extension used : zero-sized array in struct/union".
// We would like to globally disable this warning, but unfortunately, the // We would like to globally disable this warning, but unfortunately, the
// compiler is buggy and only supports disabling it with a pragma, so we can't // compiler is buggy and only supports disabling it with a pragma, so we can't
// disable it with other silly warnings in the build files. See: // disable it with other silly warnings in build/common.gypi. See:
// https://connect.microsoft.com/VisualStudio/feedback/details/1114440 // https://connect.microsoft.com/VisualStudio/feedback/details/1114440
#pragma warning(push) MSVC_PUSH_DISABLE_WARNING(4200)
#pragma warning(disable: 4200)
#if defined(COMPILER_MSVC)
#define PACKED #define PACKED
#pragma pack(push, 1) #pragma pack(push, 1)
#else #else
...@@ -499,10 +498,11 @@ struct ALIGNAS(4) PACKED MinidumpCrashpadInfo { ...@@ -499,10 +498,11 @@ struct ALIGNAS(4) PACKED MinidumpCrashpadInfo {
#if defined(COMPILER_MSVC) #if defined(COMPILER_MSVC)
#pragma pack(pop) #pragma pack(pop)
#pragma warning(pop) // C4200
#endif // COMPILER_MSVC #endif // COMPILER_MSVC
#undef PACKED #undef PACKED
MSVC_POP_WARNING() // C4200
} // namespace crashpad } // namespace crashpad
#endif // CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_ #endif // CRASHPAD_MINIDUMP_MINIDUMP_EXTENSIONS_H_
...@@ -234,8 +234,6 @@ static_library("snapshot") { ...@@ -234,8 +234,6 @@ static_library("snapshot") {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
libs = [ "powrprof.lib" ] libs = [ "powrprof.lib" ]
} }
configs += [ "..:disable_ubsan" ]
} }
if (crashpad_is_linux && use_fuzzing_engine) { if (crashpad_is_linux && use_fuzzing_engine) {
......
...@@ -38,7 +38,10 @@ void SystemSnapshotFuchsia::Initialize(const timeval* snapshot_time) { ...@@ -38,7 +38,10 @@ void SystemSnapshotFuchsia::Initialize(const timeval* snapshot_time) {
// garnet/bin/uname/uname.c, however, this information isn't provided by // garnet/bin/uname/uname.c, however, this information isn't provided by
// uname(). Additionally, uname() seems to hang if the network is in a bad // uname(). Additionally, uname() seems to hang if the network is in a bad
// state when attempting to retrieve the nodename, so avoid it for now. // state when attempting to retrieve the nodename, so avoid it for now.
std::string kernel_version = zx_system_get_version_string(); char kernel_version[256] = {};
zx_status_t status =
zx_system_get_version(kernel_version, sizeof(kernel_version));
ZX_LOG_IF(ERROR, status != ZX_OK, status) << "zx_system_get_version";
#if defined(ARCH_CPU_X86_64) #if defined(ARCH_CPU_X86_64)
static constexpr const char kArch[] = "x86_64"; static constexpr const char kArch[] = "x86_64";
...@@ -47,8 +50,8 @@ void SystemSnapshotFuchsia::Initialize(const timeval* snapshot_time) { ...@@ -47,8 +50,8 @@ void SystemSnapshotFuchsia::Initialize(const timeval* snapshot_time) {
#else #else
static constexpr const char kArch[] = "unknown"; static constexpr const char kArch[] = "unknown";
#endif #endif
os_version_full_ = base::StringPrintf( os_version_full_ =
"Zircon prerelease %s %s", kernel_version.c_str(), kArch); base::StringPrintf("Zircon prerelease %s %s", kernel_version, kArch);
INITIALIZATION_STATE_SET_VALID(initialized_); INITIALIZATION_STATE_SET_VALID(initialized_);
} }
......
...@@ -40,7 +40,6 @@ source_set("google_test_runner") { ...@@ -40,7 +40,6 @@ source_set("google_test_runner") {
deps = [ deps = [
"../../build:ios_enable_arc", "../../build:ios_enable_arc",
"../../build:ios_xctest", "../../build:ios_xctest",
"../../test/ios:google_test_runner_shared_headers",
"../../third_party/mini_chromium:base", "../../third_party/mini_chromium:base",
] ]
libs = [ "UIKit.framework" ] libs = [ "UIKit.framework" ]
......
...@@ -14,135 +14,26 @@ ...@@ -14,135 +14,26 @@
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#include <objc/runtime.h>
#import "Service/Sources/EDOClientService.h" #import "Service/Sources/EDOClientService.h"
#import "test/ios/host/cptest_shared_object.h" #import "test/ios/host/edo_placeholder.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
@interface CPTestTestCase : XCTestCase { @interface CPTestTestCase : XCTestCase
XCUIApplication* _app;
}
@end @end
@implementation CPTestTestCase @implementation CPTestTestCase
- (void)handleCrashUnderSymbol:(id)arg1 {
// For now, do nothing. In the future this can be something testable.
}
+ (void)setUp {
// Swizzle away the handleCrashUnderSymbol callback. Without this, any time
// the host app is intentionally crashed, the test is immediately failed.
SEL originalSelector = NSSelectorFromString(@"handleCrashUnderSymbol:");
SEL swizzledSelector = @selector(handleCrashUnderSymbol:);
Method originalMethod = class_getInstanceMethod(
objc_getClass("XCUIApplicationImpl"), originalSelector);
Method swizzledMethod =
class_getInstanceMethod([self class], swizzledSelector);
method_exchangeImplementations(originalMethod, swizzledMethod);
// Override EDO default error handler. Without this, the default EDO error
// handler will throw an error and fail the test.
[EDOClientService setErrorHandler:^(NSError* error){
// Do nothing.
}];
}
- (void)setUp { - (void)setUp {
_app = [[XCUIApplication alloc] init]; [[[XCUIApplication alloc] init] launch];
[_app launch];
} }
- (void)testEDO { - (void)testEDO {
CPTestSharedObject* rootObject = [EDOClientService rootObjectWithPort:12345]; EDOPlaceholder* rootObject = [EDOClientService rootObjectWithPort:12345];
NSString* result = [rootObject testEDO]; NSString* result = [rootObject testEDO];
XCTAssertEqualObjects(result, @"crashpad"); XCTAssertEqualObjects(result, @"crashpad");
} }
- (void)testSegv {
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
// Crash the app.
CPTestSharedObject* rootObject = [EDOClientService rootObjectWithPort:12345];
[rootObject crashSegv];
// Confirm the app is not running.
XCTAssertTrue([_app waitForState:XCUIApplicationStateNotRunning timeout:15]);
XCTAssertTrue(_app.state == XCUIApplicationStateNotRunning);
// TODO: Query the app for crash data
[_app launch];
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
}
- (void)testKillAbort {
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
// Crash the app.
CPTestSharedObject* rootObject = [EDOClientService rootObjectWithPort:12345];
[rootObject crashKillAbort];
// Confirm the app is not running.
XCTAssertTrue([_app waitForState:XCUIApplicationStateNotRunning timeout:15]);
XCTAssertTrue(_app.state == XCUIApplicationStateNotRunning);
// TODO: Query the app for crash data
[_app launch];
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
}
- (void)testTrap {
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
// Crash the app.
CPTestSharedObject* rootObject = [EDOClientService rootObjectWithPort:12345];
[rootObject crashTrap];
// Confirm the app is not running.
XCTAssertTrue([_app waitForState:XCUIApplicationStateNotRunning timeout:15]);
XCTAssertTrue(_app.state == XCUIApplicationStateNotRunning);
// TODO: Query the app for crash data
[_app launch];
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
}
- (void)testAbort {
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
// Crash the app.
CPTestSharedObject* rootObject = [EDOClientService rootObjectWithPort:12345];
[rootObject crashAbort];
// Confirm the app is not running.
XCTAssertTrue([_app waitForState:XCUIApplicationStateNotRunning timeout:15]);
XCTAssertTrue(_app.state == XCUIApplicationStateNotRunning);
// TODO: Query the app for crash data
[_app launch];
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
}
- (void)testBadAccess {
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
// Crash the app.
CPTestSharedObject* rootObject = [EDOClientService rootObjectWithPort:12345];
[rootObject crashBadAccess];
// Confirm the app is not running.
XCTAssertTrue([_app waitForState:XCUIApplicationStateNotRunning timeout:15]);
XCTAssertTrue(_app.state == XCUIApplicationStateNotRunning);
// TODO: Query the app for crash data
[_app launch];
XCTAssertTrue(_app.state == XCUIApplicationStateRunningForeground);
}
@end @end
...@@ -22,9 +22,13 @@ if (crashpad_is_in_chromium) { ...@@ -22,9 +22,13 @@ if (crashpad_is_in_chromium) {
source_set("app_shared_sources") { source_set("app_shared_sources") {
testonly = true testonly = true
sources = [ "cptest_shared_object.h" ] sources = [
"edo_placeholder.h",
]
configs += [ "../../..:crashpad_config" ] configs += [ "../../..:crashpad_config" ]
deps = [ "../../../build:ios_enable_arc" ] deps = [
"../../../build:ios_enable_arc",
]
libs = [ "UIKit.framework" ] libs = [ "UIKit.framework" ]
} }
...@@ -41,7 +45,6 @@ static_library("app_host_sources") { ...@@ -41,7 +45,6 @@ static_library("app_host_sources") {
deps = [ deps = [
":app_shared_sources", ":app_shared_sources",
"../../../build:ios_enable_arc", "../../../build:ios_enable_arc",
"../../../client",
"../../../third_party/edo", "../../../third_party/edo",
] ]
libs = [ libs = [
...@@ -53,5 +56,7 @@ static_library("app_host_sources") { ...@@ -53,5 +56,7 @@ static_library("app_host_sources") {
ios_app_bundle("ios_crash_xcuitests") { ios_app_bundle("ios_crash_xcuitests") {
info_plist = "Info.plist" info_plist = "Info.plist"
testonly = true testonly = true
deps = [ ":app_host_sources" ] deps = [
":app_host_sources",
]
} }
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
#import "Service/Sources/EDOHostNamingService.h" #import "Service/Sources/EDOHostNamingService.h"
#import "Service/Sources/EDOHostService.h" #import "Service/Sources/EDOHostService.h"
#include "client/crashpad_client.h"
#import "test/ios/host/cptest_shared_object.h"
#import "test/ios/host/crash_view_controller.h" #import "test/ios/host/crash_view_controller.h"
#import "test/ios/host/edo_placeholder.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -29,10 +28,6 @@ ...@@ -29,10 +28,6 @@
- (BOOL)application:(UIApplication*)application - (BOOL)application:(UIApplication*)application
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
// Start up crashpad.
crashpad::CrashpadClient client;
client.StartCrashpadInProcessHandler();
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
self.window.backgroundColor = UIColor.greenColor; self.window.backgroundColor = UIColor.greenColor;
...@@ -42,37 +37,17 @@ ...@@ -42,37 +37,17 @@
// Start up EDO. // Start up EDO.
[EDOHostService serviceWithPort:12345 [EDOHostService serviceWithPort:12345
rootObject:[[CPTestSharedObject alloc] init] rootObject:[[EDOPlaceholder alloc] init]
queue:dispatch_get_main_queue()]; queue:dispatch_get_main_queue()];
[EDOHostNamingService.sharedService start];
return YES; return YES;
} }
@end @end
@implementation CPTestSharedObject @implementation EDOPlaceholder
- (NSString*)testEDO { - (NSString*)testEDO {
return @"crashpad"; return @"crashpad";
} }
- (void)crashBadAccess {
strcpy(0, "bla");
}
- (void)crashKillAbort {
kill(getpid(), SIGABRT);
}
- (void)crashSegv {
long zero = 0;
*(long*)zero = 0xC045004d;
}
- (void)crashTrap {
__builtin_trap();
}
- (void)crashAbort {
abort();
}
@end @end
...@@ -12,29 +12,13 @@ ...@@ -12,29 +12,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#ifndef CRASHPAD_TEST_IOS_HOST_SHARED_OBJECT_H_ #ifndef CRASHPAD_TEST_IOS_HOST_EDO_PLACEHOLDER_H_
#define CRASHPAD_TEST_IOS_HOST_SHARED_OBJECT_H_ #define CRASHPAD_TEST_IOS_HOST_EDO_PLACEHOLDER_H_
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface CPTestSharedObject : NSObject @interface EDOPlaceholder : NSObject
// Returns the string "crashpad" for testing EDO.
- (NSString*)testEDO; - (NSString*)testEDO;
// Triggers an EXC_BAD_ACCESS exception and crash.
- (void)crashBadAccess;
// Triggers a crash with a call to kill(SIGABRT).
- (void)crashKillAbort;
// Triggers a segfault crash.
- (void)crashSegv;
// Trigger a crash with a __builtin_trap.
- (void)crashTrap;
// Trigger a crash with an abort().
- (void)crashAbort;
@end @end
#endif // CRASHPAD_TEST_IOS_HOST_SHARED_OBJECT_H_ #endif // CRASHPAD_TEST_IOS_HOST_EDO_PLACEHOLDER_H_
...@@ -34,7 +34,6 @@ if (crashpad_is_in_chromium) { ...@@ -34,7 +34,6 @@ if (crashpad_is_in_chromium) {
public_deps = [ public_deps = [
"//third_party/googletest:gtest", "//third_party/googletest:gtest",
] ]
public_configs = [ "../..:disable_ubsan" ]
} }
group("gmock") { group("gmock") {
testonly = true testonly = true
......
...@@ -25,8 +25,7 @@ source_set("tool_support") { ...@@ -25,8 +25,7 @@ source_set("tool_support") {
deps = [ "../third_party/mini_chromium:base" ] deps = [ "../third_party/mini_chromium:base" ]
} }
if (!crashpad_is_ios) { crashpad_executable("crashpad_database_util") {
crashpad_executable("crashpad_database_util") {
sources = [ "crashpad_database_util.cc" ] sources = [ "crashpad_database_util.cc" ]
deps = [ deps = [
...@@ -37,9 +36,9 @@ if (!crashpad_is_ios) { ...@@ -37,9 +36,9 @@ if (!crashpad_is_ios) {
"../third_party/mini_chromium:base", "../third_party/mini_chromium:base",
"../util", "../util",
] ]
} }
crashpad_executable("crashpad_http_upload") { crashpad_executable("crashpad_http_upload") {
sources = [ "crashpad_http_upload.cc" ] sources = [ "crashpad_http_upload.cc" ]
deps = [ deps = [
...@@ -49,7 +48,6 @@ if (!crashpad_is_ios) { ...@@ -49,7 +48,6 @@ if (!crashpad_is_ios) {
"../third_party/mini_chromium:base", "../third_party/mini_chromium:base",
"../util", "../util",
] ]
}
} }
crashpad_executable("base94_encoder") { crashpad_executable("base94_encoder") {
...@@ -62,7 +60,7 @@ crashpad_executable("base94_encoder") { ...@@ -62,7 +60,7 @@ crashpad_executable("base94_encoder") {
] ]
} }
if (!crashpad_is_fuchsia && !crashpad_is_ios) { if (!crashpad_is_fuchsia) {
crashpad_executable("generate_dump") { crashpad_executable("generate_dump") {
sources = [ "generate_dump.cc" ] sources = [ "generate_dump.cc" ]
......
...@@ -514,8 +514,6 @@ static_library("util") { ...@@ -514,8 +514,6 @@ static_library("util") {
if (crashpad_is_android || crashpad_is_linux) { if (crashpad_is_android || crashpad_is_linux) {
deps += [ "../third_party/lss" ] deps += [ "../third_party/lss" ]
} }
configs += [ "..:disable_ubsan" ]
} }
if (!crashpad_is_android) { if (!crashpad_is_android) {
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
#include "util/stdlib/strnlen.h" #include "util/stdlib/strnlen.h"
#if defined(OS_MACOSX) && !defined(OS_IOS) && \ #if defined(OS_MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
// Redeclare a method only available on Mac OS X 10.7 and later to suppress a // Redeclare a method only available on Mac OS X 10.7 and later to suppress a
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_MACOSX) && !defined(OS_IOS) #if defined(OS_MACOSX)
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
#endif #endif
...@@ -38,7 +38,7 @@ namespace crashpad { ...@@ -38,7 +38,7 @@ namespace crashpad {
//! and not all systems’ standard libraries provide an implementation. //! and not all systems’ standard libraries provide an implementation.
size_t strnlen(const char* string, size_t max_length); size_t strnlen(const char* string, size_t max_length);
#if !defined(OS_MACOSX) || defined(OS_IOS) || \ #if !defined(OS_MACOSX) || \
MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
inline size_t strnlen(const char* string, size_t max_length) { inline size_t strnlen(const char* string, size_t max_length) {
return ::strnlen(string, max_length); return ::strnlen(string, max_length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment