diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/cmake/Copy3rdPartyLibs.cmake | 1 | ||||
-rw-r--r-- | indra/cmake/FreeType.cmake | 6 | ||||
-rw-r--r-- | indra/cmake/GoogleBreakpad.cmake | 3 | ||||
-rw-r--r-- | indra/linux_crash_logger/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/llcommon/llapp.cpp | 59 | ||||
-rw-r--r-- | indra/llcommon/llapp.h | 2 | ||||
-rw-r--r-- | indra/win_crash_logger/CMakeLists.txt | 1 |
7 files changed, 64 insertions, 11 deletions
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c32e357da3..2a73900c71 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -260,7 +260,6 @@ elseif(LINUX) libboost_filesystem-mt.so.${BOOST_VERSION}.0 libboost_signals-mt.so.${BOOST_VERSION}.0 libboost_system-mt.so.${BOOST_VERSION}.0 - libbreakpad_client.so.0 libcollada14dom.so libcrypto.so.1.0.0 libdb-5.1.so diff --git a/indra/cmake/FreeType.cmake b/indra/cmake/FreeType.cmake index 43a9d282d0..baa61d73c8 100644 --- a/indra/cmake/FreeType.cmake +++ b/indra/cmake/FreeType.cmake @@ -7,13 +7,7 @@ if (STANDALONE) pkg_check_modules(FREETYPE REQUIRED freetype2) else (STANDALONE) use_prebuilt_binary(freetype) - if (LINUX) - set(FREETYPE_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include) - else (LINUX) set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) - endif (LINUX) - set(FREETYPE_LIBRARIES freetype) endif (STANDALONE) diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake index 7498674042..96e22791ec 100644 --- a/indra/cmake/GoogleBreakpad.cmake +++ b/indra/cmake/GoogleBreakpad.cmake @@ -15,5 +15,8 @@ else (STANDALONE) if (WINDOWS) set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common) endif (WINDOWS) + # yes, this does look dumb, no, it's not incorrect + # + set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/include/google_breakpad/google_breakpad") endif (STANDALONE) diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt index 98ebdc7487..a1f334ffad 100644 --- a/indra/linux_crash_logger/CMakeLists.txt +++ b/indra/linux_crash_logger/CMakeLists.txt @@ -12,6 +12,7 @@ include(LLVFS) include(LLXML) include(Linking) include(UI) +include(FreeType) include_directories( ${LLCOMMON_INCLUDE_DIRS} @@ -19,6 +20,7 @@ include_directories( ${LLMATH_INCLUDE_DIRS} ${LLVFS_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS} + ${FREETYPE_INCLUDE_DIRS} ) set(linux_crash_logger_SOURCE_FILES @@ -53,6 +55,7 @@ target_link_libraries(linux-crash-logger ${LLCOMMON_LIBRARIES} ${UI_LIBRARIES} ${DB_LIBRARIES} + ${FREETYPE_LIBRARIES} ) add_custom_target(linux-crash-logger-target ALL 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: <dump_dir>/<minidump_id>.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) diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index a536a06ea5..afa06df23e 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -38,7 +38,7 @@ typedef LLAtomic32<U32> LLAtomicU32; class LLErrorThread; class LLLiveFile; #if LL_LINUX -typedef struct siginfo siginfo_t; +#include <signal.h> #endif typedef void (*LLAppErrorHandler)(); diff --git a/indra/win_crash_logger/CMakeLists.txt b/indra/win_crash_logger/CMakeLists.txt index 5329c89554..50633599ab 100644 --- a/indra/win_crash_logger/CMakeLists.txt +++ b/indra/win_crash_logger/CMakeLists.txt @@ -78,6 +78,7 @@ target_link_libraries(windows-crash-logger gdi32 ole32 oleaut32 + wininet Wldap32 ) |