From 9dc0e696e3e88cbf4418949fdf6007573409e084 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 23 Oct 2010 14:20:29 +0200 Subject: MP-660: Incorrect start up warnings Only try to remove the marker files when they were found in the first place. Also fixed the debug output regarding what value gLastExecEvent is being set to. --- linden/indra/newview/llappviewer.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index e85abb1..dd97cbf 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -2694,35 +2694,32 @@ void LLAppViewer::initMarkerFile() std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning()) { gLastExecEvent = LAST_EXEC_FROZE; LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; } - if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB)) { - LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << LL_ENDL; gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; + LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + LLAPRFile::remove(logout_marker_file); } if(LLAPRFile::isExist(llerror_marker_file, LL_APR_RB)) { - llinfos << "Last exec LLError crashed, setting LastExecEvent to " << LAST_EXEC_LLERROR_CRASH << llendl; if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; else gLastExecEvent = LAST_EXEC_LLERROR_CRASH; + LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + LLAPRFile::remove(llerror_marker_file); } if(LLAPRFile::isExist(error_marker_file, LL_APR_RB)) { - LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << LAST_EXEC_OTHER_CRASH << LL_ENDL; if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; else gLastExecEvent = LAST_EXEC_OTHER_CRASH; + LL_INFOS("MarkerFile") << "Last exec crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + LLAPRFile::remove(error_marker_file); } - LLAPRFile::remove(logout_marker_file); - LLAPRFile::remove(llerror_marker_file); - LLAPRFile::remove(error_marker_file); - // No new markers if another instance is running. if(anotherInstanceRunning()) { -- cgit v1.1 From f05549bd57907c3f8168e7cd9f42aa3219027c86 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 23 Oct 2010 21:35:43 +0200 Subject: IMP-661: WARNING: isFeatureAvailable: Feature RenderCubeMap not on feature list! Fixes this warning. Note that LLCubeMap::sUseCubeMaps is set to true by default, so this patch only has effect when the feature is actually NOT available. I tested that LLCubeMap::sUseCubeMaps is NOT used before the point where it is initialized now. The patch also adds an entry for IMP-660 to doc/contributions.txt that I had forgotten in the previous commit; and while I was at it, changes all RED- prefixes in IMP-. --- linden/indra/newview/llappviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index dd97cbf..4485cdf 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -440,8 +440,6 @@ static void settings_to_globals() gMapScale = gSavedSettings.getF32("MapScale"); LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); - LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); - LLSlider::setScrollWheelMultiplier( gSavedSettings.getS32("SliderScrollWheelMultiplier") ); LLHUDEffectLookAt::sDebugLookAt = gSavedSettings.getBOOL("PersistShowLookAt"); @@ -779,6 +777,9 @@ bool LLAppViewer::init() // initWindow(); + // initWindow also initializes the Feature List, so now we can initialize this global. + LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); + { BOOL download = gSavedSettings.getBOOL("DownloadClientTags"); -- cgit v1.1 From 14b06b36f896902df28b85369c7da0e75befa50c Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 23 Oct 2010 22:08:11 +0200 Subject: IMP-662: WARNING: LLVFS: Using index file /ramdisk/imprudence/cache/index.db2.x.606582153 These aren't warnings at all. They are printed when a LLVFS object was successfully created. Fixed by turning the warnings into INFO. --- linden/indra/llvfs/llvfs.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llvfs/llvfs.cpp b/linden/indra/llvfs/llvfs.cpp index 7df2a81..9bf5b59 100644 --- a/linden/indra/llvfs/llvfs.cpp +++ b/linden/indra/llvfs/llvfs.cpp @@ -583,8 +583,9 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename } } - LL_WARNS("VFS") << "Using index file " << mIndexFilename << LL_ENDL; - LL_WARNS("VFS") << "Using data file " << mDataFilename << LL_ENDL; + // Success! + LL_INFOS("VFS") << "Using index file " << mIndexFilename << LL_ENDL; + LL_INFOS("VFS") << "Using data file " << mDataFilename << LL_ENDL; mValid = VFSVALID_OK; } -- cgit v1.1 From 95e77d7378654904990ea5cd9947cbc4dd40b386 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 23 Oct 2010 22:59:56 +0200 Subject: IMP-663: WARNING: replaceSubstitutionStrings: replaceSubstituionStrings FAILURE: value: ignoretext repl: Caused by missing ignoretext in notifications.xml. Also fixed typos in debug output messages. --- linden/indra/llui/llnotifications.cpp | 4 ++-- linden/indra/newview/skins/default/xui/en-us/notifications.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llui/llnotifications.cpp b/linden/indra/llui/llnotifications.cpp index 2459110..4d3ff46 100644 --- a/linden/indra/llui/llnotifications.cpp +++ b/linden/indra/llui/llnotifications.cpp @@ -1190,13 +1190,13 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements) if (found != replacements.end()) { replacement = found->second; - //llwarns << "replaceSubstituionStrings: value: " << value << " repl: " << replacement << llendl; + //llinfos << "replaceSubstitutionStrings: value: \"" << value << "\" repl: \"" << replacement << "\"." << llendl; it->second->setValue(replacement); } else { - llwarns << "replaceSubstituionStrings FAILURE: value: " << value << " repl: " << replacement << llendl; + llwarns << "replaceSubstitutionStrings FAILURE: could not find replacement \"" << value << "\"." << llendl; } } } diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index 333e362..c69e792 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml @@ -7008,6 +7008,7 @@ IM history could not be found for [NAME]. type="alert"> Show Look At is a debug setting that displays where an avatar's head is looking. Be aware: this will *NOT* show where an avatar's camera is actually pointed. This setting should not be relied on for any form of privacy! -- cgit v1.1 From b23d8e7e174c2e68cdd3435cc42907796181d159 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sat, 23 Oct 2010 23:58:07 +0200 Subject: IMP-664: WARNING: addFeature: LLFeatureList::Attempting to add preexisting feature Disregard128DefaultDrawDistance Fix a bug that causes the last line of the feature table file to be read twice. This patch also removes the check for name.empty() because that will never be true, so might as well remove it. --- linden/indra/newview/llfeaturemanager.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llfeaturemanager.cpp b/linden/indra/newview/llfeaturemanager.cpp index 35613b7..54da31b 100644 --- a/linden/indra/newview/llfeaturemanager.cpp +++ b/linden/indra/newview/llfeaturemanager.cpp @@ -250,11 +250,9 @@ BOOL LLFeatureManager::loadFeatureTables() mTableVersion = version; LLFeatureList *flp = NULL; - while (!file.eof() && file.good()) + while (file >> name) { char buffer[MAX_STRING]; /*Flawfinder: ignore*/ - - file >> name; if (name.substr(0,2) == "//") { @@ -263,13 +261,6 @@ BOOL LLFeatureManager::loadFeatureTables() continue; } - if (name.empty()) - { - // This is a blank line - file.getline(buffer, MAX_STRING); - continue; - } - if (name == "list") { if (flp) -- cgit v1.1 From c6aac7d81149a50f895a0f06fdf08b65c8e4bd8c Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 25 Oct 2010 02:19:54 +0200 Subject: Added missing textures to artwork. Also fixed textures.xml by adding media_panel_scrollbg.png which is used in the MediaHUD as one of the media_*.png textures, but was lacking from textures.xml. --- linden/indra/newview/skins/default/textures/textures.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'linden/indra') diff --git a/linden/indra/newview/skins/default/textures/textures.xml b/linden/indra/newview/skins/default/textures/textures.xml index f2189a4..60fb4e0 100644 --- a/linden/indra/newview/skins/default/textures/textures.xml +++ b/linden/indra/newview/skins/default/textures/textures.xml @@ -396,5 +396,6 @@ + -- cgit v1.1 From 5900ac5f30540ac445ec50a61edfc4ed15ccbaf7 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 25 Oct 2010 02:36:53 +0200 Subject: Download prebuilt vivox (and 32bitcompatibilitylibs on 64bit) even when using standalone. --- linden/indra/cmake/ViewerMiscLibs.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linden/indra') diff --git a/linden/indra/cmake/ViewerMiscLibs.cmake b/linden/indra/cmake/ViewerMiscLibs.cmake index 7fe1040..35f4e3a 100644 --- a/linden/indra/cmake/ViewerMiscLibs.cmake +++ b/linden/indra/cmake/ViewerMiscLibs.cmake @@ -8,6 +8,14 @@ if (NOT STANDALONE) use_prebuilt_binary(32bitcompatibilitylibs) endif(LINUX AND ${ARCH} STREQUAL "x86_64") use_prebuilt_binary(fontconfig) +else (NOT STANDALONE) + # Download there even when using standalone. + set(STANDALONE OFF) + use_prebuilt_binary(vivox) + if(LINUX AND ${ARCH} STREQUAL "x86_64") + use_prebuilt_binary(32bitcompatibilitylibs) + endif(LINUX AND ${ARCH} STREQUAL "x86_64") + set(STANDALONE ON) endif(NOT STANDALONE) if (WINDOWS) -- cgit v1.1 From d1b840a0137dee05d424c477de0ba757be89af6d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 25 Oct 2010 14:59:48 +0200 Subject: Validate textures starting with 00 too. --- linden/indra/newview/lltexturecache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index a9b7f81..b0d8412 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp @@ -1345,7 +1345,7 @@ void LLTextureCache::purgeTextures(bool validate) if (validate) { validate_idx = gSavedSettings.getU32("CacheValidateCounter"); - U32 next_idx = (++validate_idx) % 256; + U32 next_idx = (validate_idx + 1) % 256; gSavedSettings.setU32("CacheValidateCounter", next_idx); LL_DEBUGS("TextureCache") << "TEXTURE CACHE: Validating: " << validate_idx << LL_ENDL; } -- cgit v1.1 From 17e2c3f8999d93bb59deb7ac0c289ed2157a3f5e Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 25 Oct 2010 16:02:36 +0200 Subject: Fix possible crash on llassert_always(purge_list.size() >= entries_to_purge) This horrible noobish code checked if num_entries > sCacheMaxEntries and then goes on to assign (num_entries-empty_entries) - sCacheMaxEntries to an U32 entries_to_purge. Obviously this can lead to an abitrary large value of entries_to_purge with as result a crash due to the llassert_always. This bug must have been extremely rare since it only happens when someone decreases their cache size and has more empty entries in their entries file than the total number of entries minus the new cache size. --- linden/indra/newview/lltexturecache.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index b0d8412..ae0a63f 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp @@ -1172,7 +1172,7 @@ void LLTextureCache::readHeaderCache() U32 empty_entries = 0; typedef std::pair lru_data_t; std::set lru; - std::vector purge_list; + std::set purge_list; for (U32 i=0; i sCacheMaxEntries) + if (num_entries - empty_entries > sCacheMaxEntries) { // Special case: cache size was reduced, need to remove entries // Note: After we prune entries, we will call this again and create the LRU - U32 entries_to_purge = (num_entries-empty_entries) - sCacheMaxEntries; + U32 entries_to_purge = (num_entries - empty_entries) - sCacheMaxEntries; llinfos << "Texture Cache Entries: " << num_entries << " Max: " << sCacheMaxEntries << " Empty: " << empty_entries << " Purging: " << entries_to_purge << llendl; - if (entries_to_purge > 0) + // We can exit the following loop with the given condition, since if we'd reach the end of the lru set we'd have: + // purge_list.size() = lru.size() = num_entries - empty_entries = entries_to_purge + sCacheMaxEntries >= entries_to_purge + for (std::set::iterator iter = lru.begin(); purge_list.size() < entries_to_purge; ++iter) { - for (std::set::iterator iter = lru.begin(); iter != lru.end(); ++iter) - { - purge_list.push_back(iter->second); - if (purge_list.size() >= entries_to_purge) - break; - } + purge_list.insert(iter->second); } - llassert_always(purge_list.size() >= entries_to_purge); } else { @@ -1227,7 +1223,7 @@ void LLTextureCache::readHeaderCache() if (purge_list.size() > 0) { - for (std::vector::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) + for (std::set::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) { mHeaderMutex.unlock(); removeFromCache(*iter); -- cgit v1.1 From b22b6bb6b16fcc0d908aa7899a80650ec1fe511d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 25 Oct 2010 17:33:38 +0200 Subject: Fixed a locking issue with regard to texture cache purging. Releasing a lock in the middle of a critical area isn't very smart. --- linden/indra/newview/lltexturecache.cpp | 20 +++++++++++++------- linden/indra/newview/lltexturecache.h | 1 + 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index ae0a63f..56f3719 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp @@ -1225,9 +1225,7 @@ void LLTextureCache::readHeaderCache() { for (std::set::iterator iter = purge_list.begin(); iter != purge_list.end(); ++iter) { - mHeaderMutex.unlock(); - removeFromCache(*iter); - mHeaderMutex.lock(); + removeFromCacheLocked(*iter); } // If we removed any entries, we need to rebuild the entries list, // write the header, and call this again @@ -1246,7 +1244,7 @@ void LLTextureCache::readHeaderCache() writeEntriesAndClose(new_entries); mHeaderMutex.unlock(); // unlock the mutex before calling again readHeaderCache(); // repeat with new entries file - mHeaderMutex.lock(); + return; } else { @@ -1611,7 +1609,6 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) { if (!mReadOnly) { - LLMutexLock lock(&mHeaderMutex); Entry entry; S32 idx = openAndReadEntry(id, entry, false); if (idx >= 0) @@ -1628,17 +1625,26 @@ bool LLTextureCache::removeHeaderCacheEntry(const LLUUID& id) return false; } -void LLTextureCache::removeFromCache(const LLUUID& id) +void LLTextureCache::removeFromCacheLocked(const LLUUID& id) { //llwarns << "Removing texture from cache: " << id << llendl; if (!mReadOnly) { removeHeaderCacheEntry(id); - LLMutexLock lock(&mHeaderMutex); LLAPRFile::remove(getTextureFileName(id)); } } +void LLTextureCache::removeFromCache(const LLUUID& id) +{ + //llwarns << "Removing texture from cache: " << id << llendl; + if (!mReadOnly) + { + LLMutexLock lock(&mHeaderMutex); + LLTextureCache::removeFromCacheLocked(id); + } +} + ////////////////////////////////////////////////////////////////////////////// LLTextureCache::ReadResponder::ReadResponder() diff --git a/linden/indra/newview/lltexturecache.h b/linden/indra/newview/lltexturecache.h index 45804c2..c859b9a 100644 --- a/linden/indra/newview/lltexturecache.h +++ b/linden/indra/newview/lltexturecache.h @@ -158,6 +158,7 @@ private: S32 getHeaderCacheEntry(const LLUUID& id, S32& imagesize); S32 setHeaderCacheEntry(const LLUUID& id, S32 imagesize); bool removeHeaderCacheEntry(const LLUUID& id); + void removeFromCacheLocked(const LLUUID& id); private: // Internal -- cgit v1.1 From 03852da89ad24c9e1edcf9cb50dbda31dd3ab43a Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 25 Oct 2010 17:37:46 +0200 Subject: IMP-667: WARNING: remove: Attempting to remove filename: /ramdisk/imprudence/cache/textures/*/*.texture This turned out to be a simple matter of trying to remove non-existant files: A texture with a 'body size' of 0 doesn't have a texture body file. --- linden/indra/newview/lltexturecache.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index 56f3719..a1a9a39 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp @@ -1382,7 +1382,15 @@ void LLTextureCache::purgeTextures(bool validate) { purge_count++; LL_DEBUGS("TextureCache") << "PURGING: " << filename << LL_ENDL; - LLAPRFile::remove(filename); + if (entries[idx].mBodySize > 0) + { + LLAPRFile::remove(filename); + } + else if (LLAPRFile::isExist(filename)) // Sanity check. Shouldn't exist. + { + LL_WARNS("TextureCache") << "Entry has zero body size but existing " << filename << ". Deleting file too..." << LL_ENDL; + LLAPRFile::remove(filename); + } cache_size -= entries[idx].mBodySize; mTexturesSizeTotal -= entries[idx].mBodySize; entries[idx].mBodySize = 0; -- cgit v1.1