From 903996e8d4ebc30c42d3c2d041fb7a1c8e530ab8 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 28 Mar 2013 19:25:51 -0700 Subject: Google Breakpad Fix --- indra/llcommon/llapp.cpp | 59 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/llapp.cpp') diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index ca258900c7..c6da205815 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -69,10 +69,16 @@ bool windows_post_minidump_callback(const wchar_t* dump_path, void setup_signals(); void default_unix_signal_handler(int signum, siginfo_t *info, void *); +#if LL_LINUX +#include "google_breakpad/minidump_descriptor.h" +bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, void* context, bool succeeded); +#else // Called by breakpad exception handler after the minidump has been generated. bool unix_post_minidump_callback(const char *dump_dir, const char *minidump_id, void *context, bool succeeded); +#endif + # if LL_DARWIN /* OSX doesn't support SIGRT* */ S32 LL_SMACKDOWN_SIGNAL = SIGUSR1; @@ -313,7 +319,7 @@ void LLApp::setupErrorHandling() // Add google breakpad exception handler configured for Darwin/Linux. bool installHandler = true; -#ifdef LL_DARWIN +#if LL_DARWIN // For the special case of Darwin, we do not want to install the handler if // the process is being debugged as the app will exit with value ABRT (6) if // we do. Unfortunately, the code below which performs that test relies on @@ -346,14 +352,21 @@ void LLApp::setupErrorHandling() installHandler = true; } #endif -#endif + if(installHandler && (mExceptionHandler == 0)) { std::string dumpPath = "/tmp/"; - mExceptionHandler = new google_breakpad::ExceptionHandler(dumpPath, 0, &unix_post_minidump_callback, 0, true); + mExceptionHandler = new google_breakpad::ExceptionHandler(dumpPath, 0, &unix_post_minidump_callback, 0, true, 0); + } +#elif LL_LINUX + if(installHandler && (mExceptionHandler == 0)) + { + google_breakpad::MinidumpDescriptor desc("/tmp"); + new google_breakpad::ExceptionHandler(desc, 0, &unix_minidump_callback, 0, true, 0); } #endif +#endif startErrorThread(); } @@ -410,6 +423,9 @@ void LLApp::setMiniDumpDir(const std::string &path) wchar_t buffer[MAX_MINDUMP_PATH_LENGTH]; mbstowcs(buffer, path.c_str(), MAX_MINDUMP_PATH_LENGTH); mExceptionHandler->set_dump_path(std::wstring(buffer)); +#elif LL_LINUX + google_breakpad::MinidumpDescriptor desc(path); + mExceptionHandler->set_minidump_descriptor(desc); #else mExceptionHandler->set_dump_path(path); #endif @@ -857,6 +873,43 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) } } +#if LL_LINUX +bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, void* context, bool succeeded) +{ + // Copy minidump file path into fixed buffer in the app instance to avoid + // heap allocations in a crash handler. + + // path format: /.dmp + int dirPathLength = strlen(minidump_desc.path()); + + // The path must not be truncated. + llassert((dirPathLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH); + + char * path = LLApp::instance()->getMiniDumpFilename(); + S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; + strncpy(path, minidump_desc.path(), remaining); + remaining -= dirPathLength; + path += dirPathLength; + if (remaining > 0 && dirPathLength > 0 && path[-1] != '/') + { + *path++ = '/'; + --remaining; + } + + llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + LLApp::runErrorHandler(); + +#ifndef LL_RELEASE_FOR_DOWNLOAD + clear_signals(); + return false; +#else + return true; +#endif + +} +#endif + + bool unix_post_minidump_callback(const char *dump_dir, const char *minidump_id, void *context, bool succeeded) -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/llcommon/llapp.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/llcommon/llapp.cpp (limited to 'indra/llcommon/llapp.cpp') diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From c19200eb000c958bd03645ed616bbd3a1db76735 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 30 May 2013 17:01:28 -0700 Subject: BUG-2707 add some logging to help narrow down what part of login instance handling is going awry --- indra/llcommon/llapp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llapp.cpp') diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index c6da205815..b66fc82250 100755 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -378,7 +378,7 @@ void LLApp::startErrorThread() // if(!mThreadErrorp) { - llinfos << "Starting error thread" << llendl; +// llinfos << "Starting error thread" << llendl; mThreadErrorp = new LLErrorThread(); mThreadErrorp->setUserData((void *) this); mThreadErrorp->start(); -- cgit v1.2.3 From d21fc254a795ddbb0604fd6a542327dbd92b036d Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Sat, 1 Jun 2013 13:43:52 -0700 Subject: BUG-2707 hunt for infos call crashing Kat --- indra/llcommon/llapp.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/llcommon/llapp.cpp') diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index b66fc82250..b6581c714c 100755 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -218,8 +218,7 @@ bool LLApp::parseCommandOptions(int argc, char** argv) { if(argv[ii][0] != '-') { - llinfos << "Did not find option identifier while parsing token: " - << argv[ii] << llendl; + lldebugs << "Did not find option identifier while parsing token: "<< argv[ii] << llendl; return false; } int offset = 1; @@ -896,7 +895,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_ --remaining; } - llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + //llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -942,7 +941,7 @@ bool unix_post_minidump_callback(const char *dump_dir, strncpy(path, ".dmp", remaining); } - llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + //llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -985,12 +984,12 @@ bool windows_post_minidump_callback(const wchar_t* dump_path, strncpy(path, ".dmp", remaining); } - llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; - // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. + //llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); - // *TODO: Translate the signals/exceptions into cross-platform stuff + // *TODO: Translate the signals/exceptions into cross-platform stuff // Windows implementation - llinfos << "Entering Windows Exception Handler..." << llendl; + //llinfos << "Entering Windows Exception Handler..." << llendl; if (LLApp::isError()) { -- cgit v1.2.3 From 50689a13baf07bcd68bfb77b111b066da972f076 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Wed, 5 Jun 2013 06:14:27 -0700 Subject: BOOG2707 uncomment cleared suspects --- indra/llcommon/llapp.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/llcommon/llapp.cpp') diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index b6581c714c..67a98d5fb8 100755 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -218,7 +218,8 @@ bool LLApp::parseCommandOptions(int argc, char** argv) { if(argv[ii][0] != '-') { - lldebugs << "Did not find option identifier while parsing token: "<< argv[ii] << llendl; + llinfos << "Did not find option identifier while parsing token: " + << argv[ii] << llendl; return false; } int offset = 1; @@ -377,7 +378,7 @@ void LLApp::startErrorThread() // if(!mThreadErrorp) { -// llinfos << "Starting error thread" << llendl; + llinfos << "Starting error thread" << llendl; mThreadErrorp = new LLErrorThread(); mThreadErrorp->setUserData((void *) this); mThreadErrorp->start(); @@ -895,7 +896,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_ --remaining; } - //llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -941,7 +942,7 @@ bool unix_post_minidump_callback(const char *dump_dir, strncpy(path, ".dmp", remaining); } - //llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -984,12 +985,12 @@ bool windows_post_minidump_callback(const wchar_t* dump_path, strncpy(path, ".dmp", remaining); } - //llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); // *TODO: Translate the signals/exceptions into cross-platform stuff // Windows implementation - //llinfos << "Entering Windows Exception Handler..." << llendl; + llinfos << "Entering Windows Exception Handler..." << llendl; if (LLApp::isError()) { -- cgit v1.2.3