From 4ba1ea1a651a5ecd11750090b7967356fa0b32d3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 15 Jan 2021 00:35:20 +0200 Subject: SL-14283 Don't crash viewer, only show a notification --- indra/newview/llappviewer.cpp | 62 +++++++++++++++++++++++------------------ indra/newview/llappviewer.h | 2 ++ indra/newview/llviewerstats.cpp | 1 + 3 files changed, 38 insertions(+), 27 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d60c32755d..f518704e06 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -679,6 +679,7 @@ LLAppViewer::LLAppViewer() mPurgeCacheOnExit(false), mPurgeUserDataOnExit(false), mSecondInstance(false), + mUpdaterNotFound(false), mSavedFinalSnapshot(false), mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. mQuitRequested(false), @@ -1163,7 +1164,7 @@ bool LLAppViewer::init() gGLActive = FALSE; -#if LL_RELEASE_FOR_DOWNLOAD +#if LL_RELEASE_FOR_DOWNLOAD if (!gSavedSettings.getBOOL("CmdLineSkipUpdater")) { LLProcess::Params updater; @@ -1199,6 +1200,7 @@ bool LLAppViewer::init() { // Run the updater. An exception from launching the updater should bother us. LLLeap::create(updater, true); + mUpdaterNotFound = false; } catch (...) { @@ -1208,8 +1210,7 @@ bool LLAppViewer::init() details.getString(), LLStringUtil::null, OSMB_OK); - // pass this exception to crash handler - throw; + mUpdaterNotFound = true; } } else @@ -1217,29 +1218,36 @@ bool LLAppViewer::init() LL_WARNS("InitInfo") << "Skipping updater check." << LL_ENDL; } - // 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")); - LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL; - if (LeapCommand.isDefined() && ! LeapCommand.isArray()) - { - // If LeapCommand is actually a scalar value, make an array of it. - // Have to do it in two steps because LeapCommand.append(LeapCommand) - // trashes content! :-P - LLSD item(LeapCommand); - LeapCommand.append(item); - } - BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) - { - LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL; - // We don't have any better description of this plugin than the - // user-specified command line. Passing "" causes LLLeap to derive a - // description from the command line itself. - // Suppress LLLeap::Error exception: trust LLLeap's own logging. We - // don't consider any one --leap command mission-critical, so if one - // fails, log it, shrug and carry on. - LLLeap::create("", leap, false); // exception=false - } + if (mUpdaterNotFound) + { + LL_WARNS("InitInfo") << "Failed to launch updater. Skipping Leap commands." << LL_ENDL; + } + else + { + // 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")); + LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL; + if (LeapCommand.isDefined() && !LeapCommand.isArray()) + { + // If LeapCommand is actually a scalar value, make an array of it. + // Have to do it in two steps because LeapCommand.append(LeapCommand) + // trashes content! :-P + LLSD item(LeapCommand); + LeapCommand.append(item); + } + BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) + { + LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL; + // We don't have any better description of this plugin than the + // user-specified command line. Passing "" causes LLLeap to derive a + // description from the command line itself. + // Suppress LLLeap::Error exception: trust LLLeap's own logging. We + // don't consider any one --leap command mission-critical, so if one + // fails, log it, shrug and carry on. + LLLeap::create("", leap, false); // exception=false + } + } if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0) { @@ -1247,7 +1255,7 @@ bool LLAppViewer::init() << "lleventhost no longer supported as a dynamic library" << LL_ENDL; } -#endif +#endif //LL_RELEASE_FOR_DOWNLOAD LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index eaebc896d0..5332fe2deb 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -95,6 +95,7 @@ public: bool quitRequested() { return mQuitRequested; } bool logoutRequestSent() { return mLogoutRequestSent; } bool isSecondInstance() { return mSecondInstance; } + bool isUpdaterMissing() { return mUpdaterNotFound; } void writeDebugInfo(bool isStatic=true); @@ -264,6 +265,7 @@ private: static LLAppViewer* sInstance; bool mSecondInstance; // Is this a second instance of the app? + bool mUpdaterNotFound; // True when attempt to start updater failed std::string mMarkerFileName; LLAPRFile mMarkerFile; // A file created to indicate the app is running. diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 7533c0c789..05f88b0a75 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -575,6 +575,7 @@ void send_viewer_stats(bool include_preferences) fail["failed_resends"] = (S32) gMessageSystem->mFailedResendPackets; fail["off_circuit"] = (S32) gMessageSystem->mOffCircuitPackets; fail["invalid"] = (S32) gMessageSystem->mInvalidOnCircuitPackets; + fail["missing_updater"] = (S32) LLAppViewer::instance()->isUpdaterMissing(); body["stats"]["voice"] = LLVoiceVivoxStats::getInstance()->read(); -- cgit v1.2.3