Bug 1570089 Part 2 - Associate replaying process crash reports with their own pid, r=gsvelto.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 01 Aug 2019 11:41:58 +0000
changeset 486117 28b46b8166ee83421f5210655188d633db62e4cd
parent 486116 73faa9185b0d6bead85ced00abf7dba44ddc5522
child 486118 6b5eb4429f83354e9fbe02876f569e8de5c21c3d
push id36390
push usercbrindusan@mozilla.com
push dateMon, 05 Aug 2019 09:54:13 +0000
treeherdermozilla-central@d681969e4480 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsvelto
bugs1570089
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1570089 Part 2 - Associate replaying process crash reports with their own pid, r=gsvelto. Depends on D39925 Differential Revision: https://phabricator.services.mozilla.com/D39926
toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_client.cc
toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
--- a/toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_client.cc
+++ b/toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_client.cc
@@ -52,19 +52,21 @@ bool CrashGenerationClient::RequestDumpF
   message.AddDescriptor(acknowledge_port.GetPort());  // message receive port
 
   ExceptionInfo info;
   info.exception_type = exception_type;
   info.exception_code = exception_code;
   info.exception_subcode = exception_subcode;
   info.child_pid = getpid();
 
-  // When recording/replaying, associate minidumps with the middleman process
-  // so that the UI process can find them.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
+  // Recording processes are managed by a middleman process, rather than the
+  // parent process. Associate their minidumps with the middleman's pid so that
+  // the parent process can find them. Replaying processes are managed by the
+  // parent process directly, and don't need this treatment.
+  if (mozilla::recordreplay::IsRecording()) {
     info.child_pid = mozilla::recordreplay::child::MiddlemanProcessId();
   }
 
   message.SetData(&info, sizeof(info));
 
   const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000;
   kern_return_t result = sender_.SendMessage(message, kSendTimeoutMs);
   if (result != KERN_SUCCESS)
--- a/toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
+++ b/toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
@@ -685,19 +685,19 @@ bool ExceptionHandler::InstallHandler() 
 #else
     previous_ = new ExceptionParameters();
 #endif
   }
   catch (std::bad_alloc) {
     return false;
   }
 
-  // Don't modify exception ports when replaying, to avoid interfering with the
-  // record/replay system's exception handler.
-  if (mozilla::recordreplay::IsReplaying()) {
+  // Don't modify exception ports when recording or replaying, to avoid
+  // interfering with the record/replay system's exception handler.
+  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
     return true;
   }
 
   // Save the current exception ports so that we can forward to them
   previous_->count = EXC_TYPES_COUNT;
   mach_port_t current_task = mach_task_self();
   kern_return_t result = task_get_exception_ports(current_task,
                                                   s_exception_mask,