Create crash dump if a bad IPC message is received.
BUG=473370
Review URL: https://codereview.chromium.org/1058423002
Cr-Commit-Position: refs/heads/master@{#324003}
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 08486fc..684e0db 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -7,6 +7,7 @@
#include "base/base_switches.h"
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/debug/dump_without_crashing.h"
#include "base/files/file_path.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
@@ -254,6 +255,11 @@
}
LOG(ERROR) << "Terminating child process for bad IPC message of type "
<< message.type();
+
+ // Create a memory dump. This will contain enough stack frames to work out
+ // what the bad message was.
+ base::debug::DumpWithoutCrashing();
+
child_process_->GetProcess().Terminate(RESULT_CODE_KILLED_BAD_MESSAGE, false);
}