Bug 1497060 - Stop putting stack information in record/replay error messages, r=froydnj.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 09 Oct 2018 14:24:44 -1000
changeset 498949 eff92a00f2d86994ecc2fd5c80e13e958b7b45b4
parent 498948 31c68d4d5e8b3e117d19795debe841a968797441
child 498950 d85e5fb4421c39a263ea1268f39804a6c91f0bee
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1497060
milestone64.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 1497060 - Stop putting stack information in record/replay error messages, r=froydnj.
toolkit/recordreplay/ipc/ChildIPC.cpp
--- a/toolkit/recordreplay/ipc/ChildIPC.cpp
+++ b/toolkit/recordreplay/ipc/ChildIPC.cpp
@@ -13,17 +13,16 @@
 #include "base/task.h"
 #include "chrome/common/child_thread.h"
 #include "chrome/common/mach_ipc_mac.h"
 #include "ipc/Channel.h"
 #include "mac/handler/exception_handler.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/Sprintf.h"
-#include "mozilla/StackWalk.h"
 #include "mozilla/VsyncDispatcher.h"
 
 #include "InfallibleVector.h"
 #include "MemorySnapshot.h"
 #include "nsPrintfCString.h"
 #include "ParentInternal.h"
 #include "ProcessRecordReplay.h"
 #include "ProcessRedirect.h"
@@ -326,56 +325,16 @@ DebuggerRunsInMiddleman()
 }
 
 void
 MaybeCreateInitialCheckpoint()
 {
   NewCheckpoint(/* aTemporary = */ false);
 }
 
-struct StackWalkData
-{
-  // Current buffer and allocated size, which may be internal to the original
-  // allocation.
-  char* mBuf;
-  size_t mSize;
-
-  StackWalkData(char* aBuf, size_t aSize)
-    : mBuf(aBuf), mSize(aSize)
-  {}
-
-  void append(const char* aText) {
-    size_t len = strlen(aText);
-    if (len <= mSize) {
-      memcpy(mBuf, aText, len);
-      mBuf += len;
-      mSize -= len;
-    }
-  }
-};
-
-static void
-StackWalkCallback(uint32_t aFrameNumber, void* aPC, void* aSP, void* aClosure)
-{
-  StackWalkData* data = (StackWalkData*) aClosure;
-
-  MozCodeAddressDetails details;
-  MozDescribeCodeAddress(aPC, &details);
-
-  data->append(" ### ");
-  data->append(details.function[0] ? details.function : "???");
-}
-
-static void
-SetCurrentStackString(const char* aAssertion, char* aBuf, size_t aSize)
-{
-  StackWalkData data(aBuf, aSize);
-  MozStackWalk(StackWalkCallback, /* aSkipFrames = */ 2, /* aFrameCount = */ 32, &data);
-}
-
 void
 ReportFatalError(const Maybe<MinidumpInfo>& aMinidump, const char* aFormat, ...)
 {
   // Unprotect any memory which might be written while producing the minidump.
   UnrecoverableSnapshotFailure();
 
   AutoEnsurePassThroughThreadEvents pt;
 
@@ -388,23 +347,16 @@ ReportFatalError(const Maybe<MinidumpInf
 #endif
 
   va_list ap;
   va_start(ap, aFormat);
   char buf[2048];
   VsprintfLiteral(buf, aFormat, ap);
   va_end(ap);
 
-  // Include stack information in the error message as well, if we are on the
-  // thread where the fatal error occurred.
-  if (aMinidump.isNothing()) {
-    size_t len = strlen(buf);
-    SetCurrentStackString(buf, buf + len, sizeof(buf) - len);
-  }
-
   // Construct a FatalErrorMessage on the stack, to avoid touching the heap.
   char msgBuf[4096];
   size_t header = sizeof(FatalErrorMessage);
   size_t len = std::min(strlen(buf) + 1, sizeof(msgBuf) - header);
   FatalErrorMessage* msg = new(msgBuf) FatalErrorMessage(header + len);
   memcpy(&msgBuf[header], buf, len);
   msgBuf[sizeof(msgBuf) - 1] = 0;