From 87763d964a95bc918e26ae35932a99d56961f159 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 21 Aug 2018 19:26:07 -0400 Subject: MAINT-8917: For BugSplat viewer, don't create dump-UUID directory. Just put the static_debug_info.log file in the parent logs directory. Also update that static_debug_info.log file with "FatalMessage" key taken from LL_ERRS() message string. --- indra/newview/llappviewer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 687b76c224..3e25b395c4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -781,12 +781,18 @@ bool LLAppViewer::init() initMaxHeapSize() ; LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize")); +#if LL_BUGSPLAT + // MAINT-8917: don't create a dump directory just for the + // static_debug_info.log file + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); +#else // ! LL_BUGSPLAT // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); +#endif // ! LL_BUGSPLAT mDumpPath = logdir; setMiniDumpDir(logdir); logdir += gDirUtilp->getDirDelimiter(); - setDebugFileNames(logdir); + setDebugFileNames(logdir); // Although initLoggingAndGetLastDuration() is the right place to mess with @@ -2172,6 +2178,12 @@ void errorCallback(const std::string &error_string) //Set the ErrorActivated global so we know to create a marker file gLLErrorActivated = true; + gDebugInfo["FatalMessage"] = error_string; + // We're not already crashing -- we simply *intend* to crash. Since we + // haven't actually trashed anything yet, we can afford to write the whole + // static info file. + LLAppViewer::instance()->writeDebugInfo(); + LLError::crashAndLoop(error_string); } -- cgit v1.2.3 From 8d4e6b6df0d21e18a24c8e1d9f6008c2092a24c5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 22 Aug 2018 16:16:26 -0400 Subject: DRTVWR-447: Additional logging getting metadata for previous run --- indra/newview/llappviewer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3e25b395c4..d324a82bf8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3051,14 +3051,11 @@ void LLAppViewer::writeDebugInfo(bool isStatic) ? getStaticDebugFile() : getDynamicDebugFile() ); - LL_INFOS() << "Opening debug file " << *debug_filename << LL_ENDL; - llofstream out_file(debug_filename->c_str()); + LL_INFOS() << "Writing debug file " << *debug_filename << LL_ENDL; + llofstream out_file(debug_filename->c_str()); isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) : LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file); - - - out_file.close(); } LLSD LLAppViewer::getViewerInfo() const -- cgit v1.2.3 From e674f11757ab55c5ca7aab4cb1c8e059fa98f466 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 23 Aug 2018 12:31:54 -0400 Subject: DRTVWR-447: Add (some) metadata to Mac crash reports. This required reordering certain operations during Mac viewer startup. Split llappviewermacosx.cpp's initViewer() function into constructViewer() (which instantiates LLAppViewerMacOSX) and initViewer() (which calls LLAppViewerMacOSX::init()). llappdelegate-objc.mm's applicationDidFinishLaunching override now calls [BugsplatStartupManager start] between constructViewer() and initViewer(): we want constructViewer() to have set up the logging subsystem so we can log the actions of BugsplatStartupManagerDelegate override methods, but otherwise we want BugsplatStartupManager in place as early as possible to catch any early crashes. Besides, initViewer() ends up overwriting the static_debug_info.log on which we depend for the *previous* run's crash metadata. Move the code that initializes the pathname of the static_debug_info.log file from LLAppViewerMacOSX::init() to the LLAppViewerMacOSX() constructor, since BugsplatStartupManagerDelegate override methods need to read (the previous run's) file. Add code to applicationLogForBugsplatStartupManager override to set new BugsplatMac 1.0.6 properties userName and userEmail. Don't log empty fields from static_debug_info.log if we couldn't read it. --- indra/newview/llappviewer.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d324a82bf8..846b937a4e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -707,6 +707,22 @@ LLAppViewer::LLAppViewer() // LLLoginInstance::instance().setPlatformInfo(gPlatform, LLOSInfo::instance().getOSVersionString(), LLOSInfo::instance().getOSStringSimple()); + + // Under some circumstances we want to read the static_debug_info.log file + // from the previous viewer run between this constructor call and the + // init() call, which will overwrite the static_debug_info.log file for + // THIS run. So setDebugFileNames() early. +#if LL_BUGSPLAT + // MAINT-8917: don't create a dump directory just for the + // static_debug_info.log file + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); +#else // ! LL_BUGSPLAT + // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); +#endif // ! LL_BUGSPLAT + mDumpPath = logdir; + setMiniDumpDir(logdir); + setDebugFileNames(logdir); } LLAppViewer::~LLAppViewer() @@ -781,19 +797,6 @@ bool LLAppViewer::init() initMaxHeapSize() ; LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize")); -#if LL_BUGSPLAT - // MAINT-8917: don't create a dump directory just for the - // static_debug_info.log file - std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); -#else // ! LL_BUGSPLAT - // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. - std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); -#endif // ! LL_BUGSPLAT - mDumpPath = logdir; - setMiniDumpDir(logdir); - logdir += gDirUtilp->getDirDelimiter(); - setDebugFileNames(logdir); - // Although initLoggingAndGetLastDuration() is the right place to mess with // setFatalFunction(), we can't query gSavedSettings until after -- cgit v1.2.3 From e3d16dcb70da26c7952b45252b74716b1a632b97 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 11 Sep 2018 19:57:42 -0400 Subject: DRTVWR-474: Remove nag about SL_Launcher. --- indra/newview/llappviewer.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 687b76c224..dd1d4cea39 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1083,26 +1083,6 @@ bool LLAppViewer::init() } } -// don't nag developers who need to run the executable directly -#if LL_RELEASE_FOR_DOWNLOAD - // MAINT-8305: If we're processing a SLURL, skip the launcher check. - if (gSavedSettings.getString("CmdLineLoginLocation").empty()) - { - const char* PARENT = getenv("PARENT"); - if (! (PARENT && std::string(PARENT) == "SL_Launcher")) - { - // Don't directly run this executable. Please run the launcher, which - // will run the viewer itself. - // Naturally we do not consider this bulletproof. The point is to - // gently remind a user who *inadvertently* finds him/herself in this - // situation to do things the Right Way. Anyone who intentionally - // bypasses this mechanism needs no reminder that s/he's shooting - // him/herself in the foot. - LLNotificationsUtil::add("RunLauncher"); - } - } -#endif - #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) { -- cgit v1.2.3 From a6e2201d2cff8fe03c83a75a2766d1ab71d35a21 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:24:53 -0400 Subject: DRTVWR-474: Run the new updater in LEAP mode. --- indra/newview/llappviewer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dd1d4cea39..68bb20386a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,6 +1130,21 @@ bool LLAppViewer::init() gGLActive = FALSE; +#if LL_WINDOWS + std::string updater( + "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") + "\""); +#elif LL_DARWIN + std::string updater( + "python \"" + gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") + "\""); +#else + std::string updater( + "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") + "\""); +#endif + + // Run the updater, specifying LEAP mode. An exception from the updater + // should bother us. + LLLeap::create("updater process", (updater + " leap"), true); + // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand")); -- cgit v1.2.3 From 807992adca4708bd2050b1fee8074d3e4521dd30 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 20:55:05 -0400 Subject: DRTVWR-474: Pass updater cmd to LLLeap::create() as vector. This avoids having to tokenize a single string, avoiding swallowing backslashes in Windows pathnames in the mistaken belief they're escape characters. Alternatively, it avoids us having to double-escape them or convert them to forward slashes or whatever. --- indra/newview/llappviewer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 68bb20386a..c0fcdd7c79 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1131,19 +1131,21 @@ bool LLAppViewer::init() gGLActive = FALSE; #if LL_WINDOWS - std::string updater( - "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") + "\""); + std::vector updater + { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; #elif LL_DARWIN - std::string updater( - "python \"" + gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") + "\""); + // explicitly run the system Python interpreter on updater.py + std::vector updater + { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; #else - std::string updater( - "\"" + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") + "\""); + std::vector updater + { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; #endif + // add LEAP mode command-line argument to whichever of these we selected + updater.push_back("leap"); - // Run the updater, specifying LEAP mode. An exception from the updater - // should bother us. - LLLeap::create("updater process", (updater + " leap"), true); + // Run the updater. An exception from the updater should bother us. + LLLeap::create("updater process", updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. -- cgit v1.2.3 From 182a091ad961fb296aafc974509746a4dff54421 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 27 Sep 2018 17:41:26 -0400 Subject: DRTVWR-474: Pass the leap updater the parameters it requires. --- indra/newview/llappviewer.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5a374755f7..776fc85a2d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,21 +1130,29 @@ bool LLAppViewer::init() gGLActive = FALSE; -#if LL_WINDOWS std::vector updater +#if LL_WINDOWS { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; #elif LL_DARWIN // explicitly run the system Python interpreter on updater.py - std::vector updater { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; #else - std::vector updater { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; #endif // add LEAP mode command-line argument to whichever of these we selected updater.push_back("leap"); - - // Run the updater. An exception from the updater should bother us. + // UpdaterServiceSettings + updater.push_back(stringize(gSavedSettings.getU32("UpdaterServiceSetting"))); + // channel + updater.push_back(LLVersionInfo::getChannel()); + // testok + updater.push_back(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); + // UpdaterServiceURL + updater.push_back(gSavedSettings.getString("UpdaterServiceURL")); + // ForceAddressSize + updater.push_back(stringize(gSavedSettings.getU32("ForceAddressSize"))); + + // Run the updater. An exception from launching the updater should bother us. LLLeap::create("updater process", updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if -- cgit v1.2.3 From b1955d4247a4d28a3a4c259036390ff632e80008 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 3 Oct 2018 14:00:05 -0400 Subject: DRTVWR-474: Do NOT autokill updater process on viewer termination. The updater is required to survive beyond termination of the viewer that launched it so it can launch the next installer, or a replacement viewer. Having the old viewer forcibly terminate it on shutdown would be counter- productive. Introduce a third LLLeap::create() overload taking LLProcess::Params, which gives access to autokill, cwd and other options previously unsupported by LLLeap. Reimplement the existing create() overloads in terms of this new one, since LLLeapImpl::LLLeapImpl() is already based on LLProcess::Params anyway. Use LLProcess::Params in LLAppViewer::init() to specify the updater process, setting autokill=false. Refactoring LLLeapImpl() apparently involved engaging an LLInitParam::Block feature never before used: had to drag operator() into Multiple from its base class TypedParam (as has been done in other TypedParam subclasses). --- indra/newview/llappviewer.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 776fc85a2d..bc4ce19f77 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1130,30 +1130,35 @@ bool LLAppViewer::init() gGLActive = FALSE; - std::vector updater + LLProcess::Params updater; + updater.desc = "updater process"; + // Because it's the updater, it MUST persist beyond the lifespan of the + // viewer itself. + updater.autokill = false; #if LL_WINDOWS - { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe") }; + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe"); #elif LL_DARWIN // explicitly run the system Python interpreter on updater.py - { "python", gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py") }; + updater.executable = "python"; + updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py")); #else - { gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater") }; + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater"); #endif // add LEAP mode command-line argument to whichever of these we selected - updater.push_back("leap"); + updater.args.add("leap"); // UpdaterServiceSettings - updater.push_back(stringize(gSavedSettings.getU32("UpdaterServiceSetting"))); + updater.args.add(stringize(gSavedSettings.getU32("UpdaterServiceSetting"))); // channel - updater.push_back(LLVersionInfo::getChannel()); + updater.args.add(LLVersionInfo::getChannel()); // testok - updater.push_back(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); + updater.args.add(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); // UpdaterServiceURL - updater.push_back(gSavedSettings.getString("UpdaterServiceURL")); + updater.args.add(gSavedSettings.getString("UpdaterServiceURL")); // ForceAddressSize - updater.push_back(stringize(gSavedSettings.getU32("ForceAddressSize"))); + updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); // Run the updater. An exception from launching the updater should bother us. - LLLeap::create("updater process", updater, true); + LLLeap::create(updater, true); // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. @@ -3923,12 +3928,6 @@ void LLAppViewer::requestQuit() gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent. } - // Try to send last batch of avatar rez metrics. - if (!gDisconnected && isAgentAvatarValid()) - { - gAgentAvatarp->updateAvatarRezMetrics(true); // force a last packet to be sent. - } - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); -- cgit v1.2.3 From d87cc1859f3f96b98a627fdc674e297e78438681 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 11 Oct 2018 14:17:52 -0400 Subject: Modify logging so that the in-viewer console and stderr do not escape line breaks Improve the implementation so that escaping is computed only once --- indra/newview/llappviewer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dd82aa735f..b3f09a73a2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -885,11 +885,6 @@ bool LLAppViewer::init() mNumSessions++; gSavedSettings.setS32("NumSessions", mNumSessions); - if (gSavedSettings.getBOOL("VerboseLogs")) - { - LLError::setPrintLocation(true); - } - // LLKeyboard relies on LLUI to know what some accelerator keys are called. LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString ); @@ -1702,7 +1697,7 @@ bool LLAppViewer::cleanup() release_start_screen(); // just in case - LLError::logToFixedBuffer(NULL); + LLError::logToFixedBuffer(NULL); // stop the fixed buffer recorder LL_INFOS() << "Cleaning Up" << LL_ENDL; -- cgit v1.2.3 From 0ca69bb2ebf206705045a72b004e302af1f6d5dd Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 27 Oct 2018 15:24:24 -0400 Subject: DRTVWR-447: Stop passing UpdaterServiceURL to leap updater. In fact, mark UpdaterServiceURL as obsolete. (Consumers should consult build_data.json.) --- indra/newview/llappviewer.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e527b70b0e..bda76c14d1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1156,8 +1156,6 @@ bool LLAppViewer::init() updater.args.add(LLVersionInfo::getChannel()); // testok updater.args.add(stringize(gSavedSettings.getBOOL("UpdaterWillingToTest"))); - // UpdaterServiceURL - updater.args.add(gSavedSettings.getString("UpdaterServiceURL")); // ForceAddressSize updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); -- cgit v1.2.3 From cb5c5bb6ee2705791717ea319a415728d9c06eee Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 7 Nov 2018 15:57:20 -0800 Subject: SL-9952: updater.exe now renamed to SLVersionChecker.exe thereby avoiding strange Windows requirement for elevated privilege. --- indra/newview/llappviewer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bda76c14d1..d3577d50a1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1140,13 +1140,13 @@ bool LLAppViewer::init() // viewer itself. updater.autokill = false; #if LL_WINDOWS - updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater.exe"); + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker.exe"); #elif LL_DARWIN - // explicitly run the system Python interpreter on updater.py + // explicitly run the system Python interpreter on SLVersionChecker.py updater.executable = "python"; - updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "updater.py")); + updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "SLVersionChecker.py")); #else - updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "updater"); + updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker"); #endif // add LEAP mode command-line argument to whichever of these we selected updater.args.add("leap"); -- cgit v1.2.3