From 50f9f18427a74e0bdc535df31bc7a0edbb381c1f Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 10 Feb 2023 19:02:42 +0200 Subject: [PATCH 01/10] SL-19194 update slurl handling (#74) --- indra/newview/llslurl.cpp | 9 ++++++++- indra/newview/llviewerhelp.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index a8e012bfa1..a3a8247268 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -172,11 +172,18 @@ LLSLURL::LLSLURL(const std::string& slurl) } else { - // it wasn't a /secondlife/ or /app/, so it must be secondlife:// + if(slurl_uri.hostName() == LLSLURL::SLURL_APP_PATH) + { + mType = APP; + } + else + { + // it wasn't a /secondlife/ or /app/, so it must be secondlife:// // therefore the hostname will be the region name, and it's a location type mType = LOCATION; // 'normalize' it so the region name is in fact the head of the path_array path_array.insert(0, slurl_uri.hostName()); + } } } else if((slurl_uri.scheme() == LLSLURL::SLURL_HTTP_SCHEME) || diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 04c2e27c9d..3273090da5 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -43,7 +43,7 @@ class LLHelpHandler : public LLCommandHandler { public: // requests will be throttled from a non-trusted browser - LLHelpHandler() : LLCommandHandler("help", UNTRUSTED_THROTTLE) {} + LLHelpHandler() : LLCommandHandler("help", UNTRUSTED_CLICK_ONLY) {} bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web) { From d998bcbfb54bf5d129f6b88136729a2e2a23c19f Mon Sep 17 00:00:00 2001 From: Henri Beauchamp Date: Mon, 13 Feb 2023 18:34:00 +0100 Subject: [PATCH 02/10] SL-19110 revert LLUUID::combine() to old algorithm to match server code. (#75) As it happens, the change in the LLUUID::combine() algorithm introduced by one of my previous commits is causing invalid assets creation (seen with some clothing items, such as Shape and Universal types); obviously, the server is using the old algorithm for UUID validation purpose of these assets. This commit reverts LLUUID::combine() code to use LLMD5. --- indra/llcommon/lluuid.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 47c6bc71c8..fc04dca08d 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -44,6 +44,7 @@ #include "lltimer.h" #include "llthread.h" #include "llmutex.h" +#include "llmd5.h" #include "hbxxh.h" const LLUUID LLUUID::null; @@ -400,11 +401,16 @@ LLUUID LLUUID::operator^(const LLUUID& rhs) const return id; } +// WARNING: this algorithm SHALL NOT be changed. It is also used by the server +// and plays a role in some assets validation (e.g. clothing items). Changing +// it would cause invalid assets. void LLUUID::combine(const LLUUID& other, LLUUID& result) const { - HBXXH128 hash((const void*)mData, 16, false); // false = do not finalize - hash.update((const void*)other.mData, 16); - hash.digest(result); + LLMD5 md5_uuid; + md5_uuid.update((unsigned char*)mData, 16); + md5_uuid.update((unsigned char*)other.mData, 16); + md5_uuid.finalize(); + md5_uuid.raw_digest(result.mData); } LLUUID LLUUID::combine(const LLUUID &other) const From 8032b2d72e9c38f11f8f3c177873b96104d433eb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 17 Feb 2023 00:49:32 +0200 Subject: [PATCH 03/10] SL-19204 Crash at removeObserver A lot of reports about crashes in voice's removeObserver with no indication of the cause, all MAC specific. By this point terminate should have been called and mVoiceModule should be null, yet callstaks suggest it isn't. Commit clears LLVoiceClient beforehand to avoid the issue entirely, but issue lies elsewhere and 'voice' crash is just a symptom. --- indra/newview/llappviewer.cpp | 1 + indra/newview/llpanelpeople.cpp | 5 ++++- indra/newview/llvoiceclient.cpp | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dc9f7bb403..767e522273 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2164,6 +2164,7 @@ bool LLAppViewer::cleanup() LLSelectMgr::deleteSingleton(); LLViewerEventRecorder::deleteSingleton(); LLWorld::deleteSingleton(); + LLVoiceClient::deleteSingleton(); // It's not at first obvious where, in this long sequence, a generic cleanup // call OUGHT to go. So let's say this: as we migrate cleanup from diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e424d6b5f5..13b52e97c5 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -346,7 +346,10 @@ public: { // will be deleted by ~LLInventoryModel //delete mInvObserver; - LLVoiceClient::getInstance()->removeObserver(this); + if (LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->removeObserver(this); + } LLAvatarTracker::instance().removeObserver(this); } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 6bb987ede4..150b556284 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -142,6 +142,7 @@ LLVoiceClient::LLVoiceClient(LLPumpIO *pump) LLVoiceClient::~LLVoiceClient() { + llassert(!mVoiceModule); } void LLVoiceClient::init(LLPumpIO *pump) From 375d01e17aae74f7e2d8bc21a976b11964e8ce59 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 17 Feb 2023 02:31:35 +0200 Subject: [PATCH 04/10] SL-18735 Fix scroll not following item for long enough --- indra/llui/llfolderview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 503a18f50d..62c311f522 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1798,14 +1798,14 @@ void LLFolderView::update() LLFolderViewItem* scroll_to_item = mSelectedItems.back(); scrollToShowItem(scroll_to_item, constraint_rect); // continue scrolling until animated layout change is done - bool selected_filter_finished = true; - if (scroll_to_item && scroll_to_item->getViewModelItem()) + bool selected_filter_finished = getRoot()->getViewModelItem()->getLastFilterGeneration() >= filter_object.getFirstSuccessGeneration(); + if (selected_filter_finished && scroll_to_item && scroll_to_item->getViewModelItem()) { selected_filter_finished = scroll_to_item->getViewModelItem()->getLastFilterGeneration() >= filter_object.getFirstSuccessGeneration(); } if (filter_finished && selected_filter_finished) { - bool needs_arrange = needsArrange(); + bool needs_arrange = needsArrange() || getRoot()->needsArrange(); if (mParentFolder) { needs_arrange |= (bool)mParentFolder->needsArrange(); From 2c3765009d2321880f1a6df781d76229f3ff6c5a Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 22 Feb 2023 01:21:24 +0200 Subject: [PATCH 05/10] SL-19245 Layout fix for the Chat tab in Preferences --- .../newview/skins/default/xui/en/panel_preferences_chat.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 35bd736d77..f4181b2152 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -67,7 +67,7 @@ @@ -103,7 +103,7 @@ label="Bubble Chat" layout="topleft" top_pad="4" - left_delta="0" + left="340" name="bubble_text_chat" width="330"> From 99a23af61742785af35d521792cf8f4a59b62bfc Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 22 Feb 2023 01:31:30 +0200 Subject: [PATCH 06/10] SL-19244 Layout fix for the media type field in About Land --- indra/newview/skins/default/xui/en/floater_about_land.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 4985d07eb9..b1ed245378 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1606,7 +1606,7 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left_pad="-134" + left_pad="6" name="mime_type" width="200" /> Date: Fri, 3 Mar 2023 00:26:46 +0200 Subject: [PATCH 07/10] SL-19327 Disable crash reporting for Win7 (#102) Win7 is no longer supported and is below minimal requirements --- indra/newview/llappviewerwin32.cpp | 133 +++++++++++++++-------------- 1 file changed, 69 insertions(+), 64 deletions(-) diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index a39ec7f51b..0c764fe48a 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -620,76 +620,81 @@ bool LLAppViewerWin32::init() LLFile::remove(log_file, ENOENT); } - std::string build_data_fname( - gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); - // Use llifstream instead of std::ifstream because LL_PATH_EXECUTABLE - // could contain non-ASCII characters, which std::ifstream doesn't handle. - llifstream inf(build_data_fname.c_str()); - if (! inf.is_open()) - { - LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't read '" << build_data_fname - << "'" << LL_ENDL; - } - else - { - Json::Reader reader; - Json::Value build_data; - if (! reader.parse(inf, build_data, false)) // don't collect comments - { - // gah, the typo is baked into Json::Reader API - LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't parse '" << build_data_fname - << "': " << reader.getFormatedErrorMessages() << LL_ENDL; - } - else - { - Json::Value BugSplat_DB = build_data["BugSplat DB"]; - if (! BugSplat_DB) - { - LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" - << build_data_fname << "'" << LL_ENDL; - } - else - { - // Got BugSplat_DB, onward! - std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << - LL_VIEWER_VERSION_MINOR << '.' << - LL_VIEWER_VERSION_PATCH << '.' << - LL_VIEWER_VERSION_BUILD)); + // Win7 is no longer supported + bool is_win_7_or_below = LLOSInfo::getInstance()->mMajorVer <= 6 && LLOSInfo::getInstance()->mMajorVer <= 1; - DWORD dwFlags = MDSF_NONINTERACTIVE | // automatically submit report without prompting - MDSF_PREVENTHIJACKING; // disallow swiping Exception filter - - bool needs_log_file = !isSecondInstance() && debugLoggingEnabled("BUGSPLAT"); - if (needs_log_file) + if (!is_win_7_or_below) + { + std::string build_data_fname( + gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json")); + // Use llifstream instead of std::ifstream because LL_PATH_EXECUTABLE + // could contain non-ASCII characters, which std::ifstream doesn't handle. + llifstream inf(build_data_fname.c_str()); + if (!inf.is_open()) + { + LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't read '" << build_data_fname + << "'" << LL_ENDL; + } + else + { + Json::Reader reader; + Json::Value build_data; + if (!reader.parse(inf, build_data, false)) // don't collect comments + { + // gah, the typo is baked into Json::Reader API + LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't parse '" << build_data_fname + << "': " << reader.getFormatedErrorMessages() << LL_ENDL; + } + else + { + Json::Value BugSplat_DB = build_data["BugSplat DB"]; + if (!BugSplat_DB) { - // Startup only! - LL_INFOS("BUGSPLAT") << "Engaged BugSplat logging to bugsplat.log" << LL_ENDL; - dwFlags |= MDSF_LOGFILE | MDSF_LOG_VERBOSE; + LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" + << build_data_fname << "'" << LL_ENDL; } - - // have to convert normal wide strings to strings of __wchar_t - sBugSplatSender = new MiniDmpSender( - WCSTR(BugSplat_DB.asString()), - WCSTR(LL_TO_WSTRING(LL_VIEWER_CHANNEL)), - WCSTR(version_string), - nullptr, // szAppIdentifier -- set later - dwFlags); - sBugSplatSender->setCallback(bugsplatSendLog); - - if (needs_log_file) + else { - // Log file will be created in %TEMP%, but it will be moved into logs folder in case of crash - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "bugsplat.log"); - sBugSplatSender->setLogFilePath(WCSTR(log_file)); - } + // Got BugSplat_DB, onward! + std::wstring version_string(WSTRINGIZE(LL_VIEWER_VERSION_MAJOR << '.' << + LL_VIEWER_VERSION_MINOR << '.' << + LL_VIEWER_VERSION_PATCH << '.' << + LL_VIEWER_VERSION_BUILD)); - // engage stringize() overload that converts from wstring - LL_INFOS("BUGSPLAT") << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) - << ' ' << stringize(version_string) << ')' << LL_ENDL; - } // got BugSplat_DB - } // parsed build_data.json - } // opened build_data.json + DWORD dwFlags = MDSF_NONINTERACTIVE | // automatically submit report without prompting + MDSF_PREVENTHIJACKING; // disallow swiping Exception filter + bool needs_log_file = !isSecondInstance() && debugLoggingEnabled("BUGSPLAT"); + if (needs_log_file) + { + // Startup only! + LL_INFOS("BUGSPLAT") << "Engaged BugSplat logging to bugsplat.log" << LL_ENDL; + dwFlags |= MDSF_LOGFILE | MDSF_LOG_VERBOSE; + } + + // have to convert normal wide strings to strings of __wchar_t + sBugSplatSender = new MiniDmpSender( + WCSTR(BugSplat_DB.asString()), + WCSTR(LL_TO_WSTRING(LL_VIEWER_CHANNEL)), + WCSTR(version_string), + nullptr, // szAppIdentifier -- set later + dwFlags); + sBugSplatSender->setCallback(bugsplatSendLog); + + if (needs_log_file) + { + // Log file will be created in %TEMP%, but it will be moved into logs folder in case of crash + std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "bugsplat.log"); + sBugSplatSender->setLogFilePath(WCSTR(log_file)); + } + + // engage stringize() overload that converts from wstring + LL_INFOS("BUGSPLAT") << "Engaged BugSplat(" << LL_TO_STRING(LL_VIEWER_CHANNEL) + << ' ' << stringize(version_string) << ')' << LL_ENDL; + } // got BugSplat_DB + } // parsed build_data.json + } // opened build_data.json + } // !is_win_7_or_below #endif // LL_BUGSPLAT #endif // LL_SEND_CRASH_REPORTS From a546aa20b7a5256cb0cfcddff2f09c225c15c794 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 14 Feb 2023 22:49:50 +0200 Subject: [PATCH 08/10] SL-4126 Second Life messing up NVIDIA drivers Disable NvAPI by default --- indra/newview/app_settings/settings.xml | 11 ++++++ indra/newview/llappviewerwin32.cpp | 48 ++++++++++++++----------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3f6adfe13d..8e70dea36e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8341,6 +8341,17 @@ Value 1 + NvAPISessionOverride + + Comment + Override NvAPI driver setting for maxim performance (HACK!!!) + Persist + 1 + Type + Boolean + Value + 0 + PurgeCacheOnNextStartup Comment diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 0c764fe48a..b36c5a61a3 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -386,27 +386,35 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, LL_WARNS() << "Application init failed." << LL_ENDL; return -1; } - - NvAPI_Status status; - - // Initialize NVAPI - status = NvAPI_Initialize(); - NvDRSSessionHandle hSession = 0; - if (status == NVAPI_OK) - { - // Create the session handle to access driver settings - status = NvAPI_DRS_CreateSession(&hSession); - if (status != NVAPI_OK) - { - nvapi_error(status); - } - else - { - //override driver setting as needed - ll_nvapi_init(hSession); - } - } + NvDRSSessionHandle hSession = 0; + // Viewer shouldn't need NvAPI and this implementation alters global + // settings instead of viewer-only ones (SL-4126) + // TODO: ideally this should be removed, but temporary disabling + // it with a way to turn it back on in case of issues + static LLCachedControl use_nv_api(gSavedSettings, "NvAPISessionOverride", false); + if (use_nv_api) + { + NvAPI_Status status; + + // Initialize NVAPI + status = NvAPI_Initialize(); + + if (status == NVAPI_OK) + { + // Create the session handle to access driver settings + status = NvAPI_DRS_CreateSession(&hSession); + if (status != NVAPI_OK) + { + nvapi_error(status); + } + else + { + //override driver setting as needed + ll_nvapi_init(hSession); + } + } + } // Have to wait until after logging is initialized to display LFH info if (num_heaps > 0) From 22018af63cbdaefee1b062c1f5f8e4abe82e4e72 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 3 Mar 2023 23:04:06 +0200 Subject: [PATCH 09/10] SL-17584 Better logging for setShaders crashes --- indra/newview/llviewershadermgr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 1c9360a843..779837bcf0 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -35,6 +35,7 @@ #include "llrender.h" #include "llenvironment.h" +#include "llerrorcontrol.h" #include "llatmosphere.h" #include "llworld.h" #include "llsky.h" @@ -559,10 +560,15 @@ void LLViewerShaderMgr::setShaders() std::string shader_name = loadBasicShaders(); if (shader_name.empty()) { - LL_INFOS() << "Loaded basic shaders." << LL_ENDL; + LL_INFOS("Shader") << "Loaded basic shaders." << LL_ENDL; } else { + // "ShaderLoading" and "Shader" need to be logged + LLError::ELevel lvl = LLError::getDefaultLevel(); + LLError::setDefaultLevel(LLError::LEVEL_DEBUG); + loadBasicShaders(); + LLError::setDefaultLevel(lvl); LL_ERRS() << "Unable to load basic shader " << shader_name << ", verify graphics driver installed and current." << LL_ENDL; reentrance = false; // For hygiene only, re-try probably helps nothing return; From d611734c04857f1365220b9446a2e50a89080e0c Mon Sep 17 00:00:00 2001 From: akleshchev <117672381+akleshchev@users.noreply.github.com> Date: Sat, 4 Mar 2023 02:29:48 +0200 Subject: [PATCH 10/10] SL-15752 Reduce default graphical quality on machines with little memory (#105) --- indra/newview/llfeaturemanager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e934041e2e..042db597c4 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -490,6 +490,18 @@ bool LLFeatureManager::loadGPUClass() { mGPUClass = GPU_CLASS_5; } + + #if LL_WINDOWS + const F32Gigabytes MIN_PHYSICAL_MEMORY(2); + + LLMemory::updateMemoryInfo(); + F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); + if (MIN_PHYSICAL_MEMORY > physical_mem && mGPUClass > GPU_CLASS_1) + { + // reduce quality on systems that don't have enough memory + mGPUClass = (EGPUClass)(mGPUClass - 1); + } + #endif //LL_WINDOWS } //end if benchmark else {