-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from Artur96/develop
Patch for disabling crashpad handler on macOS Fixes #315
- Loading branch information
Showing
2 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
ungoogled-chromium/macos/disable-symbol-order-verification.patch | ||
ungoogled-chromium/macos/disable-crashpad-handler.patch | ||
ungoogled-chromium/macos/add-trknotify-gn-dependency.patch | ||
ungoogled-chromium/macos/fix-gn-bootstrap.patch | ||
ungoogled-chromium/macos/fix-gn-safe_browsing.patch | ||
ungoogled-chromium/macos/fix-mapped_file.patch | ||
ungoogled-chromium/macos/fix-visibility.patch | ||
ungoogled-chromium/macos/fix-visibility.patch |
92 changes: 92 additions & 0 deletions
92
resources/patches/ungoogled-chromium/macos/disable-crashpad-handler.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Disables crashpad_handler process | ||
|
||
--- a/third_party/crashpad/crashpad/client/crashpad_client_mac.cc | ||
+++ b/third_party/crashpad/crashpad/client/crashpad_client_mac.cc | ||
@@ -123,61 +123,7 @@ class HandlerStarter final : public Noti | ||
const std::map<std::string, std::string>& annotations, | ||
const std::vector<std::string>& arguments, | ||
bool restartable) { | ||
- base::mac::ScopedMachReceiveRight receive_right( | ||
- NewMachPort(MACH_PORT_RIGHT_RECEIVE)); | ||
- if (!receive_right.is_valid()) { | ||
- return base::mac::ScopedMachSendRight(); | ||
- } | ||
- | ||
- mach_port_t port; | ||
- mach_msg_type_name_t right_type; | ||
- kern_return_t kr = mach_port_extract_right(mach_task_self(), | ||
- receive_right.get(), | ||
- MACH_MSG_TYPE_MAKE_SEND, | ||
- &port, | ||
- &right_type); | ||
- if (kr != KERN_SUCCESS) { | ||
- MACH_LOG(ERROR, kr) << "mach_port_extract_right"; | ||
- return base::mac::ScopedMachSendRight(); | ||
- } | ||
- base::mac::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)); | ||
- | ||
- std::unique_ptr<HandlerStarter> handler_restarter; | ||
- if (restartable) { | ||
- handler_restarter.reset(new HandlerStarter()); | ||
- if (!handler_restarter->notify_port_.is_valid()) { | ||
- // This is an error that NewMachPort() would have logged. Proceed anyway | ||
- // without the ability to restart. | ||
- handler_restarter.reset(); | ||
- } | ||
- } | ||
- | ||
- if (!CommonStart(handler, | ||
- database, | ||
- metrics_dir, | ||
- url, | ||
- annotations, | ||
- arguments, | ||
- std::move(receive_right), | ||
- handler_restarter.get(), | ||
- false)) { | ||
- return base::mac::ScopedMachSendRight(); | ||
- } | ||
- | ||
- if (handler_restarter && | ||
- handler_restarter->StartRestartThread( | ||
- handler, database, metrics_dir, url, annotations, arguments)) { | ||
- // The thread owns the object now. | ||
- ignore_result(handler_restarter.release()); | ||
- } | ||
- | ||
- // If StartRestartThread() failed, proceed without the ability to restart. | ||
- // handler_restarter will be released when this function returns. | ||
- | ||
- return send_right; | ||
+ return base::mac::ScopedMachSendRight(); | ||
} | ||
|
||
// NotifyServer::DefaultInterface: | ||
@@ -456,23 +402,7 @@ bool CrashpadClient::StartHandler( | ||
const std::vector<std::string>& arguments, | ||
bool restartable, | ||
bool asynchronous_start) { | ||
- // 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(handler, | ||
- database, | ||
- metrics_dir, | ||
- url, | ||
- annotations, | ||
- arguments, | ||
- restartable && MacOSXMinorVersion() >= 10)); | ||
- if (!exception_port.is_valid()) { | ||
- return false; | ||
- } | ||
- | ||
- SetHandlerMachPort(std::move(exception_port)); | ||
- return true; | ||
+ return false; | ||
} | ||
|
||
bool CrashpadClient::SetHandlerMachService(const std::string& service_name) { |