toolkit/crashreporter/breakpad-patches/21-bug1068410-crash-server-pipe.patch
author J. Ryan Stinnett <jryans@gmail.com>
Fri, 23 Oct 2015 02:43:09 -0500
changeset 302911 7060ded3194d6d0b17949edc3e76d93e013497aa
parent 208795 afeff2d265bdf1d9b27284de44b6185082691f91
permissions -rw-r--r--
Bug 1217687 - Revert back to including /devtools via toolkit. r=glandium

commit 634161872e2dcddcea95784651a985e8ebe3e937
Author: Jed Davis <jld@mozilla.com>
Date:   Wed Sep 17 11:35:34 2014 -0700

    Bug 1068410 - Convert remote crash dump to use pipe instead of socketpair in the child.

diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
index 6ede779..df069e4 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
@@ -45,7 +45,8 @@ bool
 CrashGenerationClient::RequestDump(const void* blob, size_t blob_size)
 {
   int fds[2];
-  sys_socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
+  if (sys_pipe(fds) != 0)
+    return false;
   static const unsigned kControlMsgSize = CMSG_SPACE(sizeof(int));
 
   struct kernel_msghdr msg;
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
index 420e4b2..721078c 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
@@ -275,14 +275,7 @@ CrashGenerationServer::ClientEvent(short revents)
   }
 
   // Send the done signal to the process: it can exit now.
-  memset(&msg, 0, sizeof(msg));
-  struct iovec done_iov;
-  done_iov.iov_base = const_cast<char*>("\x42");
-  done_iov.iov_len = 1;
-  msg.msg_iov = &done_iov;
-  msg.msg_iovlen = 1;
-
-  HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL));
+  // (Closing this will make the child's sys_read unblock and return 0.)
   HANDLE_EINTR(close(signal_fd));
 
   return true;