summaryrefslogtreecommitdiff
path: root/indra/llcommon/llapp.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-11-12 17:34:30 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-11-12 17:34:30 -0500
commit3ea3d4cf16894c928cd60c19429dbec158185f96 (patch)
treec6331ca9eb06764e1d8109b6d90002ee34507d04 /indra/llcommon/llapp.cpp
parentd9c0e0ba74d3f042ae7f3a7310f0c0bf23e6eaa9 (diff)
parent63466f0ecae64cad8d2f74ccd1ade29121a26a95 (diff)
merge
Diffstat (limited to 'indra/llcommon/llapp.cpp')
-rw-r--r--indra/llcommon/llapp.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index eebd5ed0a6..39daefd1ad 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -90,6 +90,10 @@ S32 LL_HEARTBEAT_SIGNAL = (SIGRTMAX >= 0) ? (SIGRTMAX-0) : SIGUSR2;
// the static application instance
LLApp* LLApp::sApplication = NULL;
+// Allows the generation of core files for post mortem under gdb
+// and disables crashlogger
+BOOL LLApp::sDisableCrashlogger = FALSE;
+
// Local flag for whether or not to do logging in signal handlers.
//static
BOOL LLApp::sLogInSignal = FALSE;
@@ -461,11 +465,30 @@ bool LLApp::isQuitting()
return (APP_STATUS_QUITTING == sStatus);
}
+// static
bool LLApp::isExiting()
{
return isQuitting() || isError();
}
+void LLApp::disableCrashlogger()
+{
+ // Disable Breakpad exception handler.
+ if (mExceptionHandler != 0)
+ {
+ delete mExceptionHandler;
+ mExceptionHandler = 0;
+ }
+
+ sDisableCrashlogger = TRUE;
+}
+
+// static
+bool LLApp::isCrashloggerDisabled()
+{
+ return (sDisableCrashlogger == TRUE);
+}
+
#if !LL_WINDOWS
// static
U32 LLApp::getSigChildCount()
@@ -799,6 +822,15 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
{
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
}
+
+ if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
+ {
+ clear_signals();
+ llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
+ raise(signum);
+ return;
+ }
+
// Flag status to ERROR, so thread_error does its work.
LLApp::setError();
// Block in the signal handler until somebody says that we're done.