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

Unified Diff: content/public/test/browser_test_base.cc

Issue 2250503002: Handle SIGSEGV in BrowserTestBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_base.cc
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index c6d2e4b6a03c91f8fc0a4adc8ae160b69d20c030..73563f4f26a9696fc8859e71d8a459fd8c0cb097 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -71,9 +71,10 @@ namespace {
static int g_browser_process_pid;
static void DumpStackTraceSignalHandler(int signal) {
if (g_browser_process_pid == base::GetCurrentProcId()) {
- logging::RawLog(logging::LOG_ERROR,
- "BrowserTestBase signal handler received SIGTERM. "
- "Backtrace:\n");
+ std::string message("BrowserTestBase received signal: ");
+ message += strsignal(signal);
+ message += ". Backtrace:\n";
+ logging::RawLog(logging::LOG_ERROR, message.c_str());
base::debug::StackTrace().Print();
}
_exit(128 + signal);
@@ -317,6 +318,7 @@ void BrowserTestBase::ProxyRunTestOnMainThreadLoop() {
if (handle_sigterm_) {
g_browser_process_pid = base::GetCurrentProcId();
signal(SIGTERM, DumpStackTraceSignalHandler);
+ signal(SIGSEGV, DumpStackTraceSignalHandler);
Paweł Hajdan Jr. 2016/08/17 06:34:09 Could you just move this and g_browser_process_pid
michaelpg 2016/08/18 23:44:37 Done.
}
#endif // defined(OS_POSIX)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698