Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-29 11:40:45



Reply to topic  [ 3 posts ] 
Build failure with gcc version 11.1.1 
Author Message

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
I recently upgraded my rig to Fedora 34 which comes along with gcc version 11.1.1 20210531. During the build, the following errors occur:
Code:
/home/zanezimer/Projects/linden/indra/newview/llinventorymodel.cpp: In member function ‘U32 LLInventoryModel::updateItem(const LLViewerInventoryItem*, U32)’:
/home/zanezimer/Projects/linden/indra/newview/llinventorymodel.cpp:885:78: error: ‘this’ pointer is null [-Werror=nonnull]
  885 |                                                 << " - " << new_item->getName()
      |                                                             ~~~~~~~~~~~~~~~~~^~
In file included from /home/zanezimer/Projects/linden/indra/newview/llinventorymodel.h:53,
                 from /home/zanezimer/Projects/linden/indra/newview/llinventorymodel.cpp:38:
/home/zanezimer/Projects/linden/indra/newview/llviewerinventory.h:67:28: note: in a call to non-static member function ‘virtual const string& LLViewerInventoryItem::getName() const’
   67 |         const std::string& getName() const override;
      |                            ^~~~~~~
/home/zanezimer/Projects/linden/indra/newview/llinventorymodel.cpp:907:63: error: ‘this’ pointer is null [-Werror=nonnull]
  907 |                                 new_item->updateParentOnServer(false);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /home/zanezimer/Projects/linden/indra/newview/llinventorymodel.h:53,
                 from /home/zanezimer/Projects/linden/indra/newview/llinventorymodel.cpp:38:
/home/zanezimer/Projects/linden/indra/newview/llviewerinventory.h:122:14: note: in a call to non-static member function ‘virtual void LLViewerInventoryItem::updateParentOnServer(bool) const’
  122 |         void updateParentOnServer(bool restamp) const override;
      |              ^~~~~~~~~~~~~~~~~~~~
It seems like the two references to 'new_item' might need to just be 'item' as 'new_item' is not yet initialized? At any rate, using --ignore-warnings suppresses the failures as warnings and the build completes.


2021-06-19 22:45:49
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
The new_item pointer is superfluous and needs to be replaced with old_item in this part of the if() clause, like so:
Code:
   LLPointer<LLViewerInventoryItem> old_item = getItem(item->getUUID());
   if (old_item)
   {
      // We already have an old item, modify its values
      LLUUID old_parent_id = old_item->getParentUUID();
      LLUUID new_parent_id = item->getParentUUID();
      if (old_parent_id != new_parent_id)
      {
         bool null_parent_id = new_parent_id.isNull();
         if (null_parent_id)
         {
            llwarns << "Null parent UUID for item " << item->getUUID()
                  << " - " << old_item->getName()
                  << ". Moving item to Lost And Found" << llendl;
            new_parent_id = laf;
         }
         // We need to update the parent-child tree
         item_array_t* item_array = get_ptr_in_map(mParentChildItemTree,
                                         old_parent_id);
         if (item_array)
         {
            vector_replace_with_last(*item_array, old_item);
         }
         item_array = get_ptr_in_map(mParentChildItemTree, new_parent_id);
         if (item_array)
         {
            item_array->emplace_back(old_item);
         }
         mask |= LLInventoryObserver::STRUCTURE;
         if (null_parent_id)
         {
            LLInventoryModel::LLCategoryUpdate update(new_parent_id, 1);
            accountForUpdate(update);
            old_item->setParent(new_parent_id);
            old_item->updateParentOnServer(false);
         }
      }
      if (old_item->getName() != item->getName())
      {
         mask |= LLInventoryObserver::LABEL;
      }
      old_item->copyViewerItem(item);
      mask |= LLInventoryObserver::INTERNAL;
   }
Thankfully, this code path (with null_parent_id) is never taken under normal operations (it would cause a crash should it be taken).

Fixed for next release.


2021-06-19 23:03:58
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
Thankfully, this code path (with null_parent_id) is never taken under normal operations (it would cause a crash should it be taken).

Fixed for next release.
Ah, I didn't dive in enough to understand the entire code path. I had imagined it would have caused a crash, though I had never experienced one.

Thanks for the upcoming fix.


2021-06-19 23:55:28
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.