From 3b3c85d1f378fdc83c7f613d5ee269b5db0db125 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Sat, 13 Sep 2025 00:06:47 +0300 Subject: #4651 Try distinguishing freezes from crashes --- indra/newview/llappviewerwin32.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llappviewerwin32.cpp') diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 8477bd3044..c29c9a4919 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -172,6 +172,18 @@ namespace << '/' << loc.mV[1] << '/' << loc.mV[2]))); } + + if (!LLAppViewer::instance()->isSecondInstance()) + { + std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); + if (!LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) + { + // If marker doesn't exist, create a marker with 'other' code for next launch + // otherwise don't override existing file + // Any unmarked crashes will be considered as freezes + LLAppViewer::instance()->createErrorMarker(LAST_EXEC_OTHER_CRASH); + } + } } // MDSCB_EXCEPTIONCODE return false; -- cgit v1.3 From 892fb2d6e2ffc92636f381d3e817f9c5a71657dc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 16 Sep 2025 19:44:45 +0300 Subject: #4651 Fix marker presence check --- indra/newview/llappviewer.cpp | 6 ++++++ indra/newview/llappviewer.h | 1 + indra/newview/llappviewerwin32.cpp | 15 ++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'indra/newview/llappviewerwin32.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 253c1268d3..62a1aa9fb6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5403,6 +5403,12 @@ void LLAppViewer::createErrorMarker(eLastExecEvent error_code) const } } +bool LLAppViewer::errorMarkerExists() const +{ + std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); + return LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB); +} + void LLAppViewer::outOfMemorySoftQuit() { if (!mQuitRequested) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 24d55a00fe..fdaa14a77d 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -250,6 +250,7 @@ public: // Writes an error code into the error_marker file for use on next startup. void createErrorMarker(eLastExecEvent error_code) const; + bool errorMarkerExists() const; // Attempt a 'soft' quit with disconnect and saving of settings/cache. // Intended to be thread safe. diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index c29c9a4919..929cb8b4d5 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -173,16 +173,13 @@ namespace << '/' << loc.mV[2]))); } - if (!LLAppViewer::instance()->isSecondInstance()) + LLAppViewer* app = LLAppViewer::instance(); + if (!app->isSecondInstance() && !app->errorMarkerExists()) { - std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if (!LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) - { - // If marker doesn't exist, create a marker with 'other' code for next launch - // otherwise don't override existing file - // Any unmarked crashes will be considered as freezes - LLAppViewer::instance()->createErrorMarker(LAST_EXEC_OTHER_CRASH); - } + // If marker doesn't exist, create a marker with 'other' code for next launch + // otherwise don't override existing file + // Any unmarked crashes will be considered as freezes + app->createErrorMarker(LAST_EXEC_OTHER_CRASH); } } // MDSCB_EXCEPTIONCODE -- cgit v1.3 From 7991ae892ef0f717636c0fe3c0eff0a5f92e6bb8 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 2 Dec 2025 00:44:56 +0200 Subject: #5084 Ressurect Watchdog --- indra/newview/app_settings/settings.xml | 19 +++++++++++---- indra/newview/llappviewer.cpp | 42 ++++++++++++++++++--------------- indra/newview/llappviewer.h | 8 ++++--- indra/newview/llappviewerwin32.cpp | 11 +++++++-- indra/newview/llwatchdog.cpp | 12 +++++++++- 5 files changed, 63 insertions(+), 29 deletions(-) (limited to 'indra/newview/llappviewerwin32.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3dbb5dca1f..fe31a00ba3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4484,13 +4484,24 @@ MainloopTimeoutDefault Comment - Timeout duration for mainloop lock detection, in seconds. + Timeout duration for mainloop lock detection during teleports, login and logout, in seconds. Persist 1 Type F32 Value - 60.0 + 120.0 + + MainloopTimeoutStarted + + Comment + Timeout duration for mainloop lock detection when logged in and not teleporting, in seconds. + Persist + 1 + Type + F32 + Value + 30.0 MapScale @@ -13862,13 +13873,13 @@ WatchdogEnabled Comment - Controls whether the thread watchdog timer is activated. Value is boolean. Set to -1 to defer to built-in default. + Controls whether the thread watchdog timer is activated. Value is S32. Set to -1 to defer to built-in default. Persist 0 Type S32 Value - 0 + 1 WaterGLFogDensityScale diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 72bfdcf83c..f6f5f1717b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3145,7 +3145,7 @@ bool LLAppViewer::initWindow() // Need to load feature table before cheking to start watchdog. bool use_watchdog = false; - int watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled"); + S32 watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled"); if (watchdog_enabled_setting == -1) { use_watchdog = !LLFeatureManager::getInstance()->isFeatureAvailable("WatchdogDisabled"); @@ -5820,12 +5820,12 @@ void LLAppViewer::forceExceptionThreadCrash() thread->start(); } -void LLAppViewer::initMainloopTimeout(std::string_view state, F32 secs) +void LLAppViewer::initMainloopTimeout(std::string_view state) { if (!mMainloopTimeout) { mMainloopTimeout = new LLWatchdogTimeout(); - resumeMainloopTimeout(state, secs); + resumeMainloopTimeout(state); } } @@ -5838,17 +5838,11 @@ void LLAppViewer::destroyMainloopTimeout() } } -void LLAppViewer::resumeMainloopTimeout(std::string_view state, F32 secs) +void LLAppViewer::resumeMainloopTimeout(std::string_view state) { if (mMainloopTimeout) { - if (secs < 0.0f) - { - static LLCachedControl mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60.f); - secs = mainloop_timeout; - } - - mMainloopTimeout->setTimeout(secs); + mMainloopTimeout->setTimeout(getMainloopTimeoutSec()); mMainloopTimeout->start(state); } } @@ -5861,23 +5855,33 @@ void LLAppViewer::pauseMainloopTimeout() } } -void LLAppViewer::pingMainloopTimeout(std::string_view state, F32 secs) +void LLAppViewer::pingMainloopTimeout(std::string_view state) { LL_PROFILE_ZONE_SCOPED_CATEGORY_APP; if (mMainloopTimeout) { - if (secs < 0.0f) - { - static LLCachedControl mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60); - secs = mainloop_timeout; - } - - mMainloopTimeout->setTimeout(secs); + mMainloopTimeout->setTimeout(getMainloopTimeoutSec()); mMainloopTimeout->ping(state); } } + +F32 LLAppViewer::getMainloopTimeoutSec() const +{ + if (LLStartUp::getStartupState() == STATE_STARTED + && gAgent.getTeleportState() == LLAgent::TELEPORT_NONE) + { + static LLCachedControl mainloop_started(gSavedSettings, "MainloopTimeoutStarted", 30.f); + return mainloop_started(); + } + else + { + static LLCachedControl mainloop_default(gSavedSettings, "MainloopTimeoutDefault", 120.f); + return mainloop_default(); + } +} + void LLAppViewer::handleLoginComplete() { gLoggedInTime.start(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index c12b2e83ef..61c206bcec 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -204,11 +204,13 @@ public: // For thread debugging. // llstartup needs to control init. // llworld, send_agent_pause() also controls pause/resume. - void initMainloopTimeout(std::string_view state, F32 secs = -1.0f); + void initMainloopTimeout(std::string_view state); void destroyMainloopTimeout(); void pauseMainloopTimeout(); - void resumeMainloopTimeout(std::string_view state = "", F32 secs = -1.0f); - void pingMainloopTimeout(std::string_view state, F32 secs = -1.0f); + void resumeMainloopTimeout(std::string_view state = ""); + void pingMainloopTimeout(std::string_view state); + + F32 getMainloopTimeoutSec() const; // Handle the 'login completed' event. // *NOTE:Mani Fix this for login abstraction!! diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index a951338138..0620b625d9 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -176,10 +176,17 @@ namespace LLAppViewer* app = LLAppViewer::instance(); if (!app->isSecondInstance() && !app->errorMarkerExists()) { - // If marker doesn't exist, create a marker with 'other' code for next launch + // If marker doesn't exist, create a marker with 'other' or 'logout' code for next launch // otherwise don't override existing file // Any unmarked crashes will be considered as freezes - app->createErrorMarker(LAST_EXEC_OTHER_CRASH); + if (app->logoutRequestSent()) + { + app->createErrorMarker(LAST_EXEC_LOGOUT_CRASH); + } + else + { + app->createErrorMarker(LAST_EXEC_OTHER_CRASH); + } } } // MDSCB_EXCEPTIONCODE diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp index bf171fe954..614d1afc2a 100644 --- a/indra/newview/llwatchdog.cpp +++ b/indra/newview/llwatchdog.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "llwatchdog.h" #include "llthread.h" +#include "llappviewer.h" constexpr U32 WATCHDOG_SLEEP_TIME_USEC = 1000000U; @@ -240,7 +241,16 @@ void LLWatchdog::run() { mTimer->stop(); } - + if (LLAppViewer::instance()->logoutRequestSent()) + { + LLAppViewer::instance()->createErrorMarker(LAST_EXEC_LOGOUT_FROZE); + } + else + { + LLAppViewer::instance()->createErrorMarker(LAST_EXEC_FROZE); + } + // Todo1: warn user? + // Todo2: We probably want to report even if 5 seconds passed, just not error 'yet'. LL_ERRS() << "Watchdog timer expired; assuming viewer is hung and crashing" << LL_ENDL; } } -- cgit v1.3