From 27fd726faec22dec3d661e4cf101d15148089d5b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 1 Apr 2025 16:30:21 +0300 Subject: #3846 Crash at updateGLTFMaterials --- indra/newview/lllocalbitmaps.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index f08582e860..101ee215cb 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -680,11 +680,15 @@ void LLLocalBitmap::updateGLTFMaterials(LLUUID old_id, LLUUID new_id) // do not create a new material, reuse existing pointer // so that mTextureEntires remains untouched LLGLTFMaterial* render_mat = entry->getGLTFRenderMaterial(); - if (render_mat) + if (render_mat && render_mat != mat) { *render_mat = *mat; render_mat->applyOverride(*override_mat); // can update mGLTFMaterialWithLocalTextures } + else + { + LL_WARNS() << "A TE had an override, but no render material" << LL_ENDL; + } } } } -- cgit v1.2.3 From b62aae79599544206a12e238359e0ecd1be33213 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 1 Apr 2025 21:16:38 +0300 Subject: #3849 Crash at LLSelectMgr::updatePointAt --- indra/newview/llselectmgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index cc88d31aee..fbf5aa84d8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7486,7 +7486,7 @@ void LLSelectMgr::updatePointAt() LLVector3 select_offset; const LLPickInfo& pick = gViewerWindow->getLastPick(); LLViewerObject *click_object = pick.getObject(); - bool was_hud = pick.mPickHUD && !click_object->isHUDAttachment(); + bool was_hud = pick.mPickHUD && click_object && !click_object->isHUDAttachment(); if (click_object && click_object->isSelected() && !was_hud) { // clicked on another object in our selection group, use that as target -- cgit v1.2.3 From 8f6bc554b64c462635f7a02aa6020c1658c5c98c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 3 Apr 2025 20:27:28 +0300 Subject: #3868 Crash in updateHoveredState according to bugsplat mWrapperPanel is null. --- indra/newview/lltoast.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 84503e66a5..84854a79d4 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -436,6 +436,14 @@ void LLToast::setVisible(bool show) void LLToast::updateHoveredState() { + if (!mWrapperPanel) + { + // Shouldn't be happening. + // mWrapperPanel should have been inited in the constructor + // This needs to be figured out and fixed + llassert(false); + return; + } S32 x, y; LLUI::getInstance()->getMousePositionScreen(&x, &y); -- cgit v1.2.3 From 3d7de1b39ba23a308900a677b3a368184f5f59a0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 3 Apr 2025 21:15:57 +0300 Subject: #3870 Crash at LLVOAvatarSelf::getJoint() A long standing one --- indra/newview/llvoavatar.h | 2 +- indra/newview/llvoavatarself.cpp | 9 +++++++++ indra/newview/llvoavatarself.h | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 263c3dadf6..a2232d21a2 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -547,7 +547,7 @@ public: U32 renderTransparent(bool first_pass); void renderCollisionVolumes(); void renderBones(const std::string &selected_joint = std::string()); - void renderJoints(); + virtual void renderJoints(); static void deleteCachedImages(bool clearAll=true); static void destroyGL(); static void restoreGL(); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 746ef7cacb..f23af5afa4 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -697,6 +697,7 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time) // virtual LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) { + std::lock_guard lock(mJointMapMutex); LLJoint *jointp = NULL; jointp = LLVOAvatar::getJoint(name); if (!jointp && mScreenp) @@ -714,6 +715,14 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) return jointp; } + +//virtual +void LLVOAvatarSelf::renderJoints() +{ + std::lock_guard lock(mJointMapMutex); + LLVOAvatar::renderJoints(); +} + // virtual bool LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) { diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 051ac791c0..f9bea41b1d 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -92,6 +92,8 @@ public: /*virtual*/ void requestStopMotion(LLMotion* motion); /*virtual*/ LLJoint* getJoint(const std::string &name); + /*virtual*/ void renderJoints(); + /*virtual*/ bool setVisualParamWeight(const LLVisualParam *which_param, F32 weight); /*virtual*/ bool setVisualParamWeight(const char* param_name, F32 weight); /*virtual*/ bool setVisualParamWeight(S32 index, F32 weight); @@ -103,6 +105,8 @@ private: // helper function. Passed in param is assumed to be in avatar's parameter list. bool setParamWeight(const LLViewerVisualParam *param, F32 weight); + std::mutex mJointMapMutex; // getJoint gets used from mesh thread + /******************************************************************************** ** ** ** STATE -- cgit v1.2.3 From 40acaafd9c5b224a6e684db3b09f3360e92ed34e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Apr 2025 21:49:23 +0300 Subject: #3878 Crash at LLPipeline::unlinkDrawable assertInitializedDoError() on shutdown --- indra/newview/lldrawable.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 4921964b35..9d212cfe8b 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -253,7 +253,15 @@ void LLDrawable::cleanupReferences() std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); mFaces.clear(); - gPipeline.unlinkDrawable(this); + if (gPipeline.mInitialized) + { + gPipeline.unlinkDrawable(this); + } + else if (getSpatialGroup()) + { + // Not supposed to happen? + getSpatialGroup()->getSpatialPartition()->remove(this, getSpatialGroup()); + } removeFromOctree(); -- cgit v1.2.3 From a7a8d6c02e781188ad93280490be495dab5296ab Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sun, 6 Apr 2025 15:01:28 +0300 Subject: #3627 std::bad_alloc when loading a model --- indra/newview/gltfscenemanager.cpp | 11 +++++++++-- indra/newview/llmaterialeditor.cpp | 11 +++++++++-- indra/newview/skins/default/xui/en/notifications.xml | 10 ++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index c33d15228c..e0cd762776 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -69,9 +69,16 @@ void GLTFSceneManager::load() { return; } - if (filenames.size() > 0) + try + { + if (filenames.size() > 0) + { + GLTFSceneManager::instance().load(filenames[0]); + } + } + catch (std::bad_alloc&) { - GLTFSceneManager::instance().load(filenames[0]); + LLNotificationsUtil::add("CannotOpenFileTooBig"); } }, LLFilePicker::FFLOAD_GLTF, diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 1e3a328464..28160177f6 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -2857,9 +2857,16 @@ void LLMaterialEditor::importMaterial() { return; } - if (filenames.size() > 0) + try { - LLMaterialEditor::loadMaterialFromFile(filenames[0], -1); + if (filenames.size() > 0) + { + LLMaterialEditor::loadMaterialFromFile(filenames[0], -1); + } + } + catch (std::bad_alloc&) + { + LLNotificationsUtil::add("CannotOpenFileTooBig"); } }, LLFilePicker::FFLOAD_MATERIAL, diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index dba48012ac..f922a9d178 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2408,6 +2408,16 @@ Unable to upload snapshot. File might be too big, try reducing resolution or try again later. fail + + +Unable to open file. + +Viewer run out of memory while opening file. File might be too big. + fail + Date: Mon, 7 Apr 2025 19:38:27 +0300 Subject: #3627 std::bad_alloc in EventPoll --- indra/newview/lleventpoll.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index c05a7fef44..c6fea1ba82 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -101,10 +101,18 @@ namespace Details void LLEventPollImpl::handleMessage(const LLSD& content) { LL_PROFILE_ZONE_SCOPED_CATEGORY_APP; - std::string msg_name = content["message"]; + std::string msg_name = content["message"].asString(); LLSD message; - message["sender"] = mSenderIp; - message["body"] = content["body"]; + try + { + message["sender"] = mSenderIp; + message["body"] = content["body"]; + } + catch (std::bad_alloc&) + { + LLError::LLUserWarningMsg::showOutOfMemory(); + LL_ERRS("LLCoros") << "Bad memory allocation on message: " << msg_name << LL_ENDL; + } LLMessageSystem::dispatch(msg_name, message); } -- cgit v1.2.3 From 75bf8577a15f4bb9fdf9c9a918d2e4893870807f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 7 Apr 2025 19:39:41 +0300 Subject: #3884 Crash in kdu_core::kdu_params::get --- indra/llkdu/llimagej2ckdu.cpp | 183 +++++++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 84 deletions(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index bf7cfbe071..0d1f2b3006 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -279,103 +279,118 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod { LLImageDataLock lock(&base); - S32 data_size = base.getDataSize(); - S32 max_bytes = (base.getMaxBytes() ? base.getMaxBytes() : data_size); + try + { - // - // Initialization - // - mCodeStreamp.reset(); + S32 data_size = base.getDataSize(); + S32 max_bytes = (base.getMaxBytes() ? base.getMaxBytes() : data_size); - // It's not clear to nat under what circumstances we would reuse a - // pre-existing LLKDUMemSource instance. As of 2016-08-05, it consists of - // two U32s and a pointer, so it's not as if it would be a huge overhead - // to allocate a new one every time. - // Also -- why is base.getData() tested specifically here? If that returns - // NULL, shouldn't we bail out of the whole method? - if (!mInputp && base.getData()) - { - // The compressed data has been loaded - // Setup the source for the codestream - mInputp.reset(new LLKDUMemSource(base.getData(), data_size)); - } + // + // Initialization + // + mCodeStreamp.reset(); - if (mInputp) - { - // This is LLKDUMemSource::reset(), not boost::scoped_ptr::reset(). - mInputp->reset(); - } + // It's not clear to nat under what circumstances we would reuse a + // pre-existing LLKDUMemSource instance. As of 2016-08-05, it consists of + // two U32s and a pointer, so it's not as if it would be a huge overhead + // to allocate a new one every time. + // Also -- why is base.getData() tested specifically here? If that returns + // NULL, shouldn't we bail out of the whole method? + if (!mInputp && base.getData()) + { + // The compressed data has been loaded + // Setup the source for the codestream + mInputp.reset(new LLKDUMemSource(base.getData(), data_size)); + } - mCodeStreamp->create(mInputp.get()); - - // Set the maximum number of bytes to use from the codestream - // *TODO: This seems to be wrong. The base class should have no idea of - // how j2c compression works so no good way of computing what's the byte - // range to be used. - mCodeStreamp->set_max_bytes(max_bytes,true); - - // If you want to flip or rotate the image for some reason, change - // the resolution, or identify a restricted region of interest, this is - // the place to do it. You may use "kdu_codestream::change_appearance" - // and "kdu_codestream::apply_input_restrictions" for this purpose. - // If you wish to truncate the code-stream prior to decompression, you - // may use "kdu_codestream::set_max_bytes". - // If you wish to retain all compressed data so that the material - // can be decompressed multiple times, possibly with different appearance - // parameters, you should call "kdu_codestream::set_persistent" here. - // There are a variety of other features which must be enabled at - // this point if you want to take advantage of them. See the - // descriptions appearing with the "kdu_codestream" interface functions - // in "kdu_compressed.h" for an itemized account of these capabilities. - - switch (mode) - { - case MODE_FAST: - mCodeStreamp->set_fast(); - break; - case MODE_RESILIENT: - mCodeStreamp->set_resilient(); - break; - case MODE_FUSSY: - mCodeStreamp->set_fussy(); - break; - default: - llassert(0); - mCodeStreamp->set_fast(); - } + if (mInputp) + { + // This is LLKDUMemSource::reset(), not boost::scoped_ptr::reset(). + mInputp->reset(); + } - kdu_dims dims; - mCodeStreamp->get_dims(0,dims); + mCodeStreamp->create(mInputp.get()); + + // Set the maximum number of bytes to use from the codestream + // *TODO: This seems to be wrong. The base class should have no idea of + // how j2c compression works so no good way of computing what's the byte + // range to be used. + mCodeStreamp->set_max_bytes(max_bytes, true); + + // If you want to flip or rotate the image for some reason, change + // the resolution, or identify a restricted region of interest, this is + // the place to do it. You may use "kdu_codestream::change_appearance" + // and "kdu_codestream::apply_input_restrictions" for this purpose. + // If you wish to truncate the code-stream prior to decompression, you + // may use "kdu_codestream::set_max_bytes". + // If you wish to retain all compressed data so that the material + // can be decompressed multiple times, possibly with different appearance + // parameters, you should call "kdu_codestream::set_persistent" here. + // There are a variety of other features which must be enabled at + // this point if you want to take advantage of them. See the + // descriptions appearing with the "kdu_codestream" interface functions + // in "kdu_compressed.h" for an itemized account of these capabilities. + + switch (mode) + { + case MODE_FAST: + mCodeStreamp->set_fast(); + break; + case MODE_RESILIENT: + mCodeStreamp->set_resilient(); + break; + case MODE_FUSSY: + mCodeStreamp->set_fussy(); + break; + default: + llassert(0); + mCodeStreamp->set_fast(); + } + + kdu_dims dims; + mCodeStreamp->get_dims(0, dims); - S32 components = mCodeStreamp->get_num_components(); + S32 components = mCodeStreamp->get_num_components(); - // Check that components have consistent dimensions (for PPM file) - for (int idx = 1; idx < components; ++idx) - { - kdu_dims other_dims; - mCodeStreamp->get_dims(idx, other_dims); - if (other_dims != dims) + // Check that components have consistent dimensions (for PPM file) + for (int idx = 1; idx < components; ++idx) { - // This method is only called from methods that catch KDUError. - // We want to fail the image load, not crash the viewer. - LLTHROW(KDUError(STRINGIZE("Component " << idx << " dimensions " - << stringize(other_dims) - << " do not match component 0 dimensions " - << stringize(dims) << "!"))); + kdu_dims other_dims; + mCodeStreamp->get_dims(idx, other_dims); + if (other_dims != dims) + { + // This method is only called from methods that catch KDUError. + // We want to fail the image load, not crash the viewer. + LLTHROW(KDUError(STRINGIZE("Component " << idx << " dimensions " + << stringize(other_dims) + << " do not match component 0 dimensions " + << stringize(dims) << "!"))); + } } - } - // Get the number of resolution levels in that image - mLevels = mCodeStreamp->get_min_dwt_levels(); + // Get the number of resolution levels in that image + mLevels = mCodeStreamp->get_min_dwt_levels(); - // Set the base dimensions - base.setSize(dims.size.x, dims.size.y, components); - base.setLevels(mLevels); + // Set the base dimensions + base.setSize(dims.size.x, dims.size.y, components); + base.setLevels(mLevels); - if (!keep_codestream) + if (!keep_codestream) + { + mCodeStreamp.reset(); + mInputp.reset(); + } + } + catch (std::bad_alloc&) { - mCodeStreamp.reset(); - mInputp.reset(); + // we are in a thread, can't show an 'out of memory' here, + // main thread will keep going + throw; + } + catch (...) + { + LLTHROW(KDUError(STRINGIZE("Unknown J2C error : " + + boost::current_exception_diagnostic_information() << "!"))); } } -- cgit v1.2.3 From 417e0c681ecd10ef5dc473f2312dedb966f3c48d Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 8 Apr 2025 11:02:26 +0300 Subject: #3745 fix for showing system notification on login #2 --- indra/newview/llcallingcard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 829b6380cd..76e308a966 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -504,7 +504,7 @@ void LLAvatarTracker::idleNotifyObservers() void LLAvatarTracker::notifyObservers() { - if (mIsNotifyObservers) + if (mIsNotifyObservers || (LLStartUp::getStartupState() <= STATE_INVENTORY_CALLBACKS)) { // Don't allow multiple calls. // new masks and ids will be processed later from idle. -- cgit v1.2.3 From 9f12c98f6f3fefd4d3df75eee87ef1884d7e16e4 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 8 Apr 2025 13:52:38 -0400 Subject: Bump feature table version. --- indra/newview/featuretable.txt | 2 +- indra/newview/featuretable_mac.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index c0009d24ee..1090dd8ffb 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 73 +version 74 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 5940d1ec12..c3e2dd0c41 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 72 +version 73 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended -- cgit v1.2.3 From 632a8648ca5456448499a96dcc58c40f4ff80d95 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 8 Apr 2025 23:34:09 +0300 Subject: #3892 Crash at fillCompositionLogfont --- indra/llwindow/llwindowwin32.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 832cf254d1..1cac6ffe08 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4040,7 +4040,15 @@ void LLWindowWin32::fillCompositionLogfont(LOGFONT *logfont) break; } - logfont->lfHeight = mPreeditor->getPreeditFontSize(); + if (mPreeditor) + { + logfont->lfHeight = mPreeditor->getPreeditFontSize(); + } + else + { + // todo: extract from some font * LLUI::getScaleFactor() intead + logfont->lfHeight = 10; + } logfont->lfWeight = FW_NORMAL; } -- cgit v1.2.3