From 47993954923cab94a6b93ce605e0c71d007076f7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 2 Oct 2021 01:29:20 +0300 Subject: SL-16106 Fixed asset storage trying to request data on shutdown --- indra/newview/llviewerassetstorage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llviewerassetstorage.cpp') diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index c1b129750a..64d9ce62c5 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -520,6 +520,12 @@ void LLViewerAssetStorage::assetRequestCoro( boost::bind(&LLViewerAssetStorage::capsRecvForRegion, this, _1, capsRecv.getName())); llcoro::suspendUntilEventOn(capsRecv); + + if (LLApp::isExiting() || !gAssetStorage) + { + return; + } + LL_WARNS_ONCE("ViewerAsset") << "capsRecv got event" << LL_ENDL; LL_WARNS_ONCE("ViewerAsset") << "region " << gAgent.getRegion() << " mViewerAssetUrl " << mViewerAssetUrl << LL_ENDL; } -- cgit v1.3 From f1245399df2e1ff9adef5ff23d3afe279aeb9eac Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 22 Nov 2021 21:58:30 +0200 Subject: SL-16106 LLScopedIncrement crash --- indra/newview/llviewerassetstorage.cpp | 12 +++++++----- indra/newview/llviewerassetstorage.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerassetstorage.cpp') diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 64d9ce62c5..8c8de22b2f 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -103,12 +103,13 @@ public: /// LLViewerAssetStorage ///---------------------------------------------------------------------------- +S32 LLViewerAssetStorage::sAssetCoroCount = 0; + // Unused? LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs, const LLHost &upstream_host) : LLAssetStorage(msg, xfer, vfs, static_vfs, upstream_host), - mAssetCoroCount(0), mCountRequests(0), mCountStarted(0), mCountCompleted(0), @@ -122,7 +123,6 @@ LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager * LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs) : LLAssetStorage(msg, xfer, vfs, static_vfs), - mAssetCoroCount(0), mCountRequests(0), mCountStarted(0), mCountCompleted(0), @@ -491,8 +491,7 @@ void LLViewerAssetStorage::assetRequestCoro( LLGetAssetCallback callback, void *user_data) { - LLScopedIncrement coro_count_boost(mAssetCoroCount); - mCountStarted++; + LLScopedIncrement coro_count_boost(sAssetCoroCount); // static counter since corotine can outlive LLViewerAssetStorage S32 result_code = LL_ERR_NOERR; LLExtStat ext_status = LLExtStat::NONE; @@ -502,6 +501,9 @@ void LLViewerAssetStorage::assetRequestCoro( LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: asset storage no longer exists" << LL_ENDL; return; } + + mCountStarted++; + if (!gAgent.getRegion()) { LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: no region set" << LL_ENDL; @@ -628,7 +630,7 @@ std::string LLViewerAssetStorage::getAssetURL(const std::string& cap_url, const void LLViewerAssetStorage::logAssetStorageInfo() { LLMemory::logMemoryInfo(true); - LL_INFOS("AssetStorage") << "Active coros " << mAssetCoroCount << LL_ENDL; + LL_INFOS("AssetStorage") << "Active coros " << sAssetCoroCount << LL_ENDL; LL_INFOS("AssetStorage") << "mPendingDownloads size " << mPendingDownloads.size() << LL_ENDL; LL_INFOS("AssetStorage") << "mCountStarted " << mCountStarted << LL_ENDL; LL_INFOS("AssetStorage") << "mCountCompleted " << mCountCompleted << LL_ENDL; diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h index c1a5534b81..cdf6401e4e 100644 --- a/indra/newview/llviewerassetstorage.h +++ b/indra/newview/llviewerassetstorage.h @@ -124,12 +124,13 @@ protected: wait_list_t mCoroWaitList; std::string mViewerAssetUrl; - S32 mAssetCoroCount; S32 mCountRequests; S32 mCountStarted; S32 mCountCompleted; S32 mCountSucceeded; S64 mTotalBytesFetched; + + static S32 sAssetCoroCount; // coroutine count, static since coroutines can outlive LLViewerAssetStorage }; #endif -- cgit v1.3 From 317698ff51b92c3953d005dd26e2789258361e8d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 24 Nov 2021 00:24:29 +0200 Subject: SL-16404 Crash in assetRequestCoro Access violation at writing received data to vfs file. Most crashes indicate network issues, so adding additional response validation. --- indra/newview/llviewerassetstorage.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llviewerassetstorage.cpp') diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 8c8de22b2f..a1377f2aef 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -570,6 +570,18 @@ void LLViewerAssetStorage::assetRequestCoro( result_code = LL_ERR_ASSET_REQUEST_FAILED; ext_status = LLExtStat::NONE; } + else if (!result.has(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW)) + { + LL_DEBUGS("ViewerAsset") << "request failed, no data returned!" << LL_ENDL; + result_code = LL_ERR_ASSET_REQUEST_FAILED; + ext_status = LLExtStat::NONE; + } + else if (!result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].isBinary()) + { + LL_DEBUGS("ViewerAsset") << "request failed, invalid data format!" << LL_ENDL; + result_code = LL_ERR_ASSET_REQUEST_FAILED; + ext_status = LLExtStat::NONE; + } else { LL_DEBUGS("ViewerAsset") << "request succeeded, url " << url << LL_ENDL; -- cgit v1.3