Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1098)

Unified Diff: util/mach/exc_server_variants.h

Issue 1305893010: Don’t trigger EXC_CORPSE_NOTIFY on OS X 10.11 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/mac/exception_port_tool.cc ('k') | util/mach/exc_server_variants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/exc_server_variants.h
diff --git a/util/mach/exc_server_variants.h b/util/mach/exc_server_variants.h
index aaac36ad75f13e60480e33a2ad4fbef172041c50..95d1c12d4e72d5ea00e908eda3ed99f5f5579b80 100644
--- a/util/mach/exc_server_variants.h
+++ b/util/mach/exc_server_variants.h
@@ -150,6 +150,17 @@ class UniversalMachExcServer final : public MachMessageServer::Interface {
//! schedulable, so there is no point in setting the states of any of its
//! threads.
//!
+//! On OS X 10.11, the `MACH_RCV_PORT_DIED` mechanism cannot be used with an
+//! `EXC_CRASH` handler without triggering an undesirable `EXC_CORPSE_NOTIFY`
+//! exception. In that case, `KERN_SUCCESS` is always returned. Because this
+//! function may return `KERN_SUCCESS` for a state-carrying exception, it is
+//! important to ensure that the state returned by a state-carrying exception
+//! handler is valid, because it will be passed to `thread_set_status()`.
+//! ExcServerCopyState() may be used to achieve this.
+//!
+//! \param[in] exception The exception type passed to the exception handler.
+//! This may be taken directly from the \a exception parameter of
+//! internal::SimplifiedExcServer::Interface::CatchException(), for example.
//! \param[in] behavior The behavior of the exception handler as invoked. This
//! may be taken directly from the \a behavior parameter of
//! internal::SimplifiedExcServer::Interface::CatchException(), for example.
@@ -160,10 +171,11 @@ class UniversalMachExcServer final : public MachMessageServer::Interface {
//!
//! \return `KERN_SUCCESS` or `MACH_RCV_PORT_DIED`. `KERN_SUCCESS` is used when
//! \a behavior is not a state-carrying behavior, or when it is a
-//! state-carrying behavior and \a set_thread_state is `true`.
-//! `MACH_RCV_PORT_DIED` is used when \a behavior is a state-carrying
-//! behavior and \a set_thread_state is `false`.
-kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior,
+//! state-carrying behavior and \a set_thread_state is `true`, or for
+//! `EXC_CRASH` exceptions on OS X 10.11 and later. Otherwise,
+//! `MACH_RCV_PORT_DIED` is used.
+kern_return_t ExcServerSuccessfulReturnValue(exception_type_t exception,
+ exception_behavior_t behavior,
bool set_thread_state);
//! \brief Copies the old state to the new state for state-carrying exceptions.
« no previous file with comments | « tools/mac/exception_port_tool.cc ('k') | util/mach/exc_server_variants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698