From 72d8b8f78cf5aa5bba0075c9d6de2fe3fa978a61 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 27 Mar 2020 02:54:37 -0500 Subject: [PATCH 1/8] Potentially harden against region teardown crash. Screw with branching to delve more information from callstacks since dynamic annotations don't seem to work with sentry.io using crashpad lib... sadface. --- indra/newview/llsurface.cpp | 71 ++++++++++++++++++++++++++++++------- indra/newview/llsurface.h | 2 +- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 3373295a2..9f15a389d 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -53,6 +53,7 @@ #include "llglheaders.h" #include "lldrawpoolterrain.h" #include "lldrawable.h" +#include "hippogridmanager.h" extern LLPipeline gPipeline; extern bool gShiftFrame; @@ -371,6 +372,14 @@ void LLSurface::connectNeighbor(LLSurface* neighborp, U32 direction) // - Non-power-of-2 regions should work here, but the rest of the viewer code will probably choke on them. surface_patch_ref patchp, neighbor_patchp; + if (mNeighbors[direction] == neighborp) + { + return; + } + if (mNeighbors[direction]) + { + mNeighbors[direction]->disconnectNeighbor(this, gDirOpposite[direction]); + } mNeighbors[direction] = neighborp; const S32 max_idx = mPatchesPerEdge - 1; @@ -480,33 +489,71 @@ void LLSurface::connectNeighbor(LLSurface* neighborp, U32 direction) } } -void LLSurface::disconnectNeighbor(LLSurface *surfacep) +void LLSurface::disconnectNeighbor(LLSurface* surfacep, U32 direction) { - S32 i; - for (i = 0; i < 8; i++) + if (surfacep && surfacep == mNeighbors[direction]) { - if (surfacep == mNeighbors[i]) + // Iterate through surface patches, removing any connectivity to removed surface. + // Extra branches for debugging. + if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) { - mNeighbors[i] = NULL; + for (auto& patchp : mPatchList) + { + patchp->disconnectNeighbor(surfacep); + } + } + if (gHippoGridManager->getCurrentGrid()->isSecondLife()) + { + for (auto& patchp : mPatchList) + { + patchp->disconnectNeighbor(surfacep); + } } - } - - // Iterate through surface patches, removing any connectivity to removed surface. - for (auto& patchp : mPatchList) - { - patchp->disconnectNeighbor(surfacep); } } void LLSurface::disconnectAllNeighbors() { + // Pulled out of loop to debug. + if (mNeighbors[EAST]) + { + mNeighbors[EAST]->disconnectNeighbor(this, gDirOpposite[EAST]); + } + if (mNeighbors[NORTH]) + { + mNeighbors[NORTH]->disconnectNeighbor(this, gDirOpposite[NORTH]); + } + if (mNeighbors[WEST]) + { + mNeighbors[WEST]->disconnectNeighbor(this, gDirOpposite[WEST]); + } + if (mNeighbors[SOUTH]) + { + mNeighbors[SOUTH]->disconnectNeighbor(this, gDirOpposite[SOUTH]); + } + if (mNeighbors[NORTHEAST]) + { + mNeighbors[NORTHEAST]->disconnectNeighbor(this, gDirOpposite[NORTHEAST]); + } + if (mNeighbors[NORTHWEST]) + { + mNeighbors[NORTHWEST]->disconnectNeighbor(this, gDirOpposite[NORTHWEST]); + } + if (mNeighbors[SOUTHWEST]) + { + mNeighbors[SOUTHWEST]->disconnectNeighbor(this, gDirOpposite[SOUTHWEST]); + } + if (mNeighbors[SOUTHEAST]) + { + mNeighbors[SOUTHEAST]->disconnectNeighbor(this, gDirOpposite[SOUTHEAST]); + } S32 i; for (i = 0; i < 8; i++) { if (mNeighbors[i]) { - mNeighbors[i]->disconnectNeighbor(this); + //mNeighbors[i]->disconnectNeighbor(this); mNeighbors[i] = NULL; } } diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index 16d96c467..4ffdc3ba4 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -85,7 +85,7 @@ public: void setOriginGlobal(const LLVector3d &origin_global); void connectNeighbor(LLSurface *neighborp, U32 direction); - void disconnectNeighbor(LLSurface *neighborp); + void disconnectNeighbor(LLSurface *neighborp, U32 direction); void disconnectAllNeighbors(); // Aurora Sim From b10619e4d8a4159b839815d86f293a98f46252f4 Mon Sep 17 00:00:00 2001 From: Router Gray Date: Sun, 29 Mar 2020 15:24:10 -0500 Subject: [PATCH 2/8] [Linux] Don't strip binaries, even when building release, unless packaging. Makes quick debugging in the dev checkout easier. This may need more work if we want to support building an 'install' target, bypassing packaging, but I never hear of anyone doing that. I'll address it if needed. --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index cb83c74fb..cda56769c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1147,7 +1147,8 @@ class LinuxManifest(ViewerManifest): def is_packaging_viewer(self): super(LinuxManifest, self).is_packaging_viewer() - return True # We always want a packaged viewer even without archive. + return 'package' in self.args['actions'] + def do(self, *actions): super(LinuxManifest, self).do(*actions) From a7e56d2af95a11c891e81fc11ccce485e4d995a4 Mon Sep 17 00:00:00 2001 From: Router Gray Date: Sun, 29 Mar 2020 16:31:40 -0500 Subject: [PATCH 3/8] Fix an accident in a ternary. --- indra/newview/llfloaternamedesc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index a707df03e..32730a561 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -148,7 +148,7 @@ S32 LLFloaterNameDesc::getExpectedUploadCost() const LLAssetType::EType asset_type = exten == "wav" ? LLAssetType::AT_SOUND : (exten == "anim" || exten == "bvh") ? LLAssetType::AT_ANIMATION : exten != "lsl" ? LLAssetType::AT_TEXTURE - : asset_type = LLAssetType::AT_NONE; + : LLAssetType::AT_NONE; S32 upload_cost = -1; if (asset_type != LLAssetType::AT_NONE) From 0b992fdd46de988c6f13592e9de1910313481292 Mon Sep 17 00:00:00 2001 From: Router Gray Date: Sun, 29 Mar 2020 16:33:11 -0500 Subject: [PATCH 4/8] [Lib] Update nlohmann json and switch it to FetchContent instead of prebuilts. (Alchemy sync) --- autobuild.xml | 32 -------------------------------- indra/cmake/CMakeLists.txt | 1 - indra/deps/CMakeLists.txt | 14 ++++++++++++++ indra/llcommon/CMakeLists.txt | 2 +- indra/newview/CMakeLists.txt | 3 +-- 5 files changed, 16 insertions(+), 36 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 5d3f1a881..880176e81 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1933,38 +1933,6 @@ version 7.11.1.297294 - modernjson - - copyright - Copyright (c) 2013-2018 Niels Lohmann - description - JSON for Modern C++ - license - MIT - license_file - LICENSES/modernjson.txt - name - modernjson - platforms - - common - - archive - - hash - 6f11eca7e2a6ca61f9217e949a64f026 - hash_algorithm - md5 - url - https://depot.alchemyviewer.org/pub/common/lib/modernjson-3.2.0-common-201809210551.tar.bz2 - - name - common - - - version - 3.2.0 - nvapi copyright diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 8202868a1..cfd982f96 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -50,7 +50,6 @@ set(cmake_SOURCE_FILES GooglePerfTools.cmake Hunspell.cmake JPEG.cmake - Json.cmake LLAddBuildTest.cmake LLAppearance.cmake LLAudio.cmake diff --git a/indra/deps/CMakeLists.txt b/indra/deps/CMakeLists.txt index fb2ed3050..af512a87b 100644 --- a/indra/deps/CMakeLists.txt +++ b/indra/deps/CMakeLists.txt @@ -15,6 +15,11 @@ FetchContent_Declare( GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 6.1.2 ) +FetchContent_Declare( + nlohmann_json + GIT_REPOSITORY https://github.com/nlohmann/json.git + GIT_TAG v3.7.3 + ) FetchContent_Declare( absl GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git @@ -44,5 +49,14 @@ if(WINDOWS) FetchContent_MakeAvailable(fmt) endif() +# Typically you don't care so much for a third party library's tests to be +# run from your own project's code. +set(JSON_BuildTests OFF CACHE INTERNAL "") + +# If you only include this third party in PRIVATE source files, you do not +# need to install it when your main project gets installed. +set(JSON_Install OFF CACHE INTERNAL "") +FetchContent_MakeAvailable(nlohmann_json) + unset(CMAKE_FOLDER) unset(CMAKE_POSITION_INDEPENDENT_CODE) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 9baf87d9d..1d9df704e 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -12,7 +12,6 @@ include(Linking) include(Boost) include(OpenSSL) include(LLSharedLibs) -include(Json) include(Copy3rdPartyLibs) include(ZLIB) include(URIPARSER) @@ -300,6 +299,7 @@ target_link_libraries( ${Boost_SYSTEM_LIBRARY} ${CORESERVICES_LIBRARY} ${URIPARSER_LIBRARY} + nlohmann_json::nlohmann_json ${RT_LIBRARY} ) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 0d25be520..77e370f81 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -18,7 +18,6 @@ include(FMODSTUDIO) include(GeneratePrecompiledHeader) include(GLOD) include(Hunspell) -include(Json) include(LLAddBuildTest) include(LLAppearance) include(LLAudio) @@ -63,7 +62,6 @@ include_directories( ${STATEMACHINE_INCLUDE_DIRS} ${DBUSGLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} - ${JSON_INCLUDE_DIR} ${GLOD_INCLUDE_DIR} ${LLAUDIO_INCLUDE_DIRS} ${LLCHARACTER_INCLUDE_DIRS} @@ -1710,6 +1708,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLAPPEARANCE_LIBRARIES} absl::flat_hash_map absl::node_hash_map + nlohmann_json::nlohmann_json ${FMT_LIBRARY} ) From eeabbce377aaa6c4616c8e71e9f4f4a4328ab1b1 Mon Sep 17 00:00:00 2001 From: Router Gray Date: Sun, 29 Mar 2020 16:38:19 -0500 Subject: [PATCH 5/8] [Lib] Update abseil. (Alchemy sync) --- indra/deps/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/deps/CMakeLists.txt b/indra/deps/CMakeLists.txt index af512a87b..0219eb238 100644 --- a/indra/deps/CMakeLists.txt +++ b/indra/deps/CMakeLists.txt @@ -23,7 +23,7 @@ FetchContent_Declare( FetchContent_Declare( absl GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git - GIT_TAG 29235139149790f5afc430c11cec8f1eb1677607 + GIT_TAG 0033c9ea91a52ade7c6b725aa2ef3cbe15463421 ) # This is a hack because absl has dumb cmake From 356d28997239e7de1af15f136d50a5711d69be2f Mon Sep 17 00:00:00 2001 From: Router Gray Date: Sun, 29 Mar 2020 18:14:32 -0500 Subject: [PATCH 6/8] User request: Add last owner profile button to object inspect. --- indra/newview/llfloaterinspect.cpp | 31 +++++++++++++++++++ indra/newview/llfloaterinspect.h | 1 + .../default/xui/en-us/floater_inspect.xml | 13 ++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index c4abc4ac7..01dd84dc1 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -58,6 +58,7 @@ LLFloaterInspect::LLFloaterInspect(const LLSD&) mDirty(FALSE) { mCommitCallbackRegistrar.add("Inspect.OwnerProfile", boost::bind(&LLFloaterInspect::onClickOwnerProfile, this)); + mCommitCallbackRegistrar.add("Inspect.LastOwnerProfile", boost::bind(&LLFloaterInspect::onClickLastOwnerProfile, this)); mCommitCallbackRegistrar.add("Inspect.CreatorProfile", boost::bind(&LLFloaterInspect::onClickCreatorProfile, this)); mCommitCallbackRegistrar.add("Inspect.SelectObject", boost::bind(&LLFloaterInspect::onSelectObject, this)); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml"); @@ -166,6 +167,36 @@ void LLFloaterInspect::onClickOwnerProfile() } } +void LLFloaterInspect::onClickLastOwnerProfile() +{ + if(mObjectList->getAllSelected().size() == 0) return; + LLScrollListItem* first_selected =mObjectList->getFirstSelected(); + + if (first_selected) + { + LLUUID selected_id = first_selected->getUUID(); + struct f : public LLSelectedNodeFunctor + { + LLUUID obj_id; + f(const LLUUID& id) : obj_id(id) {} + virtual bool apply(LLSelectNode* node) + { + return (obj_id == node->getObject()->getID()); + } + } func(selected_id); + LLSelectNode* node = mObjectSelection->getFirstNode(&func); + if(node) + { + const LLUUID& last_owner_id = node->mPermissions->getLastOwner(); +// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) + if (last_owner_id == node->mPermissions->getOwner()) return; +// [/RLVa:KB] + LLAvatarActions::showProfile(last_owner_id); + } + } +} + void LLFloaterInspect::onSelectObject() { if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index 643639692..3769cedf7 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -60,6 +60,7 @@ public: virtual void onFocusReceived(); void onClickCreatorProfile(); void onClickOwnerProfile(); + void onClickLastOwnerProfile(); void onSelectObject(); LLScrollListCtrl* mObjectList; diff --git a/indra/newview/skins/default/xui/en-us/floater_inspect.xml b/indra/newview/skins/default/xui/en-us/floater_inspect.xml index e10b2fe06..2e5adeb24 100644 --- a/indra/newview/skins/default/xui/en-us/floater_inspect.xml +++ b/indra/newview/skins/default/xui/en-us/floater_inspect.xml @@ -1,6 +1,6 @@ + tool_tip="See profile of the highlighted object's owner" width="152" > +