From fa06293a4c637b31094a8c6907982851d4d0b464 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 21 May 2010 11:48:07 -0700 Subject: Added call to use_prebuilt_binary for google-breakpad so it actually gets installed by install.py. --- indra/cmake/GoogleBreakpad.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 indra/cmake/GoogleBreakpad.cmake (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake new file mode 100644 index 0000000000..e45518ef56 --- /dev/null +++ b/indra/cmake/GoogleBreakpad.cmake @@ -0,0 +1,11 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented") + # *TODO - implement this include(FindGoogleBreakpad) +else (STANDALONE) + use_prebuilt_binary(google_breakpad) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) +endif (STANDALONE) + -- cgit v1.3 From 95d7aab108516826f459c7202ea5941e94d0c5eb Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 21 May 2010 15:48:40 -0700 Subject: New windows google_breakpad package with GUIDString class included in common.lib. I've confimred that llcommon links now. --- indra/cmake/GoogleBreakpad.cmake | 2 +- install.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index e45518ef56..3aac79eeeb 100644 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -6,6 +6,6 @@ if (STANDALONE) # *TODO - implement this include(FindGoogleBreakpad) else (STANDALONE) use_prebuilt_binary(google_breakpad) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) endif (STANDALONE) diff --git a/install.xml b/install.xml index 928dd862c5..9a015a7eb0 100644 --- a/install.xml +++ b/install.xml @@ -610,9 +610,9 @@ windows md5sum - d9858d7be95d89d573daf196a8b3a3dc + e2c282513dd20f3198fb6d83d9cfd709 url - http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/google_breakpad-0.0.0-rev599-windows-20100521g.tar.bz2 + http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/google_breakpad-0.0.0-rev599-windows-20100521h.tar.bz2 -- cgit v1.3 From d9fee67f976b72a3c6145627638e4e15a8f54d7e Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 21 May 2010 19:09:53 -0700 Subject: VPLAT-237 Linux client library package for google_breakpad. --- indra/cmake/Copy3rdPartyLibs.cmake | 3 ++- indra/cmake/GoogleBreakpad.cmake | 3 +++ indra/newview/viewer_manifest.py | 1 + install.xml | 7 +++++++ 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index faf9da8b14..937d3c6384 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -19,7 +19,7 @@ if(WINDOWS) set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32") set(vivox_files SLVoice.exe - libsndfile-1.dll + libsndfile-1.dll vivoxplatform.dll vivoxsdk.dll ortp.dll @@ -216,6 +216,7 @@ elseif(LINUX) libapr-1.so.0 libaprutil-1.so.0 libatk-1.0.so + libbreakpad_client.so.0 libcrypto.so.0.9.7 libdb-4.2.so libexpat.so diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index 3aac79eeeb..0b9f4a00d0 100644 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -7,5 +7,8 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(google_breakpad) set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) + if (LINUX) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) + endif (LINUX) endif (STANDALONE) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 2a966f4adf..96541088b5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -888,6 +888,7 @@ class Linux_i686Manifest(LinuxManifest): if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"): self.path("libapr-1.so.0") self.path("libaprutil-1.so.0") + self.path("libbreakpad_client.so.0.0.0", "libbreakpad_client.so.0") self.path("libdb-4.2.so") self.path("libcrypto.so.0.9.7") self.path("libexpat.so.1") diff --git a/install.xml b/install.xml index ce035fb1a0..85528b6697 100644 --- a/install.xml +++ b/install.xml @@ -600,6 +600,13 @@ url http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-darwin-20100521a.tar.bz2 + linux + + md5sum + 29c3e7dad60bbf02c811786436d99523 + url + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-linux-20100521b.tar.bz2 + windows md5sum -- cgit v1.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/cmake/GoogleBreakpad.cmake | 31 ++++++++++-------- indra/llcommon/llapp.cpp | 67 ++++++++++++++++++++++++++++++++++++++ indra/llcommon/llapp.h | 6 ++-- indra/newview/llappviewerwin32.cpp | 5 +-- indra/newview/llwindebug.cpp | 28 +++++++--------- 5 files changed, 102 insertions(+), 35 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index 0b9f4a00d0..b21b733500 100644 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -1,14 +1,17 @@ -# -*- cmake -*- -include(Prebuilt) - -if (STANDALONE) - MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented") - # *TODO - implement this include(FindGoogleBreakpad) -else (STANDALONE) - use_prebuilt_binary(google_breakpad) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) - if (LINUX) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) - endif (LINUX) -endif (STANDALONE) - +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented") + # *TODO - implement this include(FindGoogleBreakpad) +else (STANDALONE) + use_prebuilt_binary(google_breakpad) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) + if(WINDOWS) + list(APPEND BREAKPAD_EXCEPTION_HANDLER_LIBRARIES crash_generation_client common) + endif(WINDOWS) + if (LINUX) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) + endif (LINUX) +endif (STANDALONE) + diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index e766563c6f..e22ff869e7 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -30,6 +30,8 @@ * $/LicenseInfo$ */ +#include + #include "linden_common.h" #include "llapp.h" @@ -43,6 +45,8 @@ #include "llstl.h" // for DeletePointer() #include "lleventtimer.h" +#include "google_breakpad/exception_handler.h" + // // Signal handling // @@ -51,6 +55,12 @@ #if LL_WINDOWS LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop); BOOL ConsoleCtrlHandler(DWORD fdwCtrlType); +bool windows_post_minidump_callback(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded); #else # include # include // for fork() @@ -285,6 +295,13 @@ void LLApp::setupErrorHandling() // The viewer shouldn't be affected, sicne its a windowed app. SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE); + if(mExceptionHandler == 0) + { + llwarns << "adding breakpad exception handler" << llendl; + mExceptionHandler = new google_breakpad::ExceptionHandler( + L"C:\\Temp\\", 0, windows_post_minidump_callback, 0, google_breakpad::ExceptionHandler::HANDLER_ALL); + } + #else // // Start up signal handling. @@ -815,3 +832,53 @@ bool darwin_post_minidump_callback(const char *dump_dir, LLApp::runErrorHandler(); return true; } + +bool windows_post_minidump_callback(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded) +{ + char * path = LLApp::instance()->minidump_path; + S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; + size_t bytesUsed; + + bytesUsed = wcstombs(path, dump_path, static_cast(remaining)); + remaining -= bytesUsed; + path += bytesUsed; + if(remaining > 0) + { + bytesUsed = wcstombs(path, minidump_id, static_cast(remaining)); + remaining -= bytesUsed; + path += bytesUsed; + } + if(remaining > 0) + { + strncpy(path, ".dmp", remaining); + } + + llinfos << "generated minidump: " << LLApp::instance()->minidump_path << 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; + + if (LLApp::isError()) + { + llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; + } + + // Flag status to error, so thread_error starts its work + LLApp::setError(); + + // Block in the exception handler until the app has stopped + // This is pretty sketchy, but appears to work just fine + while (!LLApp::isStopped()) + { + ms_sleep(10); + } + + return true; +} 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; diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 60a6d2f072..4bee8d9ac5 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -529,8 +529,9 @@ bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) } bool LLAppViewerWin32::restoreErrorTrap() -{ - return LLWinDebug::checkExceptionHandler(); +{ + return true; + //return LLWinDebug::checkExceptionHandler(); } void LLAppViewerWin32::handleSyncCrashTrace() diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 59bc9dc62b..9f8585f163 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -718,7 +718,8 @@ BOOL PreventSetUnhandledExceptionFilter() // static void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) { - + return; +#if 0 static bool s_first_run = true; // Load the dbghelp dll now, instead of waiting for the crash. // Less potential for stack mangling @@ -762,34 +763,27 @@ void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) Module32First_ = (MODULE32_FIRST)GetProcAddress(hKernel32, "Module32FirstW"); Module32Next_ = (MODULE32_NEST)GetProcAddress(hKernel32, "Module32NextW"); - LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - prev_filter = SetUnhandledExceptionFilter(filter_func); - - // *REMOVE:Mani - //PreventSetUnhandledExceptionFilter(); + PVOID added_filter = + AddVectoredExceptionHandler(0, filter_func); - if(prev_filter != gFilterFunc) + if(added_filter == 0) { LL_WARNS("AppInit") - << "Replacing unknown exception (" << (void *)prev_filter << ") with (" << (void *)filter_func << ") !" << LL_ENDL; + << "Failed to add exception handler (" << added_filter << ") !" << LL_ENDL; } gFilterFunc = filter_func; +#endif } bool LLWinDebug::checkExceptionHandler() { bool ok = true; - LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - prev_filter = SetUnhandledExceptionFilter(gFilterFunc); - if (prev_filter != gFilterFunc) - { - LL_WARNS("AppInit") << "Our exception handler (" << (void *)gFilterFunc << ") replaced with " << prev_filter << "!" << LL_ENDL; - ok = false; - } + RemoveVectoredExceptionHandler(gFilterFunc); + PVOID filter = AddVectoredExceptionHandler(0, gFilterFunc); - if (prev_filter == NULL) + if (filter == NULL) { ok = FALSE; if (gFilterFunc == NULL) @@ -798,7 +792,7 @@ bool LLWinDebug::checkExceptionHandler() } else { - LL_WARNS("AppInit") << "Our exception handler (" << (void *)gFilterFunc << ") replaced with NULL!" << LL_ENDL; + LL_WARNS("AppInit") << "Failed to add exception handler (" << (void *)gFilterFunc << ")!" << LL_ENDL; } } -- cgit v1.3 From 28bff2cd99ec97d50f07b620f489a9d8745d3add Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Mon, 24 May 2010 15:42:22 -0700 Subject: Fix for mac build failing to find google_breakpad client libraries. --- indra/cmake/GoogleBreakpad.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index 0b9f4a00d0..8270c0fabb 100644 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -6,9 +6,14 @@ if (STANDALONE) # *TODO - implement this include(FindGoogleBreakpad) else (STANDALONE) use_prebuilt_binary(google_breakpad) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) + if (DARWIN) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) + endif (DARWIN) if (LINUX) set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) endif (LINUX) + if (WINDOWS) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) + endif (WINDOWS) endif (STANDALONE) -- cgit v1.3 From 637b1e4a3a4fd0e4952795aea851643107d4e965 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 24 May 2010 16:24:10 -0700 Subject: fix some dos line endings. --- indra/cmake/GoogleBreakpad.cmake | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index 0d023b20ec..8270c0fabb 100644 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -1,19 +1,19 @@ -# -*- cmake -*- -include(Prebuilt) - -if (STANDALONE) - MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented") - # *TODO - implement this include(FindGoogleBreakpad) -else (STANDALONE) - use_prebuilt_binary(google_breakpad) - if (DARWIN) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) - endif (DARWIN) - if (LINUX) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) - endif (LINUX) - if (WINDOWS) - set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) - endif (WINDOWS) -endif (STANDALONE) - +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented") + # *TODO - implement this include(FindGoogleBreakpad) +else (STANDALONE) + use_prebuilt_binary(google_breakpad) + if (DARWIN) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) + endif (DARWIN) + if (LINUX) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) + endif (LINUX) + if (WINDOWS) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) + endif (WINDOWS) +endif (STANDALONE) + -- cgit v1.3 From 0bf02ad820abdb35b9cfdfbd1635953e63a767b2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 26 May 2010 12:21:55 -0400 Subject: VPLAT-268: Update Mac for relative-path libexception_handler.dylib Also add the dylib to Copy3rdPartyLibs.cmake so unit tests can find it. --- indra/cmake/Copy3rdPartyLibs.cmake | 1 + install.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 937d3c6384..89422fbdb2 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -167,6 +167,7 @@ elseif(DARWIN) libexpat.dylib libllqtwebkit.dylib libndofdev.dylib + libexception_handler.dylib ) # fmod is statically linked on darwin diff --git a/install.xml b/install.xml index 0bf0f852e4..c280350fe9 100644 --- a/install.xml +++ b/install.xml @@ -596,9 +596,9 @@ darwin md5sum - 46536b8a3311e71691ba045b8572c9eb + 44c79d6629598b937a69e3a37ec53cf1 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-darwin-20100521a.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/google_breakpad-0.0.0-rev599-darwin-20100525.tar.bz2 linux -- cgit v1.3