Skip to content
Snippets Groups Projects
Commit e9976b07 authored by Aura Linden's avatar Aura Linden
Browse files

Merges in fix for Maint-5707

parents 828ff161 e5dae422
No related branches found
No related tags found
No related merge requests found
......@@ -320,7 +320,7 @@ void EnableCrashingOnCrashes()
}
#endif
void LLApp::setupErrorHandling()
void LLApp::setupErrorHandling(bool second_instance)
{
// Error handling is done by starting up an error handling thread, which just sleeps and
// occasionally checks to see if the app is in an error state, and sees if it needs to be run.
......@@ -337,40 +337,52 @@ void LLApp::setupErrorHandling()
// Install the Google Breakpad crash handler for Windows
if(mExceptionHandler == 0)
{
llwarns << "adding breakpad exception handler" << llendl;
if ( second_instance ) //BUG-5707 Firing teleport from a web browser causes second
{
mExceptionHandler = new google_breakpad::ExceptionHandler(
L"C:\\Temp\\",
0, //No filter
windows_post_minidump_callback,
0,
google_breakpad::ExceptionHandler::HANDLER_ALL); //No custom client info.
}
else
{
llwarns << "adding breakpad exception handler" << llendl;
std::wstring wpipe_name;
wpipe_name = mCrashReportPipeStr + wstringize(getPid());
std::wstring wpipe_name;
wpipe_name = mCrashReportPipeStr + wstringize(getPid());
const std::wstring wdump_path(wstringize(mDumpPath));
const std::wstring wdump_path(wstringize(mDumpPath));
int retries = 30;
for (; retries > 0; --retries)
{
if (mExceptionHandler != 0) delete mExceptionHandler;
mExceptionHandler = new google_breakpad::ExceptionHandler(
wdump_path,
NULL, //No filter
windows_post_minidump_callback,
0,
google_breakpad::ExceptionHandler::HANDLER_ALL,
MiniDumpNormal, //Generate a 'normal' minidump.
wpipe_name.c_str(),
NULL); //No custom client info.
if (mExceptionHandler->IsOutOfProcess())
int retries = 30;
for (; retries > 0; --retries)
{
LL_INFOS("CRASHREPORT") << "Successfully attached to Out of Process exception handler." << LL_ENDL;
break;
}
else
{
LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler. " << retries << " retries remaining." << LL_ENDL;
::Sleep(100); //Wait a tick and try again.
if (mExceptionHandler != 0) delete mExceptionHandler;
mExceptionHandler = new google_breakpad::ExceptionHandler(
wdump_path,
NULL, //No filter
windows_post_minidump_callback,
0,
google_breakpad::ExceptionHandler::HANDLER_ALL,
MiniDumpNormal, //Generate a 'normal' minidump.
wpipe_name.c_str(),
NULL); //No custom client info.
if (mExceptionHandler->IsOutOfProcess())
{
LL_INFOS("CRASHREPORT") << "Successfully attached to Out of Process exception handler." << LL_ENDL;
break;
}
else
{
LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler. " << retries << " retries remaining." << LL_ENDL;
::Sleep(100); //Wait a tick and try again.
}
}
}
if (retries == 0) LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler." << LL_ENDL;
if (retries == 0) LL_WARNS("CRASHREPORT") << "Unable to attach to Out of Process exception handler." << LL_ENDL;
}
if (mExceptionHandler)
{
......
......@@ -214,7 +214,7 @@ class LL_COMMON_API LLApp : public LLOptionInterface
* DO NOT call this method if your application has specialized
* error handling code.
*/
void setupErrorHandling();
void setupErrorHandling(bool mSecondInstance=false);
void setErrorHandler(LLAppErrorHandler handler);
static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred.
......
......@@ -740,7 +740,7 @@ class LLUITranslationBridge : public LLTranslationBridge
bool LLAppViewer::init()
{
setupErrorHandling();
setupErrorHandling(mSecondInstance);
//
// Start of the application
......
......@@ -80,6 +80,7 @@ class LLAppViewer : public LLApp
bool quitRequested() { return mQuitRequested; }
bool logoutRequestSent() { return mLogoutRequestSent; }
bool isSecondInstance() { return mSecondInstance; }
void writeDebugInfo(bool isStatic=true);
......
......@@ -674,6 +674,8 @@ bool LLAppViewerWin32::restoreErrorTrap()
void LLAppViewerWin32::initCrashReporting(bool reportFreeze)
{
if (isSecondInstance()) return; //BUG-5707 do not start another crash reporter for second instance.
const char* logger_name = "win_crash_logger.exe";
std::string exe_path = gDirUtilp->getExecutableDir();
exe_path += gDirUtilp->getDirDelimiter();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment