From 5979467198e9a8d4c065de908cf48c7d73101cd7 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 20 Nov 2013 11:43:09 -0700 Subject: revert changeset 05606ef22574: fix for SH-4629: Interesting: crash at LLViewerRegion::killObject --- indra/newview/llviewerregion.cpp | 32 -------------------------------- indra/newview/llviewerregion.h | 1 - 2 files changed, 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f71d0a7a64..2eb065c1ef 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -923,21 +923,6 @@ void LLViewerRegion::addActiveCacheEntry(LLVOCacheEntry* entry) mImpl->mActiveSet.insert(entry); } -//remove vo entry which is in mImpl->mActiveSet but not in rendering pipeline. -//this is caused by mImpl->mActiveSet failing to remove this entry somehow. -void LLViewerRegion::removeDanglingEntry(LLVOCacheEntry* entry) -{ - if(mDead || !entry) - { - return; - } - - mImpl->mVisibleEntries.erase(entry); - mImpl->mActiveSet.erase(entry); - mImpl->mWaitingSet.erase(entry); - entry->setState(LLVOCacheEntry::INACTIVE); -} - void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* drawablep) { if(mDead || !entry) @@ -1418,8 +1403,6 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) } std::vector delete_list; - std::vector dangling_list; - S32 update_counter = llmin(max_update, mImpl->mActiveSet.size()); LLVOCacheEntry::vocache_entry_set_t::iterator iter = mImpl->mActiveSet.upper_bound(mLastVisitedEntry); @@ -1435,13 +1418,6 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) } LLVOCacheEntry* vo_entry = *iter; - if(!vo_entry->getEntry() || !vo_entry->getEntry()->getDrawable()) - { - //sometimes mImpl->mActiveSet fails to erase some entry, causing this dangling case. - dangling_list.push_back(vo_entry); - continue; - } - if(!vo_entry->isAnyVisible(camera_origin, local_origin, back_threshold) && vo_entry->mLastCameraUpdated < sLastCameraUpdated) { killObject(vo_entry, delete_list); @@ -1474,14 +1450,6 @@ void LLViewerRegion::killInvisibleObjects(F32 max_time) delete_list.clear(); } - if(!dangling_list.empty()) - { - for(S32 i = 0; i < dangling_list.size(); i++) - { - removeDanglingEntry(dangling_list[i]); - } - } - return; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 6889db7880..a789cc6715 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -386,7 +386,6 @@ private: void removeFromVOCacheTree(LLVOCacheEntry* entry); void replaceVisibleCacheEntry(LLVOCacheEntry* old_entry, LLVOCacheEntry* new_entry); void killCacheEntry(LLVOCacheEntry* entry); //physically delete the cache entry - void removeDanglingEntry(LLVOCacheEntry* entry); void killInvisibleObjects(F32 max_time); void createVisibleObjects(F32 max_time); void updateVisibleEntries(F32 max_time); //update visible entries -- cgit v1.2.3 From c14ecc817895d06b04a803a88d00d4ae1c80060a Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 21 Nov 2013 11:20:45 -0700 Subject: fix for SH-4629: Interesting: crash at LLViewerRegion::killObject --- indra/newview/llvieweroctree.cpp | 4 +++ indra/newview/llviewerregion.cpp | 72 +++++++++++++++++++++++++--------------- indra/newview/llviewerregion.h | 4 +-- 3 files changed, 51 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 62d34d12b5..201677b3de 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -268,6 +268,10 @@ void LLViewerOctreeEntry::removeData(LLViewerOctreeEntryData* data) { return; } + if(mData[data->getDataType()] != data) + { + return; + } mData[data->getDataType()] = NULL; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2eb065c1ef..f1ac4328e4 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -847,7 +847,7 @@ void LLViewerRegion::replaceVisibleCacheEntry(LLVOCacheEntry* old_entry, LLVOCac } //physically delete the cache entry -void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry) +void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry, bool kill_obj) { if(!entry) { @@ -857,6 +857,14 @@ void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry) //remove from active list and waiting list if(entry->isState(LLVOCacheEntry::ACTIVE)) { + if(kill_obj && entry->getEntry()) + { + LLDrawable* drawablep = (LLDrawable*)entry->getEntry()->getDrawable(); + if(drawablep) + { + gObjectList.killObject(drawablep->getVObj()); + } + } mImpl->mActiveSet.erase(entry); } else @@ -887,16 +895,19 @@ void LLViewerRegion::killCacheEntry(LLVOCacheEntry* entry) entry->removeAllChildren(); } - entry->setState(LLVOCacheEntry::INACTIVE); - + if(kill_obj) + { + entry->setState(LLVOCacheEntry::INACTIVE); + } + //remove from mCacheMap, real deletion mImpl->mCacheMap.erase(entry->getLocalID()); } //physically delete the cache entry -void LLViewerRegion::killCacheEntry(U32 local_id) +void LLViewerRegion::killCacheEntry(U32 local_id, bool kill_obj) { - killCacheEntry(getCacheEntry(local_id)); + killCacheEntry(getCacheEntry(local_id), kill_obj); } U32 LLViewerRegion::getNumOfActiveCachedObjects() const @@ -1458,6 +1469,7 @@ void LLViewerRegion::killObject(LLVOCacheEntry* entry, std::vector& //kill the object. LLDrawable* drawablep = (LLDrawable*)entry->getEntry()->getDrawable(); llassert(drawablep); + llassert(drawablep->getRegion() == this); if(drawablep && !drawablep->getParent()) { @@ -1509,12 +1521,21 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry) } else { + LLViewerRegion* old_regionp = ((LLDrawable*)entry->getEntry()->getDrawable())->getRegion(); + if(old_regionp != this) + { + //this object exists in two regions at the same time; + //this case can be safely ignored here because + //server should soon send update message to remove one region for this object. + + LL_WARNS() << "Entry: " << entry->getLocalID() << " exists in two regions at the same time." << LL_ENDL; + return NULL; + } + + LL_WARNS() << "Entry: " << entry->getLocalID() << " in rendering pipeline but not set to be active." << LL_ENDL; + //should not hit here any more, but does not hurt either, just put it back to active list addActiveCacheEntry(entry); - - //object is already created, crash here for debug use. - LL_WARNS() << "Object is already created." << LL_ENDL; - llassert(!entry->getEntry()->hasDrawable()); } return obj; } @@ -2027,6 +2048,20 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry) if(entry->getEntry()->hasDrawable()) //already in the rendering pipeline { + LLViewerRegion* old_regionp = ((LLDrawable*)entry->getEntry()->getDrawable())->getRegion(); + if(old_regionp != this && old_regionp) + { + LLViewerObject* obj = ((LLDrawable*)entry->getEntry()->getDrawable())->getVObj(); + if(obj) + { + //remove from old region + old_regionp->killCacheEntry(obj->getLocalID(), false); + + //change region + obj->setRegion(this); + } + } + addActiveCacheEntry(entry); //set parent id @@ -2173,7 +2208,7 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLDataPackerB mImpl->mCacheMap[local_id] = entry; decodeBoundingInfo(entry); - } + } result = CACHE_UPDATE_CHANGED; } @@ -2199,23 +2234,6 @@ LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObjec { eCacheUpdateResult result = cacheFullUpdate(dp, flags); -#if 0 - LLVOCacheEntry* entry = mImpl->mCacheMap[objectp->getLocalID()]; - if(!entry) - { - return result; - } - - if(objectp->mDrawable.notNull() && !entry->getEntry()) - { - entry->setOctreeEntry(objectp->mDrawable->getEntry()); - } - if(entry->getEntry() && entry->getEntry()->hasDrawable() && entry->isState(LLVOCacheEntry::INACTIVE)) - { - addActiveCacheEntry(entry); - } -#endif - return result; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index a789cc6715..0f27def8a5 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -235,7 +235,7 @@ public: void addVisibleCacheEntry(LLVOCacheEntry* entry); void addActiveCacheEntry(LLVOCacheEntry* entry); void removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* drawablep); - void killCacheEntry(U32 local_id); //physically delete the cache entry + void killCacheEntry(U32 local_id, bool kill_obj = true); //physically delete the cache entry // Like idleUpdate, but forces everything to complete regardless of // how long it takes. @@ -385,7 +385,7 @@ private: void killObject(LLVOCacheEntry* entry, std::vector& delete_list); void removeFromVOCacheTree(LLVOCacheEntry* entry); void replaceVisibleCacheEntry(LLVOCacheEntry* old_entry, LLVOCacheEntry* new_entry); - void killCacheEntry(LLVOCacheEntry* entry); //physically delete the cache entry + void killCacheEntry(LLVOCacheEntry* entry, bool kill_obj = true); //physically delete the cache entry void killInvisibleObjects(F32 max_time); void createVisibleObjects(F32 max_time); void updateVisibleEntries(F32 max_time); //update visible entries -- cgit v1.2.3