Skip to content

Commit

Permalink
Update Crashpad to 6a9e2e6003096a33e4006290e570bbd3da59e5c6
Browse files Browse the repository at this point in the history
343aa69084e5 Revert "[fuchsia][mac] Fix build errors"
77c1ad28d489 Add support for linux-arm64
3f3b7a856d88 Roll crashpad/third_party/mini_chromium/mini_chromium/
             2035d204b..a722d31ef (1 commit)
43d04a8661b2 Update comment for new file location
6a9e2e600309 Adjust to movement of base/ files to base/apple

Bug: 1444927
Change-Id: I8f616848b17e44b5f9db8642a237dec40f811bd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4787207
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184674}
  • Loading branch information
Avi Drissman authored and Chromium LUCI CQ committed Aug 17, 2023
1 parent 105e389 commit 7684cf6
Show file tree
Hide file tree
Showing 52 changed files with 191 additions and 184 deletions.
2 changes: 1 addition & 1 deletion third_party/crashpad/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Name: Crashpad
Short Name: crashpad
URL: https://crashpad.chromium.org/
Version: unknown
Revision: 419f995aab828946555a449b7e0f3b562bcfb9e4
Revision: 6a9e2e6003096a33e4006290e570bbd3da59e5c6
License: Apache 2.0
License File: crashpad/LICENSE
Security Critical: yes
Expand Down
4 changes: 2 additions & 2 deletions third_party/crashpad/crashpad/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ deps = {
'9719c1e1e676814c456b55f5f070eabad6709d31',
'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' +
'd1baeddcb8de15654e427e8c86a4c7c7add0e731',
'f5370228f40bbb8c453e17f6af6c6742858c45d1',
'crashpad/third_party/libfuzzer/src':
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
'fda403cf93ecb8792cb1d061564d89a6553ca020',
Expand All @@ -59,7 +59,7 @@ deps = {
'buildtools/linux64': {
'packages': [
{
'package': 'gn/gn/linux-amd64',
'package': 'gn/gn/linux-${{arch}}',
'version': Var('gn_version'),
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <mutex>
#include <tuple>

#include "base/apple/scoped_nsautorelease_pool.h"
#include "base/logging.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/posix/eintr_wrapper.h"
#include "base/scoped_generic.h"
#include "base/strings/string_piece.h"
Expand Down Expand Up @@ -813,7 +813,7 @@ OperationStatus ReportsInDirectory(const base::FilePath& path,
CrashReportDatabase::OperationStatus CrashReportDatabaseMac::ReportsInDirectory(
const base::FilePath& path,
std::vector<CrashReportDatabase::Report>* reports) {
base::mac::ScopedNSAutoreleasePool pool;
base::apple::ScopedNSAutoreleasePool pool;

DCHECK(reports->empty());

Expand Down
8 changes: 4 additions & 4 deletions third_party/crashpad/crashpad/client/crashpad_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#endif // !BUILDFLAG(IS_FUCHSIA)

#if BUILDFLAG(IS_APPLE)
#include "base/mac/scoped_mach_port.h"
#include "base/apple/scoped_mach_port.h"
#elif BUILDFLAG(IS_WIN)
#include <windows.h>
#include "util/win/scoped_handle.h"
Expand Down Expand Up @@ -627,7 +627,7 @@ class CrashpadClient {
//! Crashpad exception handler service.
//!
//! \return `true` on success, `false` on failure with a message logged.
bool SetHandlerMachPort(base::mac::ScopedMachSendRight exception_port);
bool SetHandlerMachPort(base::apple::ScopedMachSendRight exception_port);

//! \brief Retrieves a send right to the process’ crash handler Mach port.
//!
Expand All @@ -648,7 +648,7 @@ class CrashpadClient {
//! SetHandlerMachService(). This method must only be called after a
//! successful call to one of those methods. `MACH_PORT_NULL` on failure
//! with a message logged.
base::mac::ScopedMachSendRight GetHandlerMachPort() const;
base::apple::ScopedMachSendRight GetHandlerMachPort() const;
#endif

#if BUILDFLAG(IS_WIN) || DOXYGEN
Expand Down Expand Up @@ -790,7 +790,7 @@ class CrashpadClient {

private:
#if BUILDFLAG(IS_APPLE)
base::mac::ScopedMachSendRight exception_port_;
base::apple::ScopedMachSendRight exception_port_;
#elif BUILDFLAG(IS_WIN)
std::wstring ipc_pipe_;
ScopedKernelHANDLE handler_start_thread_;
Expand Down
6 changes: 3 additions & 3 deletions third_party/crashpad/crashpad/client/crashpad_client_ios.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include <ios>
#include <iterator>

#include "base/apple/mach_logging.h"
#include "base/apple/scoped_mach_port.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "base/mac/scoped_mach_port.h"
#include "client/ios_handler/exception_processor.h"
#include "client/ios_handler/in_process_handler.h"
#include "util/ios/raw_logging.h"
Expand Down Expand Up @@ -393,7 +393,7 @@ class CrashHandler : public Thread,
Signals::RestoreHandlerAndReraiseSignalOnReturn(siginfo, old_action);
}

base::mac::ScopedMachReceiveRight exception_port_;
base::apple::ScopedMachReceiveRight exception_port_;
ExceptionPorts::ExceptionHandlerVector original_handlers_;
struct sigaction old_action_ = {};
internal::InProcessHandler in_process_handler_;
Expand Down
39 changes: 20 additions & 19 deletions third_party/crashpad/crashpad/client/crashpad_client_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <tuple>
#include <utility>

#include "base/apple/mach_logging.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "base/strings/stringprintf.h"
#include "util/mac/mac_util.h"
#include "util/mach/bootstrap.h"
Expand Down Expand Up @@ -122,18 +122,18 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
//!
//! \return On success, a send right to the Crashpad handler that has been
//! started. On failure, `MACH_PORT_NULL` with a message logged.
static base::mac::ScopedMachSendRight InitialStart(
static base::apple::ScopedMachSendRight InitialStart(
const base::FilePath& handler,
const base::FilePath& database,
const base::FilePath& metrics_dir,
const std::string& url,
const std::map<std::string, std::string>& annotations,
const std::vector<std::string>& arguments,
bool restartable) {
base::mac::ScopedMachReceiveRight receive_right(
base::apple::ScopedMachReceiveRight receive_right(
NewMachPort(MACH_PORT_RIGHT_RECEIVE));
if (!receive_right.is_valid()) {
return base::mac::ScopedMachSendRight();
return base::apple::ScopedMachSendRight();
}

mach_port_t port;
Expand All @@ -145,9 +145,9 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
&right_type);
if (kr != KERN_SUCCESS) {
MACH_LOG(ERROR, kr) << "mach_port_extract_right";
return base::mac::ScopedMachSendRight();
return base::apple::ScopedMachSendRight();
}
base::mac::ScopedMachSendRight send_right(port);
base::apple::ScopedMachSendRight send_right(port);
DCHECK_EQ(port, receive_right.get());
DCHECK_EQ(right_type,
implicit_cast<mach_msg_type_name_t>(MACH_MSG_TYPE_PORT_SEND));
Expand All @@ -171,7 +171,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
std::move(receive_right),
handler_restarter.get(),
false)) {
return base::mac::ScopedMachSendRight();
return base::apple::ScopedMachSendRight();
}

if (handler_restarter &&
Expand Down Expand Up @@ -211,7 +211,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
url_,
annotations_,
arguments_,
base::mac::ScopedMachReceiveRight(rights),
base::apple::ScopedMachReceiveRight(rights),
this,
true);

Expand Down Expand Up @@ -256,7 +256,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
const std::string& url,
const std::map<std::string, std::string>& annotations,
const std::vector<std::string>& arguments,
base::mac::ScopedMachReceiveRight receive_right,
base::apple::ScopedMachReceiveRight receive_right,
HandlerStarter* handler_restarter,
bool restart) {
DCHECK(!restart || handler_restarter);
Expand All @@ -282,7 +282,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
// port-destroyed notifications can be delivered.
handler_restarter->notify_port_.reset();
} else {
base::mac::ScopedMachSendRight previous_owner(previous);
base::apple::ScopedMachSendRight previous_owner(previous);
DCHECK(restart || !previous_owner.is_valid());
}

Expand Down Expand Up @@ -430,7 +430,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
std::string url_;
std::map<std::string, std::string> annotations_;
std::vector<std::string> arguments_;
base::mac::ScopedMachReceiveRight notify_port_;
base::apple::ScopedMachReceiveRight notify_port_;
uint64_t last_start_time_;
};

Expand Down Expand Up @@ -458,7 +458,7 @@ bool CrashpadClient::StartHandler(
// The “restartable” behavior can only be selected on OS X 10.10 and later. In
// previous OS versions, if the initial client were to crash while attempting
// to restart the handler, it would become an unkillable process.
base::mac::ScopedMachSendRight exception_port(HandlerStarter::InitialStart(
base::apple::ScopedMachSendRight exception_port(HandlerStarter::InitialStart(
handler,
database,
metrics_dir,
Expand All @@ -476,7 +476,8 @@ bool CrashpadClient::StartHandler(
}

bool CrashpadClient::SetHandlerMachService(const std::string& service_name) {
base::mac::ScopedMachSendRight exception_port(BootstrapLookUp(service_name));
base::apple::ScopedMachSendRight exception_port(
BootstrapLookUp(service_name));
if (!exception_port.is_valid()) {
return false;
}
Expand All @@ -486,7 +487,7 @@ bool CrashpadClient::SetHandlerMachService(const std::string& service_name) {
}

bool CrashpadClient::SetHandlerMachPort(
base::mac::ScopedMachSendRight exception_port) {
base::apple::ScopedMachSendRight exception_port) {
DCHECK(!exception_port_.is_valid());
DCHECK(exception_port.is_valid());

Expand All @@ -498,7 +499,7 @@ bool CrashpadClient::SetHandlerMachPort(
return true;
}

base::mac::ScopedMachSendRight CrashpadClient::GetHandlerMachPort() const {
base::apple::ScopedMachSendRight CrashpadClient::GetHandlerMachPort() const {
DCHECK(exception_port_.is_valid());

// For the purposes of this method, only return a port set by
Expand All @@ -519,16 +520,16 @@ base::mac::ScopedMachSendRight CrashpadClient::GetHandlerMachPort() const {
mach_task_self(), exception_port_.get(), MACH_PORT_RIGHT_SEND, 1);
if (kr != KERN_SUCCESS) {
MACH_LOG(ERROR, kr) << "mach_port_mod_refs";
return base::mac::ScopedMachSendRight(MACH_PORT_NULL);
return base::apple::ScopedMachSendRight(MACH_PORT_NULL);
}

return base::mac::ScopedMachSendRight(exception_port_.get());
return base::apple::ScopedMachSendRight(exception_port_.get());
}

// static
void CrashpadClient::UseSystemDefaultHandler() {
base::mac::ScopedMachSendRight
system_crash_reporter_handler(SystemCrashReporterHandler());
base::apple::ScopedMachSendRight system_crash_reporter_handler(
SystemCrashReporterHandler());

// Proceed even if SystemCrashReporterHandler() failed, setting MACH_PORT_NULL
// to clear the current exception ports.
Expand Down
6 changes: 3 additions & 3 deletions third_party/crashpad/crashpad/client/simulate_crash_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

#include <iterator>

#include "base/apple/mach_logging.h"
#include "base/apple/scoped_mach_port.h"
#include "base/check_op.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "base/mac/scoped_mach_port.h"
#include "build/build_config.h"
#include "util/mach/exc_client_variants.h"
#include "util/mach/exception_behaviors.h"
Expand Down Expand Up @@ -205,7 +205,7 @@ void SimulateCrash(const NativeCPUContext& cpu_context) {
#error Port to your CPU architecture
#endif

base::mac::ScopedMachSendRight thread(mach_thread_self());
base::apple::ScopedMachSendRight thread(mach_thread_self());
exception_type_t exception = kMachExceptionSimulated;
mach_exception_data_type_t codes[] = {0, 0};
mach_msg_type_number_t code_count = std::size(codes);
Expand Down
4 changes: 2 additions & 2 deletions third_party/crashpad/crashpad/handler/handler_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#include <libgen.h>
#include <signal.h>

#include "base/mac/scoped_mach_port.h"
#include "base/apple/scoped_mach_port.h"
#include "handler/mac/crash_report_exception_handler.h"
#include "handler/mac/exception_handler_server.h"
#include "handler/mac/file_limit_annotation.h"
Expand Down Expand Up @@ -1113,7 +1113,7 @@ int HandlerMain(int argc,
CloseStdinAndStdout();
}

base::mac::ScopedMachReceiveRight receive_right;
base::apple::ScopedMachReceiveRight receive_right;

if (options.handshake_fd >= 0) {
receive_right.reset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <utility>
#include <vector>

#include "base/apple/mach_logging.h"
#include "base/apple/scoped_mach_port.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "base/mac/scoped_mach_port.h"
#include "base/strings/stringprintf.h"
#include "client/settings.h"
#include "handler/mac/file_limit_annotation.h"
Expand Down Expand Up @@ -200,8 +200,8 @@ kern_return_t CrashReportExceptionHandler::CatchMachException(
// processes that haven’t actually crashed, and could result in reports not
// actually associated with crashes being sent to the operating system
// vendor.
base::mac::ScopedMachSendRight
system_crash_reporter_handler(SystemCrashReporterHandler());
base::apple::ScopedMachSendRight system_crash_reporter_handler(
SystemCrashReporterHandler());
if (system_crash_reporter_handler.get()) {
// Make copies of mutable out parameters so that the system crash reporter
// can’t influence the state returned by this method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include <utility>

#include "base/apple/mach_logging.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "util/mach/composite_mach_message_server.h"
#include "util/mach/mach_extensions.h"
#include "util/mach/mach_message.h"
Expand Down Expand Up @@ -73,7 +73,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&previous);
MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_request_notification";
base::mac::ScopedMachSendRight previous_owner(previous);
base::apple::ScopedMachSendRight previous_owner(previous);
}

// A single CompositeMachMessageServer will dispatch both exception messages
Expand All @@ -84,7 +84,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
// from ever existing. Using distinct receive rights also allows the handler
// methods to ensure that the messages they process were sent by a holder of
// the proper send right.
base::mac::ScopedMachPortSet server_port_set(
base::apple::ScopedMachPortSet server_port_set(
NewMachPort(MACH_PORT_RIGHT_PORT_SET));
CHECK(server_port_set.is_valid());

Expand Down Expand Up @@ -192,7 +192,7 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
} // namespace

ExceptionHandlerServer::ExceptionHandlerServer(
base::mac::ScopedMachReceiveRight receive_port,
base::apple::ScopedMachReceiveRight receive_port,
bool launchd)
: receive_port_(std::move(receive_port)),
notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <mach/mach.h>

#include "base/mac/scoped_mach_port.h"
#include "base/apple/scoped_mach_port.h"
#include "util/mach/exc_server_variants.h"

namespace crashpad {
Expand All @@ -34,7 +34,7 @@ class ExceptionHandlerServer {
//! launchd. \a receive_port is not monitored for no-senders
//! notifications, and instead, Stop() must be called to provide a “quit”
//! signal.
ExceptionHandlerServer(base::mac::ScopedMachReceiveRight receive_port,
ExceptionHandlerServer(base::apple::ScopedMachReceiveRight receive_port,
bool launchd);

ExceptionHandlerServer(const ExceptionHandlerServer&) = delete;
Expand Down Expand Up @@ -73,8 +73,8 @@ class ExceptionHandlerServer {
void Stop();

private:
base::mac::ScopedMachReceiveRight receive_port_;
base::mac::ScopedMachReceiveRight notify_port_;
base::apple::ScopedMachReceiveRight receive_port_;
base::apple::ScopedMachReceiveRight notify_port_;
bool launchd_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "snapshot/ios/exception_snapshot_ios_intermediate_dump.h"

#include "base/apple/mach_logging.h"
#include "base/logging.h"
#include "base/mac/mach_logging.h"
#include "snapshot/cpu_context.h"
#include "snapshot/ios/intermediate_dump_reader_util.h"
#include "snapshot/mac/cpu_context_mac.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <mach-o/loader.h>
#include <mach/mach.h>

#include "base/apple/mach_logging.h"
#include "base/files/file_path.h"
#include "base/mac/mach_logging.h"
#include "client/annotation.h"
#include "snapshot/ios/intermediate_dump_reader_util.h"
#include "util/ios/ios_intermediate_dump_data.h"
Expand Down

0 comments on commit 7684cf6

Please sign in to comment.