diff options
| author | Rye <rye@alchemyviewer.org> | 2025-11-01 07:30:04 -0400 |
|---|---|---|
| committer | Rye <rye@alchemyviewer.org> | 2025-11-02 21:40:05 -0500 |
| commit | 0c796b0c429058b334ee8968c4f0019445c09d55 (patch) | |
| tree | 423ed207563c02f4dc0516aeeb6abe70d8433ea0 /indra | |
| parent | ca521b1a520e8155b7de3467c8a5134fe58af374 (diff) | |
Remove dead linux crash logger
Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | indra/linux_crash_logger/CMakeLists.txt | 72 | ||||
| -rw-r--r-- | indra/linux_crash_logger/README.txt | 3 | ||||
| -rw-r--r-- | indra/linux_crash_logger/linux_crash_logger.cpp | 58 | ||||
| -rw-r--r-- | indra/linux_crash_logger/llcrashloggerlinux.cpp | 146 | ||||
| -rw-r--r-- | indra/linux_crash_logger/llcrashloggerlinux.h | 45 | ||||
| -rw-r--r-- | indra/llcommon/llapp.cpp | 51 | ||||
| -rw-r--r-- | indra/llcrashlogger/CMakeLists.txt | 27 | ||||
| -rw-r--r-- | indra/llcrashlogger/README.txt | 3 | ||||
| -rw-r--r-- | indra/llcrashlogger/llcrashlock.cpp | 212 | ||||
| -rw-r--r-- | indra/llcrashlogger/llcrashlock.h | 73 | ||||
| -rw-r--r-- | indra/llcrashlogger/llcrashlogger.cpp | 682 | ||||
| -rw-r--r-- | indra/llcrashlogger/llcrashlogger.h | 97 | ||||
| -rw-r--r-- | indra/newview/CMakeLists.txt | 4 | ||||
| -rwxr-xr-x | indra/newview/viewer_manifest.py | 1 |
15 files changed, 0 insertions, 1478 deletions
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index fb5cceb9ce..61a2916bdb 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -113,10 +113,6 @@ endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) add_custom_target(viewer) -if (NOT USE_BUGSPLAT) -add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger) -endif (NOT USE_BUGSPLAT) - add_subdirectory(${LIBS_OPEN_PREFIX}llplugin) add_subdirectory(${LIBS_OPEN_PREFIX}llui) add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components) diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt deleted file mode 100644 index 1793aa82b9..0000000000 --- a/indra/linux_crash_logger/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -# -*- cmake -*- - -project(linux_crash_logger) - -include(00-Common) -include(GLH) -include(LLCoreHttp) -include(LLCommon) -include(LLCrashLogger) -include(LLMath) -include(LLMessage) -include(LLFileSystem) -include(LLXML) -include(Linking) -include(UI) -include(FreeType) -include(Boost) - -include_directories( - ${LLCOREHTTP_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLCRASHLOGGER_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLFILESYSTEM_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ${FREETYPE_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) -include_directories(SYSTEM - ${LLCOMMON_SYSTEM_INCLUDE_DIRS} - ${LLXML_SYSTEM_INCLUDE_DIRS} - ) - -set(linux_crash_logger_SOURCE_FILES - linux_crash_logger.cpp - llcrashloggerlinux.cpp - ) - -set(linux_crash_logger_HEADER_FILES - CMakeLists.txt - - llcrashloggerlinux.h - ) - -list(APPEND linux_crash_logger_SOURCE_FILES - ${linux_crash_logger_HEADER_FILES} - ) - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - -add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES}) - -# llcommon uses `clock_gettime' which is provided by librt on linux. -set(LIBRT_LIBRARY rt) - - -target_link_libraries(linux-crash-logger - llcrashlogger - llfilesystem - llxml - llmessage - llmath - llcorehttp - llcommon - ll::uilibraries - ) - -add_custom_target(linux-crash-logger-target ALL - DEPENDS linux-crash-logger) diff --git a/indra/linux_crash_logger/README.txt b/indra/linux_crash_logger/README.txt deleted file mode 100644 index 6932a8d9c3..0000000000 --- a/indra/linux_crash_logger/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This component is no longer used in Linden Lab builds. -Change requests to support continued use by open source -builds are welcome. diff --git a/indra/linux_crash_logger/linux_crash_logger.cpp b/indra/linux_crash_logger/linux_crash_logger.cpp deleted file mode 100644 index b36312c607..0000000000 --- a/indra/linux_crash_logger/linux_crash_logger.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file linux_crash_logger.cpp - * @brief Linux crash logger implementation - * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" -#include "llcrashloggerlinux.h" -#include "llsdutil.h" - -int main(int argc, char **argv) -{ - LL_INFOS() << "Starting crash reporter." << LL_ENDL; - - LLCrashLoggerLinux app; - app.parseCommandOptions(argc, argv); - - LLSD options = LLApp::instance()->getOptionData( - LLApp::PRIORITY_COMMAND_LINE); - //LLApp::PRIORITY_RUNTIME_OVERRIDE); - - - if (!(options.has("pid") && options.has("dumpdir"))) - { - LL_WARNS() << "Insufficient parameters to crash report." << LL_ENDL; - } - - if (! app.init()) - { - LL_WARNS() << "Unable to initialize application." << LL_ENDL; - return 1; - } - - app.frame(); - app.cleanup(); - LL_INFOS() << "Crash reporter finished normally." << LL_ENDL; - return 0; -} diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp deleted file mode 100644 index 9b40de741e..0000000000 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @file llcrashloggerlinux.cpp - * @brief Linux crash logger implementation - * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llcrashloggerlinux.h" - -#include <iostream> - -#include "linden_common.h" - -#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME -#include "llerror.h" -#include "llfile.h" -#include "lltimer.h" -#include "llstring.h" -#include "lldir.h" -#include "llsdserialize.h" - -#if LL_GTK -# include "gtk/gtk.h" -#endif // LL_GTK - -#define MAX_LOADSTRING 100 - -// These need to be localized. -static const char dialog_text[] = -"Second Life appears to have crashed or frozen last time it ran.\n" -"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, all of which are used for debugging purposes only.\n" -"\n" -"Send crash report?"; - -static const char dialog_title[] = -"Second Life Crash Logger"; - -#if LL_GTK -static void response_callback (GtkDialog *dialog, - gint arg1, - gpointer user_data) -{ - gint *response = (gint*)user_data; - *response = arg1; - gtk_widget_destroy(GTK_WIDGET(dialog)); - gtk_main_quit(); -} -#endif // LL_GTK - -static BOOL do_ask_dialog(void) -{ -#if LL_GTK - gtk_disable_setlocale(); - if (!gtk_init_check(NULL, NULL)) { - LL_INFOS() << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << LL_ENDL; - return FALSE; - } - - GtkWidget *win = NULL; - GtkDialogFlags flags = GTK_DIALOG_MODAL; - GtkMessageType messagetype = GTK_MESSAGE_QUESTION; - GtkButtonsType buttons = GTK_BUTTONS_YES_NO; - gint response = GTK_RESPONSE_NONE; - - win = gtk_message_dialog_new(NULL, - flags, messagetype, buttons, - "%s", dialog_text); - gtk_window_set_type_hint(GTK_WINDOW(win), - GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_title(GTK_WINDOW(win), dialog_title); - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); - gtk_widget_show_all (win); - gtk_main(); - - return (GTK_RESPONSE_OK == response || - GTK_RESPONSE_YES == response || - GTK_RESPONSE_APPLY == response); -#else - return FALSE; -#endif // LL_GTK -} - -LLCrashLoggerLinux::LLCrashLoggerLinux(void) -{ -} - -LLCrashLoggerLinux::~LLCrashLoggerLinux(void) -{ -} - -void LLCrashLoggerLinux::gatherPlatformSpecificFiles() -{ -} - -bool LLCrashLoggerLinux::frame() -{ - bool send_logs = true; - if(CRASH_BEHAVIOR_ASK == getCrashBehavior()) - { - send_logs = do_ask_dialog(); - } - else if(CRASH_BEHAVIOR_NEVER_SEND == getCrashBehavior()) - { - send_logs = false; - } - - if(send_logs) - { - sendCrashLogs(); - } - return true; -} - -bool LLCrashLoggerLinux::cleanup() -{ - commonCleanup(); - mKeyMaster.releaseMaster(); - return true; -} - -void LLCrashLoggerLinux::updateApplication(const std::string& message) -{ - LLCrashLogger::updateApplication(message); -} diff --git a/indra/linux_crash_logger/llcrashloggerlinux.h b/indra/linux_crash_logger/llcrashloggerlinux.h deleted file mode 100644 index dcecbe746d..0000000000 --- a/indra/linux_crash_logger/llcrashloggerlinux.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file llcrashloggerlinux.h - * @brief Linux crash logger definition - * - * $LicenseInfo:firstyear=2003&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LLCRASHLOGGERLINUX_H -#define LLCRASHLOGGERLINUX_H - -#include "linden_common.h" -#include "llcrashlogger.h" -#include "llstring.h" - -class LLCrashLoggerLinux : public LLCrashLogger -{ -public: - LLCrashLoggerLinux(void); - ~LLCrashLoggerLinux(void); - virtual bool frame(); - virtual void updateApplication(const std::string& = LLStringUtil::null); - virtual void gatherPlatformSpecificFiles(); - virtual bool cleanup(); -}; - -#endif diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index c532620daa..73b50d0a50 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -58,14 +58,6 @@ void setup_signals(); void default_unix_signal_handler(int signum, siginfo_t *info, void *); -#if LL_LINUX -#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; @@ -720,47 +712,4 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) } } -bool unix_post_minidump_callback(const char *dump_dir, - const char *minidump_id, - 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 - auto dirPathLength = strlen(dump_dir); - auto idLength = strlen(minidump_id); - - // The path must not be truncated. - llassert((dirPathLength + idLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH); - - char * path = LLApp::instance()->getMiniDumpFilename(); - auto remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; - strncpy(path, dump_dir, remaining); - remaining -= dirPathLength; - path += dirPathLength; - if (remaining > 0 && dirPathLength > 0 && path[-1] != '/') - { - *path++ = '/'; - --remaining; - } - if (remaining > 0) - { - strncpy(path, minidump_id, remaining); - remaining -= idLength; - path += idLength; - strncpy(path, ".dmp", remaining); - } - - LL_INFOS("CRASHREPORT") << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; - LLApp::runErrorHandler(); - -#ifndef LL_RELEASE_FOR_DOWNLOAD - clear_signals(); - return false; -#else - return true; -#endif -} #endif // !WINDOWS - diff --git a/indra/llcrashlogger/CMakeLists.txt b/indra/llcrashlogger/CMakeLists.txt deleted file mode 100644 index 7a1c3eef54..0000000000 --- a/indra/llcrashlogger/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -*- cmake -*- - -project(llcrashlogger) - -include(00-Common) -include(LLCoreHttp) -include(LLCommon) - -set(llcrashlogger_SOURCE_FILES - llcrashlogger.cpp - llcrashlock.cpp - ) - -set(llcrashlogger_HEADER_FILES - CMakeLists.txt - llcrashlogger.h - llcrashlock.h - ) - -list(APPEND llcrashlogger_SOURCE_FILES ${llcrashlogger_HEADER_FILES}) - -add_library(llcrashlogger ${llcrashlogger_SOURCE_FILES}) -target_link_libraries( llcrashlogger llcommon llmessage llcorehttp llxml llfilesystem ) - -if (USE_PRECOMPILED_HEADERS) - target_precompile_headers(llcrashlogger REUSE_FROM llprecompiled) -endif () diff --git a/indra/llcrashlogger/README.txt b/indra/llcrashlogger/README.txt deleted file mode 100644 index 6932a8d9c3..0000000000 --- a/indra/llcrashlogger/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This component is no longer used in Linden Lab builds. -Change requests to support continued use by open source -builds are welcome. diff --git a/indra/llcrashlogger/llcrashlock.cpp b/indra/llcrashlogger/llcrashlock.cpp deleted file mode 100644 index bc34f6798f..0000000000 --- a/indra/llcrashlogger/llcrashlock.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/** - * @file llformat.cpp - * @date January 2007 - * @brief string formatting utility - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llapr.h" // thread-related functions -#include "llcrashlock.h" -#include "lldir.h" -#include "llsd.h" -#include "llsdserialize.h" -#include "llframetimer.h" -#include <boost/filesystem.hpp> -#include <string> -#include <iostream> -#include <stdio.h> - - -#if LL_WINDOWS //For windows platform. -#include <llwin32headers.h> -#include <TlHelp32.h> - -bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname) -{ - std::wstring wpname = ll_convert_string_to_wide(pname); - - HANDLE snapshot; - PROCESSENTRY32 pe32{}; - - bool matched = false; - - snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if (snapshot == INVALID_HANDLE_VALUE) - { - return false; - } - else - { - pe32.dwSize = sizeof(PROCESSENTRY32); - if (Process32First(snapshot, &pe32)) - { - do { - std::wstring wexecname = pe32.szExeFile; - std::string execname = ll_convert_wide_to_string(wexecname); - if (!wpname.compare(pe32.szExeFile)) - { - if (pid == (U32)pe32.th32ProcessID) - { - matched = true; - break; - } - } - } while (Process32Next(snapshot, &pe32)); - } - } - - CloseHandle(snapshot); - return matched; -} - -#else //Everyone Else -bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname) -{ - //Will boost.process ever become a reality? - std::stringstream cmd; - - cmd << "pgrep '" << pname << "' | grep '^" << pid << "$'"; - return (!system(cmd.str().c_str())); -} -#endif //Everyone else. - - -LLCrashLock::LLCrashLock() : mCleanUp(true), mWaitingPID(0) -{ -} - -void LLCrashLock::setCleanUp(bool cleanup) -{ - mCleanUp = cleanup; //Allow cleanup to be disabled for debugging. -} - -LLSD LLCrashLock::getLockFile(std::string filename) -{ - LLSD lock_sd = LLSD::emptyMap(); - - llifstream ifile(filename.c_str()); - - if (ifile.is_open()) - { - LLSDSerialize::fromXML(lock_sd, ifile); - ifile.close(); - } - - return lock_sd; -} - -bool LLCrashLock::putLockFile(std::string filename, const LLSD& data) -{ - bool result = true; - llofstream ofile(filename.c_str()); - - if (!LLSDSerialize::toXML(data,ofile)) - { - result=false; - } - ofile.close(); - return result; -} - -bool LLCrashLock::requestMaster( F32 timeout ) -{ - if (mMaster.empty()) - { - mMaster = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "crash_master.lock"); - } - - LLSD lock_sd=getLockFile(mMaster); - - if (lock_sd.has("pid")) - { - mWaitingPID = lock_sd["pid"].asInteger(); - if ( isProcessAlive(mWaitingPID, gDirUtilp->getExecutableFilename()) ) - { - mTimer.resetWithExpiry(timeout); - return false; - } - } - - U32 pid = getpid(); - lock_sd["pid"] = (LLSD::Integer)pid; - return putLockFile(mMaster,lock_sd); -} - -bool LLCrashLock::checkMaster() -{ - if (mWaitingPID) - { - return (!isProcessAlive(mWaitingPID, gDirUtilp->getExecutableFilename())); - } - return false; -} - -bool LLCrashLock::isWaiting() -{ - return !mTimer.hasExpired(); -} - -void LLCrashLock::releaseMaster() -{ - //Yeeeeeeehaw - unlink(mMaster.c_str()); -} - -LLSD LLCrashLock::getProcessList() -{ - if (mDumpTable.empty()) - { - mDumpTable= gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "crash_table.lock"); - } - return getLockFile(mDumpTable); -} - -//static -bool LLCrashLock::fileExists(std::string filename) -{ -#ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path file_path(ll_convert<std::wstring>(filename)); -#else - boost::filesystem::path file_path(filename); -#endif - return boost::filesystem::exists(file_path); -} - -void LLCrashLock::cleanupProcess(std::string proc_dir) -{ -#ifdef LL_WINDOWS // or BOOST_WINDOWS_API - boost::filesystem::path dir_path(ll_convert<std::wstring>(proc_dir)); -#else - boost::filesystem::path dir_path(proc_dir); -#endif - boost::filesystem::remove_all(dir_path); -} - -bool LLCrashLock::putProcessList(const LLSD& proc_sd) -{ - return putLockFile(mDumpTable,proc_sd); -} diff --git a/indra/llcrashlogger/llcrashlock.h b/indra/llcrashlogger/llcrashlock.h deleted file mode 100644 index b20555b746..0000000000 --- a/indra/llcrashlogger/llcrashlock.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file llcrashlock.h - * @brief Maintainence of disk locking files for crash reporting - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_CRASHLOCK_H -#define LL_CRASHLOCK_H - -#include "llframetimer.h" - -class LLSD; - -#if !LL_WINDOWS //For non-windows platforms. -#include <signal.h> -#endif - -//Crash reporter will now be kicked off by the viewer but otherwise -//run independent of the viewer. - -class LLCrashLock -{ -public: - LLCrashLock(); - bool requestMaster( F32 timeout=300.0); //Wait until timeout for master lock. - bool checkMaster(); //True if available. False if not. - void releaseMaster( ); //Release master lockfile. - bool isLockPresent(std::string filename); //Check if lockfile exists. - bool isProcessAlive(U32 pid, const std::string& pname); //Check if pid is alive. - bool isWaiting(); //Waiting for master lock to be released. - LLSD getProcessList(); //Get next process pid/dir pairs - void cleanupProcess(std::string proc_dir); //Remove from list, clean up working dir. - bool putProcessList(const LLSD& processlist); //Write pid/dir pairs back to disk. - static bool fileExists(std::string filename); - - - //getters - S32 getPID(); - - //setters - void setCleanUp(bool cleanup=true); - void setSaveName(std::string savename); -private: - LLSD getLockFile(std::string filename); - bool putLockFile(std::string filename, const LLSD& data); - bool mCleanUp; - std::string mMaster; - std::string mDumpTable; - U32 mWaitingPID; //The process we're waiting on if any. - LLFrameTimer mTimer; -}; - -#endif // LL_CRASHLOCK_H diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp deleted file mode 100644 index d5c585b45e..0000000000 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ /dev/null @@ -1,682 +0,0 @@ - /** -* @file llcrashlogger.cpp -* @brief Crash logger implementation -* -* $LicenseInfo:firstyear=2003&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include <cstdio> -#include <cstdlib> -#include <sstream> -#include <map> - -#include "llcrashlogger.h" -#include "llcrashlock.h" -#include "linden_common.h" -#include "llstring.h" -#include "indra_constants.h" // CRASH_BEHAVIOR_... -#include "llerror.h" -#include "llerrorcontrol.h" -#include "lltimer.h" -#include "lldir.h" -#include "llfile.h" -#include "llsdserialize.h" -#include "llproxy.h" -#include "llcorehttputil.h" -#include "llhttpsdhandler.h" -#include "httpcommon.h" -#include "httpresponse.h" -#include "llcleanup.h" - -#include <curl/curl.h> -#include <openssl/crypto.h> - -bool gBreak = false; -bool gSent = false; - -int LLCrashLogger::ssl_mutex_count = 0; -LLCoreInt::HttpMutex ** LLCrashLogger::ssl_mutex_list = NULL; - -#define CRASH_UPLOAD_RETRIES 3 /* seconds */ -#define CRASH_UPLOAD_TIMEOUT 180 /* seconds */ - -class LLCrashLoggerHandler : public LLHttpSDHandler -{ - LOG_CLASS(LLCrashLoggerHandler); -public: - LLCrashLoggerHandler() {} - -protected: - virtual void onSuccess(LLCore::HttpResponse * response, const LLSD &content); - virtual void onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status); - -}; - -void LLCrashLoggerHandler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) -{ - LL_DEBUGS("CRASHREPORT") << "Request to " << response->getRequestURL() << "succeeded" << LL_ENDL; - gBreak = true; - gSent = true; -} - -void LLCrashLoggerHandler::onFailure(LLCore::HttpResponse * response, LLCore::HttpStatus status) -{ - LL_WARNS("CRASHREPORT") << "Request to " << response->getRequestURL() - << " failed: " << status.toString() << LL_ENDL; - gBreak = true; -} - -LLCrashLogger::LLCrashLogger() : - mCrashBehavior(CRASH_BEHAVIOR_ALWAYS_SEND), - mCrashInPreviousExec(false), - mCrashSettings("CrashSettings"), - mSentCrashLogs(false), - mCrashHost("") -{ -} - -LLCrashLogger::~LLCrashLogger() -{ - -} - -// TRIM_SIZE must remain larger than LINE_SEARCH_SIZE. -const int TRIM_SIZE = 128000; -const int LINE_SEARCH_DIST = 500; -const std::string SKIP_TEXT = "\n ...Skipping... \n"; -void trimSLLog(std::string& sllog) -{ - if(sllog.length() > TRIM_SIZE * 2) - { - std::string::iterator head = sllog.begin() + TRIM_SIZE; - std::string::iterator tail = sllog.begin() + sllog.length() - TRIM_SIZE; - std::string::iterator new_head = std::find(head, head - LINE_SEARCH_DIST, '\n'); - if(new_head != head - LINE_SEARCH_DIST) - { - head = new_head; - } - - std::string::iterator new_tail = std::find(tail, tail + LINE_SEARCH_DIST, '\n'); - if(new_tail != tail + LINE_SEARCH_DIST) - { - tail = new_tail; - } - - sllog.erase(head, tail); - sllog.insert(head, SKIP_TEXT.begin(), SKIP_TEXT.end()); - } -} - -std::string getStartupStateFromLog(std::string& sllog) -{ - std::string startup_state = "STATE_FIRST"; - std::string startup_token = "Startup state changing from "; - - auto index = sllog.rfind(startup_token); - if (index < 0 || index + startup_token.length() > sllog.length()) { - return startup_state; - } - - // find new line - char cur_char = sllog[index + startup_token.length()]; - std::string::size_type newline_loc = index + startup_token.length(); - while(cur_char != '\n' && newline_loc < sllog.length()) - { - newline_loc++; - cur_char = sllog[newline_loc]; - } - - // get substring and find location of " to " - std::string state_line = sllog.substr(index, newline_loc - index); - std::string::size_type state_index = state_line.find(" to "); - startup_state = state_line.substr(state_index + 4, state_line.length() - state_index - 4); - - return startup_state; -} - -bool LLCrashLogger::readFromXML(LLSD& dest, const std::string& filename ) -{ - std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,filename); - llifstream log_file(db_file_name.c_str()); - - // Look for it in the given file - if (log_file.is_open()) - { - LLSDSerialize::fromXML(dest, log_file); - log_file.close(); - return true; - } - else - { - LL_WARNS("CRASHREPORT") << "Failed to open " << db_file_name << LL_ENDL; - } - return false; -} - -void LLCrashLogger::mergeLogs( LLSD src_sd ) -{ - LLSD::map_iterator iter = src_sd.beginMap(); - LLSD::map_iterator end = src_sd.endMap(); - for( ; iter != end; ++iter) - { - mDebugLog[iter->first] = iter->second; - } -} - -bool LLCrashLogger::readMinidump(std::string minidump_path) -{ - size_t length=0; - - llifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary); - if (minidump_stream.is_open()) - { - minidump_stream.seekg(0, std::ios::end); - length = (size_t)minidump_stream.tellg(); - LL_WARNS("CRASHREPORT") << "minidump length "<< length <<LL_ENDL; - minidump_stream.seekg(0, std::ios::beg); - - LLSD::Binary data; - data.resize(length); - - minidump_stream.read(reinterpret_cast<char *>(&(data[0])),length); - minidump_stream.close(); - - mCrashInfo["Minidump"] = data; - } - else - { - LL_WARNS("CRASHREPORT") << "failed to open minidump "<<minidump_path<<LL_ENDL; - } - - return length > 0; -} - -void LLCrashLogger::gatherFiles() -{ - updateApplication("Gathering logs..."); - - LLSD static_sd; - LLSD dynamic_sd; - //if we ever want to change the endpoint we send crashes to - //we can construct a file download ( a la feature table filename for example) - //containing the new endpoint - LLSD endpoint; - std::string grid; - std::string fqdn; - - bool has_logs = readFromXML( static_sd, "static_debug_info.log" ); - has_logs |= readFromXML( dynamic_sd, "dynamic_debug_info.log" ); - - - if ( has_logs ) - { - mDebugLog = static_sd; - mergeLogs(dynamic_sd); - mCrashInPreviousExec = mDebugLog["CrashNotHandled"].asBoolean(); - - mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); - mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); - mFileMap["CrashHostUrl"] = loadCrashURLSetting(); - if(mDebugLog.has("CAFilename")) - { - LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, mDebugLog["CAFilename"].asString(), NULL); - } - else - { - LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); - } - - LL_INFOS("CRASHREPORT") << "Using log file from debug log " << mFileMap["SecondLifeLog"] << LL_ENDL; - LL_INFOS("CRASHREPORT") << "Using settings file from debug log " << mFileMap["SettingsXml"] << LL_ENDL; - } - else - { - // Figure out the filename of the second life log - LLCore::HttpRequest::setStaticPolicyOption(LLCore::HttpRequest::PO_CA_FILE, - LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); - - mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"SecondLife.log"); - mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); - } - - if (!gDirUtilp->fileExists(mFileMap["SecondLifeLog"]) ) //We would prefer to get this from the per-run but here's our fallback. - { - mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.old"); - } - - gatherPlatformSpecificFiles(); - - - if ( has_logs && (mFileMap["CrashHostUrl"] != "") ) - { - mCrashHost = mFileMap["CrashHostUrl"]; - } - - //default to agni, per product - mAltCrashHost = "http://viewercrashreport.agni.lindenlab.com/cgi-bin/viewercrashreceiver.py"; - - mCrashInfo["DebugLog"] = mDebugLog; - mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); - - updateApplication("Encoding files..."); - - for(std::map<std::string, std::string>::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) - { - std::string file = (*itr).second; - if (!file.empty()) - { - LL_DEBUGS("CRASHREPORT") << "trying to read " << itr->first << ": " << file << LL_ENDL; - llifstream f(file.c_str()); - if(f.is_open()) - { - std::stringstream s; - s << f.rdbuf(); - - std::string crash_info = s.str(); - if(itr->first == "SecondLifeLog") - { - if(!mCrashInfo["DebugLog"].has("StartupState")) - { - mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); - } - trimSLLog(crash_info); - } - - mCrashInfo[(*itr).first] = LLStringFn::strip_invalid_xml(rawstr_to_utf8(crash_info)); - } - else - { - LL_WARNS("CRASHREPORT") << "Failed to open file " << file << LL_ENDL; - } - } - else - { - LL_DEBUGS("CRASHREPORT") << "empty file in list for " << itr->first << LL_ENDL; - } - } - - std::string minidump_path; - // Add minidump as binary. - bool has_minidump = mDebugLog.has("MinidumpPath"); - - if (has_minidump) - { - minidump_path = mDebugLog["MinidumpPath"].asString(); - has_minidump = readMinidump(minidump_path); - } - else - { - LL_WARNS("CRASHREPORT") << "DebugLog does not have MinidumpPath" << LL_ENDL; - } - - if (!has_minidump) //Viewer was probably so hosed it couldn't write remaining data. Try brute force. - { - //Look for a filename at least 30 characters long in the dump dir which contains the characters MDMP as the first 4 characters in the file. - typedef std::vector<std::string> vec; - std::string pathname = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,""); - LL_WARNS("CRASHREPORT") << "Searching for minidump in " << pathname << LL_ENDL; - vec file_vec = gDirUtilp->getFilesInDir(pathname); - for(vec::const_iterator iter=file_vec.begin(); !has_minidump && iter!=file_vec.end(); ++iter) - { - if ( ( iter->length() > 30 ) && (iter->rfind(".dmp") == (iter->length()-4) ) ) - { - std::string fullname = pathname + *iter; - llifstream fdat(fullname.c_str(), std::ifstream::binary); - if (fdat) - { - char buf[5]; - fdat.read(buf,4); - fdat.close(); - if (!strncmp(buf,"MDMP",4)) - { - minidump_path = *iter; - has_minidump = readMinidump(fullname); - mDebugLog["MinidumpPath"] = fullname; - } - else - { - LL_DEBUGS("CRASHREPORT") << "MDMP not found in " << fullname << LL_ENDL; - } - } - else - { - LL_DEBUGS("CRASHREPORT") << "failed to open " << fullname << LL_ENDL; - } - } - else - { - LL_DEBUGS("CRASHREPORT") << "Name does not match minidump name pattern " << *iter << LL_ENDL; - } - } - } - else - { - LL_WARNS("CRASHREPORT") << "readMinidump returned no minidump" << LL_ENDL; - } -} - -LLSD LLCrashLogger::constructPostData() -{ - return mCrashInfo; -} - -const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml"; - -std::string LLCrashLogger::loadCrashURLSetting() -{ - - // First check user_settings (in the user's home dir) - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - if (! mCrashSettings.loadFromFile(filename)) - { - // Next check app_settings (in the SL program dir) - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, CRASH_SETTINGS_FILE); - mCrashSettings.loadFromFile(filename); - } - - if (! mCrashSettings.controlExists("CrashHostUrl")) - { - return ""; - } - else - { - return mCrashSettings.getString("CrashHostUrl"); - } -} - -bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout) -{ - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - - httpOpts->setTimeout(timeout); - httpOpts->setSSLVerifyPeer(false); - - for(int i = 0; i < retries; ++i) - { - updateApplication(llformat("%s, try %d...", msg.c_str(), i+1)); - - LL_INFOS("CRASHREPORT") << "POST crash data to " << host << LL_ENDL; - LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(httpRequest.get(), LLCore::HttpRequest::DEFAULT_POLICY_ID, - host, data, httpOpts, LLCore::HttpHeaders::ptr_t(), LLCore::HttpHandler::ptr_t(new LLCrashLoggerHandler)); - - if (handle == LLCORE_HTTP_HANDLE_INVALID) - { - LLCore::HttpStatus status = httpRequest->getStatus(); - LL_WARNS("CRASHREPORT") << "Request POST failed to " << host << " with status of [" << - status.getType() << "]\"" << status.toString() << "\"" << LL_ENDL; - return false; - } - - while(!gBreak) - { - ms_sleep(250); - updateApplication(); // No new message, just pump the IO - httpRequest->update(0L); - } - if(gSent) - { - return gSent; - } - - LL_WARNS("CRASHREPORT") << "Failed to send crash report to \"" << host << "\"" << LL_ENDL; - } - return gSent; -} - -bool LLCrashLogger::sendCrashLog(std::string dump_dir) -{ - - gDirUtilp->setDumpDir( dump_dir ); - - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "SecondLifeCrashReport"); - std::string report_file = dump_path + ".log"; - - LL_DEBUGS("CRASHREPORT") << "sending " << report_file << LL_ENDL; - - gatherFiles(); - - LLSD post_data; - post_data = constructPostData(); - - updateApplication("Sending reports..."); - - llofstream out_file(report_file.c_str()); - LLSDSerialize::toPrettyXML(post_data, out_file); - out_file.flush(); - out_file.close(); - - bool sent = false; - - if(mCrashHost != "") - { - LL_WARNS("CRASHREPORT") << "Sending crash data to server from CrashHostUrl '" << mCrashHost << "'" << LL_ENDL; - - std::string msg = "Using override crash server... "; - msg = msg+mCrashHost.c_str(); - updateApplication(msg.c_str()); - - sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), CRASH_UPLOAD_RETRIES, CRASH_UPLOAD_TIMEOUT); - } - - if(!sent) - { - updateApplication("Using default server..."); - sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to default server"), CRASH_UPLOAD_RETRIES, CRASH_UPLOAD_TIMEOUT); - } - - mSentCrashLogs = sent; - - return sent; -} - -bool LLCrashLogger::sendCrashLogs() -{ - LLSD locks = mKeyMaster.getProcessList(); - LLSD newlocks = LLSD::emptyArray(); - - LLSD opts = getOptionData(PRIORITY_COMMAND_LINE); - LLSD rec; - - if ( opts.has("pid") && opts.has("dumpdir") && opts.has("procname") ) - { - rec["pid"]=opts["pid"]; - rec["dumpdir"]=opts["dumpdir"]; - rec["procname"]=opts["procname"]; - } - - if (locks.isArray()) - { - for (LLSD::array_iterator lock=locks.beginArray(); - lock !=locks.endArray(); - ++lock) - { - if ( (*lock).has("pid") && (*lock).has("dumpdir") && (*lock).has("procname") ) - { - if ( mKeyMaster.isProcessAlive( (*lock)["pid"].asInteger(), (*lock)["procname"].asString() ) ) - { - newlocks.append(*lock); - } - else - { - //TODO: This is a hack but I didn't want to include boost in another file or retest everything related to lldir - if (LLCrashLock::fileExists((*lock)["dumpdir"].asString())) - { - //the viewer cleans up the log directory on clean shutdown - //but is ignorant of the locking table. - if (!sendCrashLog((*lock)["dumpdir"].asString())) - { - newlocks.append(*lock); //Failed to send log so don't delete it. - } - else - { - mKeyMaster.cleanupProcess((*lock)["dumpdir"].asString()); - } - } - } - } - else - { - LL_INFOS() << "Discarding corrupted entry from lock table." << LL_ENDL; - } - } - } - - if (rec) - { - newlocks.append(rec); - } - - mKeyMaster.putProcessList(newlocks); - return true; -} - -void LLCrashLogger::updateApplication(const std::string& message) -{ - if (!message.empty()) LL_INFOS("CRASHREPORT") << message << LL_ENDL; -} - -bool LLCrashLogger::init() -{ - LL_DEBUGS("CRASHREPORT") << LL_ENDL; - - LLCore::LLHttp::initialize(); - - // We assume that all the logs we're looking for reside on the current drive - gDirUtilp->initAppDirs("SecondLife"); - - LLError::initForApplication(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""), gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); - - // Default to the product name "Second Life" (this is overridden by the -name argument) - mProductName = "Second Life"; - - // Rename current log file to ".old" - std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log.old"); - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "crashreport.log"); - - LLFile::rename(log_file.c_str(), old_log_file.c_str()); - - // Set the log file to crashreport.log - LLError::logToFile(log_file); //NOTE: Until this line, LL_INFOS LL_WARNS, etc are blown to the ether. - - LL_INFOS("CRASHREPORT") << "Crash reporter file rotation complete." << LL_ENDL; - - // Handle locking - bool locked = mKeyMaster.requestMaster(); //Request master locking file. wait time is defaulted to 300S - - while (!locked && mKeyMaster.isWaiting()) - { - LL_INFOS("CRASHREPORT") << "Waiting for lock." << LL_ENDL; -#if LL_WINDOWS - Sleep(1000); -#else - ::sleep(1); -#endif - locked = mKeyMaster.checkMaster(); - } - - if (!locked) - { - LL_WARNS("CRASHREPORT") << "Unable to get master lock. Another crash reporter may be hung." << LL_ENDL; - return false; - } - - mCrashSettings.declareS32("CrashSubmitBehavior", CRASH_BEHAVIOR_ALWAYS_SEND, - "Controls behavior when viewer crashes " - "(0 = ask before sending crash report, " - "1 = always send crash report, " - "2 = never send crash report)"); - - init_curl(); - LLCore::HttpRequest::createService(); - LLCore::HttpRequest::startThread(); - - return true; -} - -// For cleanup code common to all platforms. -void LLCrashLogger::commonCleanup() -{ - term_curl(); - LLError::logToFile(""); //close crashreport.log - SUBSYSTEM_CLEANUP(LLProxy); -} - -void LLCrashLogger::init_curl() -{ - curl_global_init(CURL_GLOBAL_ALL); - - ssl_mutex_count = CRYPTO_num_locks(); - if (ssl_mutex_count > 0) - { - ssl_mutex_list = new LLCoreInt::HttpMutex *[ssl_mutex_count]; - - for (int i(0); i < ssl_mutex_count; ++i) - { - ssl_mutex_list[i] = new LLCoreInt::HttpMutex; - } - - CRYPTO_set_locking_callback(ssl_locking_callback); - CRYPTO_THREADID_set_callback(ssl_thread_id_callback); - } -} - - -void LLCrashLogger::term_curl() -{ - CRYPTO_set_locking_callback(NULL); - for (int i(0); i < ssl_mutex_count; ++i) - { - delete ssl_mutex_list[i]; - } - delete[] ssl_mutex_list; -} - - -void LLCrashLogger::ssl_thread_id_callback(CRYPTO_THREADID* pthreadid) -{ -#if LL_WINDOWS - CRYPTO_THREADID_set_pointer(pthreadid, GetCurrentThread()); -#else - CRYPTO_THREADID_set_pointer(pthreadid, reinterpret_cast<void*>(pthread_self())); -#endif -} - - -void LLCrashLogger::ssl_locking_callback(int mode, int type, const char * /* file */, int /* line */) -{ - if (type >= 0 && type < ssl_mutex_count) - { - if (mode & CRYPTO_LOCK) - { - ssl_mutex_list[type]->lock(); - } - else - { - ssl_mutex_list[type]->unlock(); - } - } -} - diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h deleted file mode 100644 index e5bf19434a..0000000000 --- a/indra/llcrashlogger/llcrashlogger.h +++ /dev/null @@ -1,97 +0,0 @@ -/** -* @file llcrashlogger.h -* @brief Crash Logger Definition -* -* $LicenseInfo:firstyear=2003&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2010, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LLCRASHLOGGER_H -#define LLCRASHLOGGER_H - -#include <vector> - -#include "linden_common.h" - -#include "llapp.h" -#include "llsd.h" -#include "llcontrol.h" -#include "llcrashlock.h" -#include "_mutex.h" - -// We shouldn't have to know the exact declaration of CRYPTO_THREADID, but VS -// 2017 complains if we forward-declare it as simply 'struct CRYPTO_THREADID'. -struct crypto_threadid_st; -typedef crypto_threadid_st CRYPTO_THREADID; - -// Crash reporter behavior -const S32 CRASH_BEHAVIOR_ASK = 0; -const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1; -const S32 CRASH_BEHAVIOR_NEVER_SEND = 2; - -class LLCrashLogger : public LLApp -{ -public: - LLCrashLogger(); - virtual ~LLCrashLogger(); - std::string loadCrashURLSetting(); - bool readFromXML(LLSD& dest, const std::string& filename ); - void gatherFiles(); - void mergeLogs( LLSD src_sd ); - - virtual void gatherPlatformSpecificFiles() {} - bool sendCrashLog(std::string dump_dir); - bool sendCrashLogs(); - LLSD constructPostData(); - virtual void updateApplication(const std::string& message = LLStringUtil::null); - virtual bool init(); - virtual bool frame() = 0; - virtual bool cleanup() = 0; - void commonCleanup(); - void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } - S32 getCrashBehavior() { return mCrashBehavior; } - bool runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout); - bool readMinidump(std::string minidump_path); - -protected: - static void init_curl(); - static void term_curl(); - static void ssl_thread_id_callback(CRYPTO_THREADID*); - static void ssl_locking_callback(int mode, int type, const char * file, int line); - - S32 mCrashBehavior; - bool mCrashInPreviousExec; - std::map<std::string, std::string> mFileMap; - std::string mGridName; - LLControlGroup mCrashSettings; - std::string mProductName; - LLSD mCrashInfo; - std::string mCrashHost; - std::string mAltCrashHost; - LLSD mDebugLog; - bool mSentCrashLogs; - LLCrashLock mKeyMaster; - - static int ssl_mutex_count; - static LLCoreInt::HttpMutex ** ssl_mutex_list; - -}; - -#endif //LLCRASHLOGGER_H diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c269fa699e..e3f02219f3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2085,10 +2085,6 @@ if (LINUX) llwebrtc ) - #if (NOT USE_BUGSPLAT) - # LIST(APPEND COPY_INPUT_DEPENDENCIES linux-crash-logger) - #endif (NOT USE_BUGSPLAT) - add_custom_command( OUTPUT ${product}.tar.xz COMMAND ${PYTHON_EXECUTABLE} diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 07c1123d01..12705c4295 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1133,7 +1133,6 @@ class LinuxManifest(ViewerManifest): with self.prefix(dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") - #self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") self.path2basename("../llplugin/slplugin", "SLPlugin") #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 #with self.prefix(src="../viewer_components/manager", dst=""): |
