SL-14541 remove mac-crash-logger

master
Andrey Kleshchev 2021-09-09 00:20:57 +03:00
parent a212a862b4
commit a791a22b1b
14 changed files with 9 additions and 4419 deletions

View File

@ -73,9 +73,6 @@ if (LINUX)
add_subdirectory(${LLAPPEARANCEUTILITY_SRC_DIR} ${LLAPPEARANCEUTILITY_BIN_DIR})
endif (INSTALL_PROPRIETARY)
add_dependencies(viewer linux-crash-logger-strip-target)
elseif (DARWIN)
add_subdirectory(${VIEWER_PREFIX}mac_crash_logger)
add_dependencies(viewer mac-crash-logger)
elseif (WINDOWS)
# cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake
if (EXISTS ${VIEWER_DIR}win_setup)

View File

@ -385,70 +385,16 @@ void LLApp::setupErrorHandling(bool second_instance)
#else // ! LL_WINDOWS
#if defined(LL_BUGSPLAT)
// Don't install our own signal handlers -- BugSplat needs to hook them,
// or it's completely ineffectual.
bool installHandler = false;
#else // ! LL_BUGSPLAT
//
// Start up signal handling.
//
// There are two different classes of signals. Synchronous signals are delivered to a specific
// thread, asynchronous signals can be delivered to any thread (in theory)
//
setup_signals();
// Add google breakpad exception handler configured for Darwin/Linux.
bool installHandler = true;
#if ! defined(LL_BUGSPLAT)
//
// Start up signal handling.
//
// There are two different classes of signals. Synchronous signals are delivered to a specific
// thread, asynchronous signals can be delivered to any thread (in theory)
//
setup_signals();
#endif // ! LL_BUGSPLAT
#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
// the structure kinfo_proc which has been tagged by apple as an unstable
// API. We disable this test for shipping versions to avoid conflicts with
// future releases of Darwin. This test is really only needed for developers
// starting the app from a debugger anyway.
#ifndef LL_RELEASE_FOR_DOWNLOAD
int mib[4];
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid();
struct kinfo_proc info;
memset(&info, 0, sizeof(info));
size_t size = sizeof(info);
int result = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
if((result == 0) || (errno == ENOMEM))
{
// P_TRACED flag is set, so this process is being debugged; do not install
// the handler
if(info.kp_proc.p_flag & P_TRACED) installHandler = false;
}
else
{
// Failed to discover if the process is being debugged; default to
// installing the handler.
installHandler = true;
}
#endif // ! LL_RELEASE_FOR_DOWNLOAD
#elif LL_LINUX
if(installHandler && (mExceptionHandler == 0))
{
if (mDumpPath.empty())
{
mDumpPath = "/tmp";
}
google_breakpad::MinidumpDescriptor desc(mDumpPath);
mExceptionHandler = new google_breakpad::ExceptionHandler(desc, NULL, unix_minidump_callback, NULL, true, -1);
}
#endif // LL_LINUX
#endif // ! LL_WINDOWS
#ifdef LL_BUGSPLAT

View File

@ -1,95 +0,0 @@
# -*- cmake -*-
project(mac_crash_logger)
include(00-Common)
include(LLCommon)
include(LLCoreHttp)
include(LLCrashLogger)
include(LLMath)
include(LLMessage)
include(LLVFS)
include(LLXML)
include(Linking)
include(LLSharedLibs)
include(Boost)
include_directories(
${LLCOREHTTP_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${LLCRASHLOGGER_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
)
include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
${LLXML_SYSTEM_INCLUDE_DIRS}
)
set(mac_crash_logger_SOURCE_FILES
mac_crash_logger.cpp
llcrashloggermac.cpp
llcrashloggermacdelegate.mm
)
set(mac_crash_logger_HEADER_FILES
CMakeLists.txt
llcrashloggermac.h
llcrashloggermacdelegate.h
)
set_source_files_properties(${mac_crash_logger_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_HEADER_FILES})
set(mac_crash_logger_RESOURCE_FILES
CrashReporter.nib/
)
set_source_files_properties(
${mac_crash_logger_RESOURCE_FILES}
PROPERTIES
HEADER_FILE_ONLY TRUE
)
SOURCE_GROUP("Resources" FILES ${mac_crash_logger_RESOURCE_FILES})
list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_RESOURCE_FILES})
add_executable(mac-crash-logger
MACOSX_BUNDLE
${mac_crash_logger_SOURCE_FILES})
set_target_properties(mac-crash-logger
PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)
find_library(COCOA_LIBRARY Cocoa)
target_link_libraries(mac-crash-logger
${LLCRASHLOGGER_LIBRARIES}
${LLVFS_LIBRARIES}
${COCOA_LIBRARIES}
${LLXML_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLVFS_LIBRARIES}
${LLMATH_LIBRARIES}
${LLCOREHTTP_LIBRARIES}
${LLCOMMON_LIBRARIES}
${BOOST_CONTEXT_LIBRARY}
${BOOST_FIBER_LIBRARY}
)
add_custom_command(
TARGET mac-crash-logger POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/CrashReporter.nib
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-crash-logger.app/Contents/Resources/CrashReporter.nib
)
ll_deploy_sharedlibs_command(mac-crash-logger)

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>mac-crash-logger</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>NSMainNibFile</key>
<string>CrashReporter</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -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.

