From b09f0a120e53c8b27d196df6a33a42c9ac0e146c Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Wed, 16 Sep 2015 14:21:03 -0700 Subject: maint-5422 changes and merge from release --- indra/llcrashlogger/llcrashlogger.cpp | 181 ++++++++++++---------------- indra/llcrashlogger/llcrashlogger.h | 2 +- indra/mac_crash_logger/llcrashloggermac.cpp | 3 + indra/mac_crash_logger/mac_crash_logger.cpp | 11 +- indra/newview/llappviewermacosx.cpp | 5 +- 5 files changed, 85 insertions(+), 117 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 7a97c16ea7..b1cf20cc8e 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -39,12 +39,14 @@ #include "lltimer.h" #include "lldir.h" #include "llfile.h" -#include "llsdserialize.h" #include "lliopipe.h" #include "llpumpio.h" #include "llhttpclient.h" #include "llsdserialize.h" #include "llproxy.h" +#include "llsdutil.h" //remove + +#include LLPumpIO* gServicePump = NULL; BOOL gBreak = false; @@ -140,16 +142,16 @@ std::string getStartupStateFromLog(std::string& sllog) return startup_state; } -bool LLCrashLogger::readDebugFromXML(LLSD& dest, const std::string& filename ) +bool LLCrashLogger::readFromXML(LLSD& dest, const std::string& filename ) { std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,filename); - std::ifstream debug_log_file(db_file_name.c_str()); + std::ifstream log_file(db_file_name.c_str()); - // Look for it in the debug_info.log file - if (debug_log_file.is_open()) + // Look for it in the given file + if (log_file.is_open()) { - LLSDSerialize::fromXML(dest, debug_log_file); - debug_log_file.close(); + LLSDSerialize::fromXML(dest, log_file); + log_file.close(); return true; } return false; @@ -193,9 +195,18 @@ void LLCrashLogger::gatherFiles() 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 = readDebugFromXML( static_sd, "static_debug_info.log" ); - has_logs |= readDebugFromXML( dynamic_sd, "dynamic_debug_info.log" ); + bool has_logs = readFromXML( static_sd, "static_debug_info.log" ); + has_logs |= readFromXML( dynamic_sd, "dynamic_debug_info.log" ); + bool has_endpoint = readFromXML( endpoint, "endpoint.xml" ); + if ( has_logs ) { @@ -233,31 +244,41 @@ void LLCrashLogger::gatherFiles() gatherPlatformSpecificFiles(); - //Use the debug log to reconstruct the URL to send the crash report to - if(mDebugLog.has("CrashHostUrl")) - { - // Crash log receiver has been manually configured. - mCrashHost = mDebugLog["CrashHostUrl"].asString(); - } - else if(mDebugLog.has("CurrentSimHost")) - { - mCrashHost = "https://"; - mCrashHost += mDebugLog["CurrentSimHost"].asString(); - mCrashHost += ":12043/crash/report"; - } - else if(mDebugLog.has("GridName")) - { - // This is a 'little' hacky, but its the best simple solution. - std::string grid_host = mDebugLog["GridName"].asString(); - LLStringUtil::toLower(grid_host); - mCrashHost = "https://login."; - mCrashHost += grid_host; - mCrashHost += ".lindenlab.com:12043/crash/report"; - } + if ( has_endpoint && endpoint.has("ViewerCrashReceiver" ) ) + { + mCrashHost = endpoint["ViewerCrashReceiver"].asString(); + } + else if ( has_logs ) + { + //Use the debug log to reconstruct the URL to send the crash report to + if(mDebugLog.has("CurrentSimHost")) + { + mCrashHost = "http://viewercrashreport"; + fqdn = mDebugLog["CurrentSimHost"].asString(); + boost::regex sim_re( "sim[[:digit:]]+.[[:alpha:]]+.lindenlab.com" ); + boost::match_results results; + if ( regex_match( fqdn, sim_re ) ) + { + boost::regex regex_delimited("\\.[[:alpha:]]+\\."); + boost::match_flag_type flags = boost::match_default; + std::string::const_iterator start = fqdn.begin(); + std::string::const_iterator end = fqdn.end(); + boost::regex_search(start, end, results, regex_delimited, flags); + grid = std::string(results[0].first, results[0].second); + mCrashHost += grid; + mCrashHost += "lindenlab.com/cgi-bin/viewercrashreceiver.py"; + } + else + { + mCrashHost = ""; + } - // Use login servers as the alternate, since they are already load balanced and have a known name - mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; + } + } + + //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"); @@ -389,15 +410,15 @@ bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior) bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg, int retries, int timeout) { - gBreak = false; for(int i = 0; i < retries; ++i) { updateApplication(llformat("%s, try %d...", msg.c_str(), i+1)); LLHTTPClient::post(host, data, new LLCrashLoggerResponder(), timeout); - while(!gBreak) - { - updateApplication(); // No new message, just pump the IO - } + while(!gBreak) + { + ms_sleep(250); + updateApplication(); // No new message, just pump the IO + } if(gSent) { return gSent; @@ -408,12 +429,13 @@ bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg 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"; - + gatherFiles(); LLSD post_data; @@ -423,18 +445,24 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) std::ofstream out_file(report_file.c_str()); LLSDSerialize::toPrettyXML(post_data, out_file); + out_file.flush(); out_file.close(); bool sent = false; //*TODO: Translate if(mCrashHost != "") - { + { + std::string msg = "Using derived crash server... "; + msg = msg+mCrashHost.c_str(); + updateApplication(msg.c_str()); + sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3, 5); } if(!sent) { + updateApplication("Using alternate (default) server..."); sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5); } @@ -446,65 +474,22 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) bool LLCrashLogger::sendCrashLogs() { - //pertinent code from below moved into a subroutine. - 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") ) + if ( opts.has("dumpdir") ) { rec["pid"]=opts["pid"]; rec["dumpdir"]=opts["dumpdir"]; rec["procname"]=opts["procname"]; } - - if (locks.isArray()) + else { - 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 - { - //mCrashInfo["DebugLog"].erase("MinidumpPath"); - - mKeyMaster.cleanupProcess((*lock)["dumpdir"].asString()); - } - } - } - } - else - { - LL_WARNS() << "Discarding corrupted entry from lock table." << LL_ENDL; - } - } - } + return false; + } + + return sendCrashLog(rec["dumpdir"].asString()); - if (rec) - { - newlocks.append(rec); - } - - mKeyMaster.putProcessList(newlocks); return true; } @@ -540,25 +525,7 @@ bool LLCrashLogger::init() // 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. - // 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; - } + LL_INFOS() << "Crash reporter file rotation complete." << LL_ENDL; mCrashSettings.declareS32("CrashSubmitBehavior", CRASH_BEHAVIOR_ALWAYS_SEND, "Controls behavior when viewer crashes " diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h index a06bf1d6ac..b8a007f2be 100755 --- a/indra/llcrashlogger/llcrashlogger.h +++ b/indra/llcrashlogger/llcrashlogger.h @@ -46,7 +46,7 @@ public: LLCrashLogger(); virtual ~LLCrashLogger(); S32 loadCrashBehaviorSetting(); - bool readDebugFromXML(LLSD& dest, const std::string& filename ); + bool readFromXML(LLSD& dest, const std::string& filename ); void gatherFiles(); void mergeLogs( LLSD src_sd ); diff --git a/indra/mac_crash_logger/llcrashloggermac.cpp b/indra/mac_crash_logger/llcrashloggermac.cpp index 351009814d..ed64ebdb8c 100755 --- a/indra/mac_crash_logger/llcrashloggermac.cpp +++ b/indra/mac_crash_logger/llcrashloggermac.cpp @@ -66,6 +66,7 @@ void LLCrashLoggerMac::gatherPlatformSpecificFiles() bool LLCrashLoggerMac::mainLoop() { + if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND) { gSendReport = true; @@ -82,6 +83,8 @@ bool LLCrashLoggerMac::mainLoop() setUserText(gUserNotes); sendCrashLogs(); } + + LL_INFOS() << "Sending of logs complete" << LL_ENDL; return true; } diff --git a/indra/mac_crash_logger/mac_crash_logger.cpp b/indra/mac_crash_logger/mac_crash_logger.cpp index d6b913829e..72f4ede999 100755 --- a/indra/mac_crash_logger/mac_crash_logger.cpp +++ b/indra/mac_crash_logger/mac_crash_logger.cpp @@ -39,16 +39,17 @@ int main(int argc, char **argv) LLSD options = LLApp::instance()->getOptionData( LLApp::PRIORITY_COMMAND_LINE); - if (!(options.has("pid") && options.has("dumpdir"))) - { - llwarns << "Insufficient parameters to crash report." << llendl; - } - if (! app.init()) { LL_WARNS() << "Unable to initialize application." << LL_ENDL; return 1; } + + if (!(options.has("pid") && options.has("dumpdir"))) + { + LL_WARNS() << "Insufficient parameters to crash report." << llendl; + } + if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND) { // return NSApplicationMain(argc, (const char **)argv); diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 56154a2de3..b85f3249bf 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -82,10 +82,6 @@ static void exceptionTerminateHandler() bool initViewer() { -#if LL_SOLARIS && defined(__sparc) - asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC -#endif - // Set the working dir to /Contents/Resources if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) { @@ -296,6 +292,7 @@ void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze) std::string appname = gDirUtilp->getExecutableFilename(); std::string str[] = { "-pid", pid_str.str(), "-dumpdir", logdir, "-procname", appname.c_str() }; std::vector< std::string > args( str, str + ( sizeof ( str ) / sizeof ( std::string ) ) ); + LL_WARNS() << "about to launch mac-crash-logger" << pid_str << " " << logdir << " " << appname << LL_ENDL; launchApplication(&command_str, &args); } -- cgit v1.2.3 From cc79b5663f479895f121c07f3797ea276c844a94 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Wed, 16 Dec 2015 14:45:03 -0800 Subject: MAINT-5974: change URL creation --- indra/llcrashlogger/llcrashlogger.cpp | 36 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 7a97c16ea7..0c5bbf2fdf 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -233,31 +233,23 @@ void LLCrashLogger::gatherFiles() gatherPlatformSpecificFiles(); - //Use the debug log to reconstruct the URL to send the crash report to - if(mDebugLog.has("CrashHostUrl")) - { - // Crash log receiver has been manually configured. - mCrashHost = mDebugLog["CrashHostUrl"].asString(); - } - else if(mDebugLog.has("CurrentSimHost")) - { - mCrashHost = "https://"; - mCrashHost += mDebugLog["CurrentSimHost"].asString(); - mCrashHost += ":12043/crash/report"; - } - else if(mDebugLog.has("GridName")) - { - // This is a 'little' hacky, but its the best simple solution. - std::string grid_host = mDebugLog["GridName"].asString(); - LLStringUtil::toLower(grid_host); + //Construct crash report URL + //CNAMES for the VIPs are viewercrashreport.{agni, damballah}.lindenlab.com + std::string grid = mDebugLog["GridName"].asString(); + LLStringUtil::toLower(grid); + if(grid == "agni") + { + mCrashHost = "https://viewercrashreport.agni.lindenlab.com/cgi-bin/viewercrashreceiver.py"; + + } + else + { + mCrashHost = "https://viewercrashreport.damballah.lindenlab.com/cgi-bin/viewercrashreceiver.py"; + } - mCrashHost = "https://login."; - mCrashHost += grid_host; - mCrashHost += ".lindenlab.com:12043/crash/report"; - } // Use login servers as the alternate, since they are already load balanced and have a known name - mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; + mAltCrashHost = mCrashHost; mCrashInfo["DebugLog"] = mDebugLog; mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); -- cgit v1.2.3 From 281521fe42facc08c00ea6df902e31a6749d6eea Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Thu, 25 Feb 2016 10:28:38 -0800 Subject: rollback hardcoded version --- indra/llcrashlogger/llcrashlogger.cpp | 36 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 0c5bbf2fdf..7a97c16ea7 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -233,23 +233,31 @@ void LLCrashLogger::gatherFiles() gatherPlatformSpecificFiles(); - //Construct crash report URL - //CNAMES for the VIPs are viewercrashreport.{agni, damballah}.lindenlab.com - std::string grid = mDebugLog["GridName"].asString(); - LLStringUtil::toLower(grid); - if(grid == "agni") - { - mCrashHost = "https://viewercrashreport.agni.lindenlab.com/cgi-bin/viewercrashreceiver.py"; - - } - else - { - mCrashHost = "https://viewercrashreport.damballah.lindenlab.com/cgi-bin/viewercrashreceiver.py"; - } + //Use the debug log to reconstruct the URL to send the crash report to + if(mDebugLog.has("CrashHostUrl")) + { + // Crash log receiver has been manually configured. + mCrashHost = mDebugLog["CrashHostUrl"].asString(); + } + else if(mDebugLog.has("CurrentSimHost")) + { + mCrashHost = "https://"; + mCrashHost += mDebugLog["CurrentSimHost"].asString(); + mCrashHost += ":12043/crash/report"; + } + else if(mDebugLog.has("GridName")) + { + // This is a 'little' hacky, but its the best simple solution. + std::string grid_host = mDebugLog["GridName"].asString(); + LLStringUtil::toLower(grid_host); + mCrashHost = "https://login."; + mCrashHost += grid_host; + mCrashHost += ".lindenlab.com:12043/crash/report"; + } // Use login servers as the alternate, since they are already load balanced and have a known name - mAltCrashHost = mCrashHost; + mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; mCrashInfo["DebugLog"] = mDebugLog; mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); -- cgit v1.2.3 From 442c4842ab3cbdea8726ec425c55102caaa2033a Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Tue, 8 Mar 2016 08:09:11 -0800 Subject: maint-5974/maint-5422: viewer changes for new crash reporting, remove no send logic --- indra/llcrashlogger/llcrashlogger.cpp | 91 ++++++----------------------- indra/llcrashlogger/llcrashlogger.h | 2 +- indra/mac_crash_logger/llcrashloggermac.cpp | 6 -- 3 files changed, 18 insertions(+), 81 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index b1cf20cc8e..c72d9cda57 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -201,11 +201,9 @@ void LLCrashLogger::gatherFiles() 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" ); - bool has_endpoint = readFromXML( endpoint, "endpoint.xml" ); if ( has_logs ) @@ -216,6 +214,7 @@ void LLCrashLogger::gatherFiles() mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); + mFileMap["CrashHostUrl"] = loadCrashURLSetting(); if(mDebugLog.has("CAFilename")) { LLCurl::setCAFile(mDebugLog["CAFilename"].asString()); @@ -245,37 +244,10 @@ void LLCrashLogger::gatherFiles() gatherPlatformSpecificFiles(); - if ( has_endpoint && endpoint.has("ViewerCrashReceiver" ) ) + if ( has_logs && (mFileMap["CrashHostUrl"] != "") ) { - mCrashHost = endpoint["ViewerCrashReceiver"].asString(); + mCrashHost = mFileMap["CrashHostUrl"]; } - else if ( has_logs ) - { - //Use the debug log to reconstruct the URL to send the crash report to - if(mDebugLog.has("CurrentSimHost")) - { - mCrashHost = "http://viewercrashreport"; - fqdn = mDebugLog["CurrentSimHost"].asString(); - boost::regex sim_re( "sim[[:digit:]]+.[[:alpha:]]+.lindenlab.com" ); - boost::match_results results; - if ( regex_match( fqdn, sim_re ) ) - { - boost::regex regex_delimited("\\.[[:alpha:]]+\\."); - boost::match_flag_type flags = boost::match_default; - std::string::const_iterator start = fqdn.begin(); - std::string::const_iterator end = fqdn.end(); - boost::regex_search(start, end, results, regex_delimited, flags); - grid = std::string(results[0].first, results[0].second); - mCrashHost += grid; - mCrashHost += "lindenlab.com/cgi-bin/viewercrashreceiver.py"; - } - else - { - mCrashHost = ""; - } - - } - } //default to agni, per product mAltCrashHost = "http://viewercrashreport.agni.lindenlab.com/cgi-bin/viewercrashreceiver.py"; @@ -363,8 +335,9 @@ LLSD LLCrashLogger::constructPostData() const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml"; -S32 LLCrashLogger::loadCrashBehaviorSetting() +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)) @@ -374,38 +347,14 @@ S32 LLCrashLogger::loadCrashBehaviorSetting() mCrashSettings.loadFromFile(filename); } - // If we didn't load any files above, this will return the default - S32 value = mCrashSettings.getS32("CrashSubmitBehavior"); - - // Whatever value we got, make sure it's valid - switch (value) - { - case CRASH_BEHAVIOR_NEVER_SEND: - return CRASH_BEHAVIOR_NEVER_SEND; - case CRASH_BEHAVIOR_ALWAYS_SEND: - return CRASH_BEHAVIOR_ALWAYS_SEND; - } - - return CRASH_BEHAVIOR_ASK; -} - -bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior) -{ - switch (crash_behavior) - { - case CRASH_BEHAVIOR_ASK: - case CRASH_BEHAVIOR_NEVER_SEND: - case CRASH_BEHAVIOR_ALWAYS_SEND: - break; - default: - return false; - } - - mCrashSettings.setS32("CrashSubmitBehavior", crash_behavior); - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - mCrashSettings.saveToFile(filename, FALSE); - - return true; + 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) @@ -451,6 +400,7 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) bool sent = false; //*TODO: Translate + updateApplication("DEBUG: crash host in send logs "+mCrashHost); if(mCrashHost != "") { std::string msg = "Using derived crash server... "; @@ -462,8 +412,8 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) if(!sent) { - updateApplication("Using alternate (default) server..."); - sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3, 5); + updateApplication("Using default server..."); + sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to default server"), 3, 5); } mSentCrashLogs = sent; @@ -535,14 +485,7 @@ bool LLCrashLogger::init() // LL_INFOS() << "Loading crash behavior setting" << LL_ENDL; // mCrashBehavior = loadCrashBehaviorSetting(); - - // If user doesn't want to send, bail out - if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND) - { - LL_INFOS() << "Crash behavior is never_send, quitting" << LL_ENDL; - return false; - } - + gServicePump = new LLPumpIO(gAPRPoolp); gServicePump->prime(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h index b8a007f2be..7defe6b8f9 100755 --- a/indra/llcrashlogger/llcrashlogger.h +++ b/indra/llcrashlogger/llcrashlogger.h @@ -45,7 +45,7 @@ class LLCrashLogger : public LLApp public: LLCrashLogger(); virtual ~LLCrashLogger(); - S32 loadCrashBehaviorSetting(); + std::string loadCrashURLSetting(); bool readFromXML(LLSD& dest, const std::string& filename ); void gatherFiles(); void mergeLogs( LLSD src_sd ); diff --git a/indra/mac_crash_logger/llcrashloggermac.cpp b/indra/mac_crash_logger/llcrashloggermac.cpp index ed64ebdb8c..3149fad6e8 100755 --- a/indra/mac_crash_logger/llcrashloggermac.cpp +++ b/indra/mac_crash_logger/llcrashloggermac.cpp @@ -72,12 +72,6 @@ bool LLCrashLoggerMac::mainLoop() gSendReport = true; } - if(gRememberChoice) - { - if(gSendReport) saveCrashBehaviorSetting(CRASH_BEHAVIOR_ALWAYS_SEND); - else saveCrashBehaviorSetting(CRASH_BEHAVIOR_NEVER_SEND); - } - if(gSendReport) { setUserText(gUserNotes); -- cgit v1.2.3 From 68745390eaaf20cceb788f7538fb4550e806581f Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Tue, 8 Mar 2016 09:39:05 -0800 Subject: maint-5974 / maint-5422: remove extraneous return statement --- indra/llcrashlogger/llcrashlogger.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index c72d9cda57..d6c10c031a 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -439,8 +439,6 @@ bool LLCrashLogger::sendCrashLogs() } return sendCrashLog(rec["dumpdir"].asString()); - - return true; } void LLCrashLogger::updateApplication(const std::string& message) -- cgit v1.2.3 From daf8b882a12cf903d180f6303065d7b83f7a1958 Mon Sep 17 00:00:00 2001 From: Glenn Glazer Date: Tue, 8 Mar 2016 11:55:48 -0800 Subject: maint-5974 / maint-5422: rip crash logger save behavior out of windows logger --- indra/llcrashlogger/llcrashlogger.h | 1 - indra/win_crash_logger/llcrashloggerwindows.cpp | 16 ---------------- 2 files changed, 17 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h index 7defe6b8f9..c5f1bee5cf 100755 --- a/indra/llcrashlogger/llcrashlogger.h +++ b/indra/llcrashlogger/llcrashlogger.h @@ -51,7 +51,6 @@ public: void mergeLogs( LLSD src_sd ); virtual void gatherPlatformSpecificFiles() {} - bool saveCrashBehaviorSetting(S32 crash_behavior); bool sendCrashLog(std::string dump_dir); bool sendCrashLogs(); LLSD constructPostData(); diff --git a/indra/win_crash_logger/llcrashloggerwindows.cpp b/indra/win_crash_logger/llcrashloggerwindows.cpp index 51e70f95b6..23c29e6b18 100644 --- a/indra/win_crash_logger/llcrashloggerwindows.cpp +++ b/indra/win_crash_logger/llcrashloggerwindows.cpp @@ -171,22 +171,6 @@ bool handle_button_click(WORD button_id) return false; } - // See if "do this next time" is checked and save state - S32 crash_behavior = CRASH_BEHAVIOR_ASK; - LRESULT result = SendDlgItemMessage(gHwndReport, IDC_CHECK_AUTO, BM_GETCHECK, 0, 0); - if (result == BST_CHECKED) - { - if (button_id == IDOK) - { - crash_behavior = CRASH_BEHAVIOR_ALWAYS_SEND; - } - else if (button_id == IDCANCEL) - { - crash_behavior = CRASH_BEHAVIOR_NEVER_SEND; - } - ((LLCrashLoggerWindows*)LLCrashLogger::instance())->saveCrashBehaviorSetting(crash_behavior); - } - // We're done with this dialog. gFirstDialog = FALSE; -- cgit v1.2.3 From a6bc849992ea120e6d05ac4b6ddf61c9ee807588 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Apr 2016 14:41:38 -0400 Subject: add logging around crash reporting, with minor code cleanups --- indra/llcrashlogger/llcrashlogger.cpp | 65 ++++++++++++++++------------- indra/mac_crash_logger/mac_crash_logger.cpp | 5 --- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 474c837107..9fd6b66513 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -69,12 +69,15 @@ protected: 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; } @@ -230,8 +233,8 @@ void LLCrashLogger::gatherFiles() LLCore::HttpRequest::GLOBAL_POLICY_ID, gDirUtilp->getCAFile(), NULL); } - LL_INFOS() << "Using log file from debug log " << mFileMap["SecondLifeLog"] << LL_ENDL; - LL_INFOS() << "Using settings file from debug log " << mFileMap["SettingsXml"] << LL_ENDL; + 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 { @@ -267,25 +270,27 @@ void LLCrashLogger::gatherFiles() for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) { std::ifstream f((*itr).second.c_str()); - if(!f.is_open()) - { - LL_INFOS("CRASHREPORT") << "Can't find file " << (*itr).second << LL_ENDL; - continue; - } - std::stringstream s; - s << f.rdbuf(); + 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); - } + 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)); + mCrashInfo[(*itr).first] = LLStringFn::strip_invalid_xml(rawstr_to_utf8(crash_info)); + } + else + { + LL_WARNS("CRASHREPORT") << "Can't find file " << (*itr).second << LL_ENDL; + } } std::string minidump_path; @@ -375,6 +380,7 @@ bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg { 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, 0, host, data, httpOpts, LLCore::HttpHeaders::ptr_t(), LLCore::HttpHandler::ptr_t(new LLCrashLoggerHandler)); @@ -411,6 +417,8 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) "SecondLifeCrashReport"); std::string report_file = dump_path + ".log"; + LL_DEBUGS("CRASHREPORT") << "sending " << report_file << LL_ENDL; + gatherFiles(); LLSD post_data; @@ -425,11 +433,11 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) bool sent = false; - //*TODO: Translate - updateApplication("DEBUG: crash host in send logs "+mCrashHost); - if(mCrashHost != "") - { - std::string msg = "Using derived crash server... "; + 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()); @@ -469,11 +477,13 @@ bool LLCrashLogger::sendCrashLogs() void LLCrashLogger::updateApplication(const std::string& message) { - if (!message.empty()) LL_INFOS() << message << LL_ENDL; + 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 @@ -497,7 +507,7 @@ bool LLCrashLogger::init() // 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() << "Crash reporter file rotation complete." << LL_ENDL; + LL_INFOS("CRASHREPORT") << "Crash reporter file rotation complete." << LL_ENDL; mCrashSettings.declareS32("CrashSubmitBehavior", CRASH_BEHAVIOR_ALWAYS_SEND, "Controls behavior when viewer crashes " @@ -505,9 +515,6 @@ bool LLCrashLogger::init() "1 = always send crash report, " "2 = never send crash report)"); - // LL_INFOS() << "Loading crash behavior setting" << LL_ENDL; - // mCrashBehavior = loadCrashBehaviorSetting(); - init_curl(); LLCore::HttpRequest::createService(); LLCore::HttpRequest::startThread(); diff --git a/indra/mac_crash_logger/mac_crash_logger.cpp b/indra/mac_crash_logger/mac_crash_logger.cpp index 72f4ede999..95d4e65207 100755 --- a/indra/mac_crash_logger/mac_crash_logger.cpp +++ b/indra/mac_crash_logger/mac_crash_logger.cpp @@ -45,11 +45,6 @@ int main(int argc, char **argv) return 1; } - if (!(options.has("pid") && options.has("dumpdir"))) - { - LL_WARNS() << "Insufficient parameters to crash report." << llendl; - } - if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND) { // return NSApplicationMain(argc, (const char **)argv); -- cgit v1.2.3 From ddd476c90c99c75a4add6c00243a90e84e025402 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 20 Apr 2016 11:52:00 -0400 Subject: MAINT-6322 fix merge error that prevented crash dumps from being located for upload (and add better logging) --- indra/llcommon/llapp.cpp | 6 +- indra/llcrashlogger/llcrashlogger.cpp | 150 +++++++++++++++++++++++++++------- indra/newview/llappviewer.cpp | 18 ++-- 3 files changed, 136 insertions(+), 38 deletions(-) diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 5a40845e7d..eb0699ad41 100755 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -929,7 +929,7 @@ bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_ strncpy(path, minidump_desc.path(), remaining); - LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; + LL_INFOS("CRASHREPORT") << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -975,7 +975,7 @@ bool unix_post_minidump_callback(const char *dump_dir, strncpy(path, ".dmp", remaining); } - LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; + LL_INFOS("CRASHREPORT") << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; LLApp::runErrorHandler(); #ifndef LL_RELEASE_FOR_DOWNLOAD @@ -1019,7 +1019,7 @@ bool windows_post_minidump_callback(const wchar_t* dump_path, strncpy(path, ".dmp", remaining); } - LL_INFOS() << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; + LL_INFOS("CRASHREPORT") << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << LL_ENDL; // *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 diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 9fd6b66513..7e52eb231a 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -161,6 +161,10 @@ bool LLCrashLogger::readFromXML(LLSD& dest, const std::string& filename ) log_file.close(); return true; } + else + { + LL_WARNS("CRASHREPORT") << "Failed to open " << db_file_name << LL_ENDL; + } return false; } @@ -193,6 +197,11 @@ bool LLCrashLogger::readMinidump(std::string minidump_path) mCrashInfo["Minidump"] = data; } + else + { + LL_WARNS("CRASHREPORT") << "failed to open minidump "<0?true:false); } @@ -269,27 +278,36 @@ void LLCrashLogger::gatherFiles() for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) { - std::ifstream f((*itr).second.c_str()); - if(f.is_open()) + std::string file = (*itr).second; + if (!file.empty()) { - std::stringstream s; - s << f.rdbuf(); - - std::string crash_info = s.str(); - if(itr->first == "SecondLifeLog") + LL_DEBUGS("CRASHREPORT") << "trying to read " << itr->first << ": " << file << LL_ENDL; + std::ifstream f(file.c_str()); + if(f.is_open()) { - if(!mCrashInfo["DebugLog"].has("StartupState")) + std::stringstream s; + s << f.rdbuf(); + + std::string crash_info = s.str(); + if(itr->first == "SecondLifeLog") { - mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); + if(!mCrashInfo["DebugLog"].has("StartupState")) + { + mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); + } + trimSLLog(crash_info); } - trimSLLog(crash_info); - } - mCrashInfo[(*itr).first] = LLStringFn::strip_invalid_xml(rawstr_to_utf8(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_WARNS("CRASHREPORT") << "Can't find file " << (*itr).second << LL_ENDL; + LL_DEBUGS("CRASHREPORT") << "empty file in list for " << itr->first << LL_ENDL; } } @@ -300,20 +318,21 @@ void LLCrashLogger::gatherFiles() if (has_minidump) { minidump_path = mDebugLog["MinidumpPath"].asString(); - } - - if (has_minidump) - { 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. + //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 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(); iter!=file_vec.end(); ++iter) + 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) ) ) { @@ -329,15 +348,27 @@ void LLCrashLogger::gatherFiles() minidump_path = *iter; has_minidump = readMinidump(fullname); mDebugLog["MinidumpPath"] = fullname; - if (has_minidump) - { - break; - } + } + 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() @@ -457,22 +488,63 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) bool LLCrashLogger::sendCrashLogs() { - + LLSD locks = mKeyMaster.getProcessList(); + LLSD newlocks = LLSD::emptyArray(); + LLSD opts = getOptionData(PRIORITY_COMMAND_LINE); LLSD rec; - if ( opts.has("dumpdir") ) + if ( opts.has("pid") && opts.has("dumpdir") && opts.has("procname") ) { rec["pid"]=opts["pid"]; rec["dumpdir"]=opts["dumpdir"]; rec["procname"]=opts["procname"]; } - else + + if (locks.isArray()) { - return false; - } + 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; + } + } + } - return sendCrashLog(rec["dumpdir"].asString()); + if (rec) + { + newlocks.append(rec); + } + + mKeyMaster.putProcessList(newlocks); + return true; } void LLCrashLogger::updateApplication(const std::string& message) @@ -509,6 +581,26 @@ bool LLCrashLogger::init() 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, " diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 212627c0f7..45306dcff4 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3615,9 +3615,9 @@ void getFileList() void LLAppViewer::handleViewerCrash() { - LL_INFOS() << "Handle viewer crash entry." << LL_ENDL; + LL_INFOS("CRASHREPORT") << "Handle viewer crash entry." << LL_ENDL; - LL_INFOS() << "Last render pool type: " << LLPipeline::sCurRenderPoolType << LL_ENDL ; + LL_INFOS("CRASHREPORT") << "Last render pool type: " << LLPipeline::sCurRenderPoolType << LL_ENDL ; LLMemory::logMemoryInfo(true) ; @@ -3725,30 +3725,36 @@ void LLAppViewer::handleViewerCrash() #endif char *minidump_file = pApp->getMiniDumpFilename(); - + LL_DEBUGS("CRASHREPORT") << "minidump file name " << minidump_file << LL_ENDL; if(minidump_file && minidump_file[0] != 0) { gDebugInfo["Dynamic"]["MinidumpPath"] = minidump_file; } -#ifdef LL_WINDOWS else { +#ifdef LL_WINDOWS getFileList(); +#else + LL_WARNS("CRASHREPORT") << "no minidump file?" << LL_ENDL; +#endif } -#endif gDebugInfo["Dynamic"]["CrashType"]="crash"; if (gMessageSystem && gDirUtilp) { std::string filename; filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log"); + LL_DEBUGS("CRASHREPORT") << "recording stats " << filename << LL_ENDL; llofstream file(filename.c_str(), std::ios_base::binary); if(file.good()) { - LL_INFOS() << "Handle viewer crash generating stats log." << LL_ENDL; gMessageSystem->summarizeLogs(file); file.close(); } + else + { + LL_WARNS("CRASHREPORT") << "problem recording stats" << LL_ENDL; + } } if (gMessageSystem) -- cgit v1.2.3 From 6de1d311f906058be07fc7f5a0431a23d53f26b1 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 20 Apr 2016 12:26:28 -0400 Subject: reset crash dump upload retries and timeouts --- indra/llcrashlogger/llcrashlogger.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 7e52eb231a..69a806bbea 100755 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -55,6 +55,9 @@ 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); @@ -472,13 +475,13 @@ bool LLCrashLogger::sendCrashLog(std::string dump_dir) msg = msg+mCrashHost.c_str(); updateApplication(msg.c_str()); - sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3, 5); + 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"), 3, 5); + sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to default server"), CRASH_UPLOAD_RETRIES, CRASH_UPLOAD_TIMEOUT); } mSentCrashLogs = sent; -- cgit v1.2.3 From c938e165062cbe53065dcdaa434fc1c3d9f38774 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 5 May 2016 13:53:07 -0400 Subject: various changes required to compile on new clang --- autobuild.xml | 28 ++++++++++++++-------------- indra/llkdu/llimagej2ckdu.cpp | 12 ++++++------ indra/newview/llmaniprotate.cpp | 3 --- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 6c29d5cb18..072dfa678a 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1528,11 +1528,11 @@ archive hash - 468e88a527e610804c3eecf07f4ed70b + 01a7cc9d0e56238a9abedd7a41ccd0a3 hash_algorithm md5 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source_llphysicsextensions-update/rev/298369/arch/Darwin/installer/llphysicsextensions_source-1.0.298369-darwin-298369.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions/rev/313564/arch/Darwin/installer/llphysicsextensions_source-1.0.313564-darwin-313564.tar.bz2 name darwin @@ -1542,9 +1542,9 @@ archive hash - 793964e49c935b414c4bdbb8a0d14ad1 + c94dc7ab6efe59c0d5d04fc447257c57 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source_llphysicsextensions-update/rev/298369/arch/Linux/installer/llphysicsextensions_source-1.0.298369-linux-298369.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions/rev/313564/arch/Linux/installer/llphysicsextensions_source-1.0.313564-linux-313564.tar.bz2 name linux @@ -1554,16 +1554,16 @@ archive hash - 922aad5261aac150e5ce3c094e57f373 + e760be34addeb0cd6e2ec43394834bac url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions-source_llphysicsextensions-update/rev/298369/arch/CYGWIN/installer/llphysicsextensions_source-1.0.298369-windows-298369.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llphysicsextensions/rev/313564/arch/CYGWIN/installer/llphysicsextensions_source-1.0.313564-windows-313564.tar.bz2 name windows version - 1.0.298369 + 1.0.313564 llphysicsextensions_stub @@ -1582,11 +1582,11 @@ archive hash - 1175977a191ffc936fd0ccca433c8278 + c8c6e5867d1ead7ad452a3359b22cf44 hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub_llphysicsextensions-update/rev/298370/arch/Darwin/installer/llphysicsextensions_stub-1.0.298370-darwin-298370.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions/rev/313563/arch/Darwin/installer/llphysicsextensions_stub-1.0.313563-darwin-313563.tar.bz2 name darwin @@ -1596,9 +1596,9 @@ archive hash - d13d7927692eab2d6a63e36166b72a8a + e99afb25a4fd5b08c5cd3060ae9c1d59 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub_llphysicsextensions-update/rev/298370/arch/Linux/installer/llphysicsextensions_stub-1.0.298370-linux-298370.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions/rev/313563/arch/Linux/installer/llphysicsextensions_stub-1.0.313563-linux-313563.tar.bz2 name linux @@ -1608,16 +1608,16 @@ archive hash - 9594f6fd79ee924fe675a4a23e30516e + 6f4307a35c692e44b872125d7932df8e url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions-stub_llphysicsextensions-update/rev/298370/arch/CYGWIN/installer/llphysicsextensions_stub-1.0.298370-windows-298370.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llphysicsextensions/rev/313563/arch/CYGWIN/installer/llphysicsextensions_stub-1.0.313563-windows-313563.tar.bz2 name windows version - 1.0.298370 + 1.0.313563 mesa diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 6a8959517d..282c859e9e 100755 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -1034,7 +1034,7 @@ all necessary level shifting, type conversion, rounding and truncation. */ val = (kdu_int32)(sp->fval*scale16); val = (val+128)>>8; // May be faster than true rounding val += 128; - if (val & ((-1)<<8)) + if (val & ((0xffffffffU)<<8)) { val = (val < 0 ? 0 : 255); } @@ -1052,7 +1052,7 @@ all necessary level shifting, type conversion, rounding and truncation. */ val = sp->ival; val = (val+offset)>>downshift; val += 128; - if (val & ((-1)<<8)) + if (val & ((0xffffffffU)<<8)) { val = (val < 0 ? 0 : 255); } @@ -1075,7 +1075,7 @@ all necessary level shifting, type conversion, rounding and truncation. */ val += (1<<(KDU_FIX_POINT-8))>>1; val >>= (KDU_FIX_POINT-8); val += 128; - if (val & ((-1)<<8)) + if (val & ((0xffffffffU)<<8)) { val = (val < 0 ? 0 : 255); } @@ -1094,7 +1094,7 @@ all necessary level shifting, type conversion, rounding and truncation. */ val = (val+offset)>>downshift; val <<= upshift; val += 128; - if (val & ((-1)<<8)) + if (val & ((0xffffffffU)<<8)) { val = (val < 0 ? 0 : 256 - (1<ival; val = (val+offset)>>downshift; val += 128; - if (val & ((-1)<<8)) + if (val & ((0xffffffffU)<<8)) { val = (val < 0 ? 0 : 255); } @@ -1132,7 +1132,7 @@ all necessary level shifting, type conversion, rounding and truncation. */ val = sp->ival; val <<= upshift; val += 128; - if (val & ((-1)<<8)) + if (val & ((0xffffffffU)<<8)) { val = (val < 0 ? 0 : 256 - (1< Date: Fri, 6 May 2016 09:19:12 -0400 Subject: fix cmake warning by conditionalizing dependency that does not exist on Macs --- indra/newview/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index bb745bcb43..b6cb96b11e 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2170,7 +2170,10 @@ if (PACKAGE) VERBATIM) add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") - add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") + add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}") + if (WINDOWS OR LINUX) + add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}") + endif (WINDOWS OR LINUX) add_dependencies(llpackage generate_breakpad_symbols) endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) endif (PACKAGE) -- cgit v1.2.3