From aca2dab2d0ff7d66576b5d79f34eb9a706187de4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 3 Jun 2016 20:09:33 +0300 Subject: MAINT-6460 Crash calculating mesh complexity --- indra/newview/llmeshrepository.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 0aaed3e286..117507ef39 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4034,6 +4034,11 @@ void LLMeshRepository::uploadError(LLSD& args) //static F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { + if (header.size() == 0) + { + return 0.f; + } + F32 max_distance = 512.f; F32 dlowest = llmin(radius/0.03f, max_distance); -- cgit v1.2.3 From c664ae73c3fa46e430306d7b24af3026246f8097 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 15 Jun 2016 18:01:44 +0300 Subject: MAINT-6460 additional header check --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 117507ef39..39ebf9f95b 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4034,7 +4034,7 @@ void LLMeshRepository::uploadError(LLSD& args) //static F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { - if (header.size() == 0) + if (header.size() == 0 || header.has("404") || header["version"].asInteger() > MAX_MESH_VERSION) { return 0.f; } -- cgit v1.2.3 From b06d5aeec8144f18e039758d3c70e9414f83ce21 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 12 Jul 2016 21:37:45 +0300 Subject: MAINT-6460 Crash calculating mesh complexity --- indra/newview/llmeshrepository.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 39ebf9f95b..bf7f91d19a 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -3906,8 +3906,8 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail) bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) { - LLSD mesh = mThread->getMeshHeader(mesh_id); - if (mesh.has("physics_mesh") && mesh["physics_mesh"].has("size") && (mesh["physics_mesh"]["size"].asInteger() > 0)) + const LLSD* mesh = mThread->getMeshHeader(mesh_id); + if (mesh && mesh->has("physics_mesh") && (*mesh)["physics_mesh"].has("size") && ((*mesh)["physics_mesh"]["size"].asInteger() > 0)) { return true; } @@ -3921,27 +3921,26 @@ bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) return false; } -LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id) +const LLSD* LLMeshRepository::getMeshHeader(const LLUUID& mesh_id) { LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); return mThread->getMeshHeader(mesh_id); } -LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) +const LLSD* LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) { - static LLSD dummy_ret; if (mesh_id.notNull()) { LLMutexLock lock(mHeaderMutex); mesh_header_map::iterator iter = mMeshHeader.find(mesh_id); if (iter != mMeshHeader.end()) { - return iter->second; + return &(iter->second); } } - return dummy_ret; + return NULL; } -- cgit v1.2.3 From 00a193e740536bc8dbdc7a4c52ae8d75efba0037 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 14 Jul 2016 15:21:39 +0300 Subject: MAINT-6460 Crash calculating mesh complexity --- indra/newview/llmeshrepository.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index bf7f91d19a..a0e57677c3 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4033,7 +4033,9 @@ void LLMeshRepository::uploadError(LLSD& args) //static F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { - if (header.size() == 0 || header.has("404") || header["version"].asInteger() > MAX_MESH_VERSION) + if (header.has("404") + || !header.has("lowest_lod") + || (header.has("version") && header["version"].asInteger() > MAX_MESH_VERSION)) { return 0.f; } -- cgit v1.2.3 From 1b1f4252e3a243fcdc0906ada0c124dfe7b864bf Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 25 Jul 2016 23:43:37 +0300 Subject: MAINT-6460 Crash calculating mesh complexity --- indra/newview/llmeshrepository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a0e57677c3..18634de500 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -3934,7 +3934,7 @@ const LLSD* LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) { LLMutexLock lock(mHeaderMutex); mesh_header_map::iterator iter = mMeshHeader.find(mesh_id); - if (iter != mMeshHeader.end()) + if (iter != mMeshHeader.end() && mMeshHeaderSize[mesh_id] > 0) { return &(iter->second); } -- cgit v1.2.3 From 13f19b1634a4d20c6daed965d52ea412ca4b0455 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 1 Aug 2016 17:25:20 +0300 Subject: Backed out changeset: c21a7e6d9796 --- indra/newview/llmeshrepository.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 18634de500..d7665716b7 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -3906,8 +3906,8 @@ void LLMeshRepository::buildHull(const LLVolumeParams& params, S32 detail) bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) { - const LLSD* mesh = mThread->getMeshHeader(mesh_id); - if (mesh && mesh->has("physics_mesh") && (*mesh)["physics_mesh"].has("size") && ((*mesh)["physics_mesh"]["size"].asInteger() > 0)) + LLSD mesh = mThread->getMeshHeader(mesh_id); + if (mesh.has("physics_mesh") && mesh["physics_mesh"].has("size") && (mesh["physics_mesh"]["size"].asInteger() > 0)) { return true; } @@ -3921,26 +3921,27 @@ bool LLMeshRepository::hasPhysicsShape(const LLUUID& mesh_id) return false; } -const LLSD* LLMeshRepository::getMeshHeader(const LLUUID& mesh_id) +LLSD& LLMeshRepository::getMeshHeader(const LLUUID& mesh_id) { LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); return mThread->getMeshHeader(mesh_id); } -const LLSD* LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) +LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id) { + static LLSD dummy_ret; if (mesh_id.notNull()) { LLMutexLock lock(mHeaderMutex); mesh_header_map::iterator iter = mMeshHeader.find(mesh_id); if (iter != mMeshHeader.end() && mMeshHeaderSize[mesh_id] > 0) { - return &(iter->second); + return iter->second; } } - return NULL; + return dummy_ret; } -- cgit v1.2.3 From 9b07078b470d40c4b6454d21da2909c35517b248 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 1 Aug 2016 18:00:54 +0300 Subject: MAINT-6460 Crash calculating mesh complexity --- indra/newview/llmeshrepository.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index d7665716b7..8bc75c8433 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4031,6 +4031,20 @@ void LLMeshRepository::uploadError(LLSD& args) mUploadErrorQ.push(args); } +F32 LLMeshRepository::getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) +{ + if (mThread && mesh_id.notNull()) + { + LLMutexLock lock(mThread->mHeaderMutex); + LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id); + if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0) + { + return getStreamingCost(iter->second, radius, bytes, bytes_visible, lod, unscaled_value); + } + } + return 0.f; +} + //static F32 LLMeshRepository::getStreamingCost(LLSD& header, F32 radius, S32* bytes, S32* bytes_visible, S32 lod, F32 *unscaled_value) { -- cgit v1.2.3 From ce3658455230cf392f45cc99f44a737ee59f13bd Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 1 Aug 2016 18:58:41 +0300 Subject: MAINT-6460 getMeshSize crash --- indra/newview/llmeshrepository.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmeshrepository.cpp') diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 8bc75c8433..54f8fb93d0 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -3956,10 +3956,11 @@ void LLMeshRepository::uploadModel(std::vector& data, LLVector3 S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod) { - if (mThread) + if (mThread && mesh_id.notNull()) { + LLMutexLock lock(mThread->mHeaderMutex); LLMeshRepoThread::mesh_header_map::iterator iter = mThread->mMeshHeader.find(mesh_id); - if (iter != mThread->mMeshHeader.end()) + if (iter != mThread->mMeshHeader.end() && mThread->mMeshHeaderSize[mesh_id] > 0) { LLSD& header = iter->second; -- cgit v1.2.3