View File

@ -1,91 +0,0 @@
/**
* @file llcrashloggermac.cpp
* @brief Mac OSX 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 "llcrashloggermac.h"
#include <iostream>
#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"
// Windows Message Handlers
BOOL gFirstDialog = TRUE;
LLFILE *gDebugFile = NULL;
std::string gUserNotes = "";
bool gSendReport = false;
bool gRememberChoice = false;
LLCrashLoggerMac::LLCrashLoggerMac(void)
{
}
LLCrashLoggerMac::~LLCrashLoggerMac(void)
{
}
bool LLCrashLoggerMac::init(void)
{
bool ok = LLCrashLogger::init();
return ok;
}
void LLCrashLoggerMac::gatherPlatformSpecificFiles()
{
}
bool LLCrashLoggerMac::frame()
{
if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
{
gSendReport = true;
}
if(gSendReport)
{
setUserText(gUserNotes);
sendCrashLogs();
}
LL_INFOS() << "Sending of logs complete" << LL_ENDL;
return true;
}
bool LLCrashLoggerMac::cleanup()
{
commonCleanup();
mKeyMaster.releaseMaster();
return true;
}

View File

@ -1,45 +0,0 @@
/**
* @file llcrashloggermac.h
* @brief Mac OSX 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 LLCRASHLOGGERMAC_H
#define LLCRASHLOGGERMAC_H
#include "linden_common.h"
#include "llcrashlogger.h"
#include "llstring.h"
class LLCrashLoggerMac : public LLCrashLogger
{
public:
LLCrashLoggerMac(void);
~LLCrashLoggerMac(void);
virtual bool init();
virtual bool frame();
virtual bool cleanup();
virtual void gatherPlatformSpecificFiles();
};
#endif

View File

@ -1,52 +0,0 @@
/**
* @file llcrashloggermacdelegate.h
* @brief Mac OSX 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$
*/
/*
#import <Cocoa/Cocoa.h>
@interface LLCrashLoggerMacDelegate : NSObject <NSApplicationDelegate>
{
IBOutlet NSTextField *crashText;
IBOutlet NSButton *rememberCheck;
NSWindow *_window;
bool mRemember;
}
- (void)setWindow:(NSWindow *)newWindow;
- (NSWindow *)window;
- (IBAction)remember:(id)sender;
- (IBAction)send:(id)sender;
- (IBAction)cancel:(id)sender;
@property (assign) IBOutlet NSWindow *window;
@end
*/

View File

@ -1,75 +0,0 @@
/**
* @file llcrashloggermacdelegate.mm
* @brief Mac OSX 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$
*/
/*
#import "llcrashloggermacdelegate.h"
#include <iostream>
extern std::string gUserNotes;
extern bool gSendReport;
extern bool gRememberChoice;
@implementation LLCrashLoggerMacDelegate
- (void)setWindow:(NSWindow *)window
{
_window = window;
}
- (NSWindow *)window
{
return _window;
}
- (void)dealloc
{
[super dealloc];
}
std::string* NSToString( NSString *ns_str )
{
return ( new std::string([ns_str UTF8String]) );
}
- (IBAction)remember:(id)sender
{
gRememberChoice = [rememberCheck state];
}
- (IBAction)send:(id)sender
{
std::string* user_input = NSToString([crashText stringValue]);
gUserNotes = *user_input;
gSendReport = true;
}
- (IBAction)cancel:(id)sender
{
[ _window close];
}
@end
*/

View File

@ -1,58 +0,0 @@
/**
* @file mac_crash_logger.cpp
* @brief Mac OSX 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 "llcrashloggermac.h"
#include "indra_constants.h"
#include "llpidlock.h"
#include <iostream>
int main(int argc, char **argv)
{
LLCrashLoggerMac app;
app.parseCommandOptions(argc, argv);
LLSD options = LLApp::instance()->getOptionData(
LLApp::PRIORITY_COMMAND_LINE);
if (! app.init())
{
LL_WARNS() << "Unable to initialize application." << LL_ENDL;
return 1;
}
if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND)
{
// return NSApplicationMain(argc, (const char **)argv);
}
app.frame();
app.cleanup();
LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;
return 0;
}

View File

@ -2218,10 +2218,6 @@ if (DARWIN)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef)
if (NOT USE_BUGSPLAT)
add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger)
endif (NOT USE_BUGSPLAT)
if (ENABLE_SIGNING)
set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}")
else (ENABLE_SIGNING)

View File

@ -222,14 +222,7 @@ LLAppViewerMacOSX::~LLAppViewerMacOSX()
bool LLAppViewerMacOSX::init()
{
bool success = LLAppViewer::init();
if (success)
{
LLAppViewer* pApp = LLAppViewer::instance();
pApp->initCrashReporting();
}
return success;
return LLAppViewer::init();
}
// MacOSX may add and addition command line arguement for the process serial number.