Little cleanup regarding crashlogger toggling.
This commit is contained in:
@@ -401,6 +401,18 @@ bool LLApp::isExiting()
|
|||||||
return isQuitting() || isError();
|
return isQuitting() || isError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLApp::disableCrashlogger()
|
||||||
|
{
|
||||||
|
// Disable Breakpad exception handler.
|
||||||
|
sDisableCrashlogger = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
bool LLApp::isCrashloggerDisabled()
|
||||||
|
{
|
||||||
|
return (sDisableCrashlogger == TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
#if !LL_WINDOWS
|
#if !LL_WINDOWS
|
||||||
// static
|
// static
|
||||||
U32 LLApp::getSigChildCount()
|
U32 LLApp::getSigChildCount()
|
||||||
@@ -734,7 +746,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
|||||||
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
|
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(LLApp::sDisableCrashlogger) //Don't gracefully handle any signals crash and core for a gdb post mortum
|
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
|
||||||
{
|
{
|
||||||
clear_signals();
|
clear_signals();
|
||||||
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
|
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
|
||||||
|
|||||||
@@ -191,6 +191,11 @@ public:
|
|||||||
//
|
//
|
||||||
virtual bool mainLoop() = 0; // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit.
|
virtual bool mainLoop() = 0; // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit.
|
||||||
|
|
||||||
|
//
|
||||||
|
// Crash logging
|
||||||
|
//
|
||||||
|
void disableCrashlogger(); // Let the OS handle the crashes
|
||||||
|
static bool isCrashloggerDisabled(); // Get the here above set value
|
||||||
|
|
||||||
//
|
//
|
||||||
// Application status
|
// Application status
|
||||||
@@ -214,9 +219,6 @@ public:
|
|||||||
//
|
//
|
||||||
void setErrorHandler(LLAppErrorHandler handler);
|
void setErrorHandler(LLAppErrorHandler handler);
|
||||||
void setSyncErrorHandler(LLAppErrorHandler handler);
|
void setSyncErrorHandler(LLAppErrorHandler handler);
|
||||||
|
|
||||||
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
|
|
||||||
|
|
||||||
#if !LL_WINDOWS
|
#if !LL_WINDOWS
|
||||||
//
|
//
|
||||||
// Child process handling (Unix only for now)
|
// Child process handling (Unix only for now)
|
||||||
@@ -245,6 +247,7 @@ protected:
|
|||||||
static void setStatus(EAppStatus status); // Use this to change the application status.
|
static void setStatus(EAppStatus status); // Use this to change the application status.
|
||||||
static EAppStatus sStatus; // Reflects current application status
|
static EAppStatus sStatus; // Reflects current application status
|
||||||
static BOOL sErrorThreadRunning; // Set while the error thread is running
|
static BOOL sErrorThreadRunning; // Set while the error thread is running
|
||||||
|
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
|
||||||
|
|
||||||
#if !LL_WINDOWS
|
#if !LL_WINDOWS
|
||||||
static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received.
|
static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received.
|
||||||
|
|||||||
@@ -2145,7 +2145,7 @@ bool LLAppViewer::initConfiguration()
|
|||||||
if(clp.hasOption("disablecrashlogger"))
|
if(clp.hasOption("disablecrashlogger"))
|
||||||
{
|
{
|
||||||
llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" <<llendl;
|
llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" <<llendl;
|
||||||
sDisableCrashlogger=TRUE;
|
LLAppViewer::instance()->disableCrashlogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle initialization from settings.
|
// Handle initialization from settings.
|
||||||
@@ -2731,7 +2731,7 @@ void LLAppViewer::handleViewerCrash()
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pApp->sDisableCrashlogger==TRUE)
|
if (LLApp::isCrashloggerDisabled())
|
||||||
{
|
{
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user