From 719edddf0498752a0295502d62710823d1a72cc7 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Fri, 21 May 2010 09:38:29 -0700 Subject: Switch Darwin to use breakpad minidump rather than os generated crash stack. --- indra/llcommon/llapp.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index e5b8edf9c3..cd17532203 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -38,6 +38,8 @@ #include "llsd.h" #include "lloptioninterface.h" +#include "exception_handler.h" + // Forward declarations template class LLAtomic32; typedef LLAtomic32 LLAtomicU32; @@ -228,6 +230,8 @@ public: void setErrorHandler(LLAppErrorHandler handler); void setSyncErrorHandler(LLAppErrorHandler handler); + static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. + static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. //@} #if !LL_WINDOWS @@ -265,6 +269,9 @@ public: typedef std::map string_map; string_map mOptionMap; // Contains all command-line options and arguments in a map + // Contains the path to minidump file after a crash. + static const U32 MAX_MINDUMP_PATH_LENGTH = 256; + char minidump_path[MAX_MINDUMP_PATH_LENGTH]; protected: static void setStatus(EAppStatus status); // Use this to change the application status. @@ -286,8 +293,6 @@ protected: private: void startErrorThread(); - static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. - static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. // *NOTE: On Windows, we need a routine to reset the structured // exception handler when some evil driver has taken it over for @@ -315,6 +320,8 @@ private: private: // the static application instance if it was created. static LLApp* sApplication; + + google_breakpad::ExceptionHandler * mExceptionHandler; #if !LL_WINDOWS -- cgit v1.2.3 From ba809777e5ba240622f6c67ff400733899c275bf Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 21 May 2010 14:39:55 -0700 Subject: New google breakpad package for windows with winsock2 fix, and DLL CRT library usage. Also moved headers into libraries/include/google_breakpad. Mac and linux packages to come shortly. --- indra/llcommon/llapp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index cd17532203..348eec0c48 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -38,7 +38,7 @@ #include "llsd.h" #include "lloptioninterface.h" -#include "exception_handler.h" +#include "google_breakpad/exception_handler.h" // Forward declarations template class LLAtomic32; -- cgit v1.2.3 From 1077ab49c171c0f310f9b76b360ea2ad162a31ff Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 24 May 2010 15:19:33 -0700 Subject: Just enough hackery to get minidumps into Wind'ohs crash reports. Code clean up needed. --- indra/llcommon/llapp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 348eec0c48..725c13866f 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -38,8 +38,6 @@ #include "llsd.h" #include "lloptioninterface.h" -#include "google_breakpad/exception_handler.h" - // Forward declarations template class LLAtomic32; typedef LLAtomic32 LLAtomicU32; @@ -68,6 +66,10 @@ public: }; #endif +namespace google_breakpad { + class ExceptionHandler; // See exception_handler.h +} + class LL_COMMON_API LLApp : public LLOptionInterface { friend class LLErrorThread; -- cgit v1.2.3 From 5a52c5eb8a5cc4e1215911bac9121891dd802d45 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 25 May 2010 13:32:12 -0700 Subject: Mac crash behavior matches windows and linux: report on crash (not after restart). This is OK because we use Breakpad generated minidumps instead of OS generated ones. --- indra/llcommon/llapp.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 725c13866f..8b2dc1ab72 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -235,6 +235,11 @@ public: static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. //@} + + // + // Expose exception handler. + // + google_breakpad::ExceptionHandler * getExceptionHandler(void) { return mExceptionHandler; } #if !LL_WINDOWS // -- cgit v1.2.3 From a63b6dd93c1ef78e647dbd221a5a3b14ff363102 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 26 May 2010 14:43:27 +0100 Subject: Hooked up Google Breakpad for the Linux client too. Using Alain's Darwin reporter callback was all that was needed. Also replaced the call that exposed the breakpad exception class with a call to just write out the minidump, as that was the only reason for exposing it. Now clients don't need to know about Google Breakpad. --- indra/llcommon/llapp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 8b2dc1ab72..7b1144ebf1 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -237,9 +237,9 @@ public: //@} // - // Expose exception handler. + // Write out a Google Breakpad minidump file. // - google_breakpad::ExceptionHandler * getExceptionHandler(void) { return mExceptionHandler; } + void writeMiniDump(); #if !LL_WINDOWS // -- cgit v1.2.3 From 05761d785335f08dc176aa6ebb7f0cd45d1298ab Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 27 May 2010 15:04:06 +0100 Subject: Removed the SyncErrorHandler from llapp and llappviewer*. This was only used for the Linux client to dump a stack trace to stack_trace.log, which is no longer needed now that we are using Google Breakpad. I also removed all of the stack printing code from llappviewerlinux.cpp. --- indra/llcommon/llapp.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index 7b1144ebf1..a6294a5e1a 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -231,9 +231,7 @@ public: void setupErrorHandling(); void setErrorHandler(LLAppErrorHandler handler); - void setSyncErrorHandler(LLAppErrorHandler handler); static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. - static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. //@} // @@ -306,7 +304,6 @@ private: // their own purposes typedef int(*signal_handler_func)(int signum); static LLAppErrorHandler sErrorHandler; - static LLAppErrorHandler sSyncErrorHandler; // Default application threads LLErrorThread* mThreadErrorp; // Waits for app to go to status ERROR, then runs the error callback -- cgit v1.2.3 From 4fb77380279bdf853b7f213ba8997511720468dd Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Fri, 28 May 2010 15:10:52 +0100 Subject: Write breakpad minidump files to the SL log directory. Also, clean out old minidump files when we start up. --- indra/llcommon/llapp.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llapp.h') diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index a6294a5e1a..fef05a7939 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -234,9 +234,16 @@ public: static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. //@} - // + // the maximum length of the minidump filename returned by getMiniDumpFilename() + static const U32 MAX_MINDUMP_PATH_LENGTH = 256; + + // change the directory where Breakpad minidump files are written to + void setMiniDumpDir(const std::string &path); + + // Return the Google Breakpad minidump filename after a crash. + char *getMiniDumpFilename() { return minidump_path; } + // Write out a Google Breakpad minidump file. - // void writeMiniDump(); #if !LL_WINDOWS @@ -274,9 +281,6 @@ public: typedef std::map string_map; string_map mOptionMap; // Contains all command-line options and arguments in a map - // Contains the path to minidump file after a crash. - static const U32 MAX_MINDUMP_PATH_LENGTH = 256; - char minidump_path[MAX_MINDUMP_PATH_LENGTH]; protected: static void setStatus(EAppStatus status); // Use this to change the application status. @@ -298,6 +302,8 @@ protected: private: void startErrorThread(); + // Contains the filename of the minidump file after a crash. + char minidump_path[MAX_MINDUMP_PATH_LENGTH]; // *NOTE: On Windows, we need a routine to reset the structured // exception handler when some evil driver has taken it over for -- cgit v1.2.3