From 8348e50c7f8f304e6d3733fb5a0a8d7bdb056fef Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 May 2018 16:44:14 +0300 Subject: MAINT-8686 Viewer should report active coroutines at the end of the session --- indra/llcommon/llcoros.cpp | 19 ++++++++++++++++++- indra/llcommon/llcoros.h | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index c5ba23f68c..4bab669046 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -35,6 +35,7 @@ // external library headers #include // other Linden headers +#include "lltimer.h" #include "llevents.h" #include "llerror.h" #include "stringize.h" @@ -280,6 +281,21 @@ void LLCoros::setStackSize(S32 stacksize) mStackSize = stacksize; } +void LLCoros::printActiveCoroutines() +{ + LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------"; + CoroMap::iterator iter; + CoroMap::iterator end = mCoros.end(); + F64 time = LLTimer::getTotalSeconds(); + for (iter = mCoros.begin(); iter != end; iter++) + { + F64 life_time = time - iter->second->mCreationTime; + LL_CONT << LL_NEWLINE << "Name: " << iter->first << " life: " << life_time; + } + LL_CONT << LL_ENDL; + LL_INFOS("LLCoros") << "-----------------------------------------------------" << LL_ENDL; +} + #if LL_WINDOWS static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific @@ -375,7 +391,8 @@ LLCoros::CoroData::CoroData(CoroData* prev, const std::string& name, mCoro(boost::bind(toplevel, _1, this, callable), stacksize), // don't consume events unless specifically directed mConsuming(false), - mSelf(0) + mSelf(0), + mCreationTime(LLTimer::getTotalSeconds()) { } diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index 884d6b159c..8fb27af6a4 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -151,6 +151,9 @@ public: /// for delayed initialization void setStackSize(S32 stacksize); + /// for delayed initialization + void printActiveCoroutines(); + /// get the current coro::self& for those who really really care static coro::self& get_self(); @@ -223,6 +226,7 @@ private: // function signature down to that point -- and of course through every // other caller of every such function. LLCoros::coro::self* mSelf; + F64 mCreationTime; // since epoch }; typedef boost::ptr_map CoroMap; CoroMap mCoros; -- cgit v1.2.3 From 1c4decadfef356ebe11f73bb839fac196e1f4fa0 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Jun 2018 01:22:49 +0100 Subject: Disable name demangling via libc++abi on OS X to avoid malloc abort trap on OS X 10.14 Mojave --- indra/llcommon/llerror.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index f31a054139..e3e2698ba7 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -247,6 +247,13 @@ namespace LLError { std::string Log::demangle(const char* mangled) { + +#if LL_DARWIN + // MAINT-8724 libc++abi demangling causes malloc check failures + // that abort the application on OS X 10.14 Mojave so the easy + // fix is to disable demangling until a better fix can be found. + return mangled; +#else #ifdef __GNUC__ // GCC: type_info::name() returns a mangled class name,st demangle @@ -282,6 +289,7 @@ namespace LLError #else return mangled; +#endif #endif } } // LLError -- cgit v1.2.3 From 88da45148eeae26e1bae11bf3c948796e0f7cfdb Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Jun 2018 22:14:46 +0100 Subject: Better fix for OSX 10.14 libc++abi demangling crash on mem shenanigans. Silence nagging about running launcher for non-release for download builds. Tweak newview CMake to use executable instead of SL_Launcher and re-enable debugging within Xcode. --- indra/llcommon/llerror.cpp | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index e3e2698ba7..29de79dc64 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -247,32 +247,15 @@ namespace LLError { std::string Log::demangle(const char* mangled) { - -#if LL_DARWIN - // MAINT-8724 libc++abi demangling causes malloc check failures - // that abort the application on OS X 10.14 Mojave so the easy - // fix is to disable demangling until a better fix can be found. - return mangled; -#else #ifdef __GNUC__ // GCC: type_info::name() returns a mangled class name,st demangle - - static size_t abi_name_len = 100; - static char* abi_name_buf = (char*)malloc(abi_name_len); - // warning: above is voodoo inferred from the GCC manual, - // do NOT change - - int status; - // We don't use status, and shouldn't have to pass apointer to it - // but gcc 3.3 libstc++'s implementation of demangling is broken - // and fails without. - - char* name = abi::__cxa_demangle(mangled, - abi_name_buf, &abi_name_len, &status); - // this call can realloc the abi_name_buf pointer (!) - - return name ? name : mangled; - + // passing nullptr, 0 forces allocation of a unique buffer we can free + // fixing MAINT-8724 on OSX 10.14 + int status = -1; + char* name = abi::__cxa_demangle(mangled, nullptr, 0, &status); + std::string result(name ? name : mangled); + free(name); + return result; #elif LL_WINDOWS // DevStudio: type_info::name() includes the text "class " at the start @@ -289,7 +272,6 @@ namespace LLError #else return mangled; -#endif #endif } } // LLError -- cgit v1.2.3 From 83dcf6b10daff1ec886063a968c884cdc79c47ed Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 14 May 2018 14:07:36 +0300 Subject: MAINT-8689 Diagnostics for coroutine memory crash --- indra/llcommon/llcoros.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 4bab669046..3165ce0743 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -283,6 +283,7 @@ void LLCoros::setStackSize(S32 stacksize) void LLCoros::printActiveCoroutines() { + LL_INFOS("LLCoros") << "Number of active coroutines: " << (S32)mCoros.size() << LL_ENDL; LL_INFOS("LLCoros") << "-------------- List of active coroutines ------------"; CoroMap::iterator iter; CoroMap::iterator end = mCoros.end(); @@ -401,7 +402,13 @@ std::string LLCoros::launch(const std::string& prefix, const callable_t& callabl std::string name(generateDistinctName(prefix)); Current current; // pass the current value of Current as previous context - CoroData* newCoro = new CoroData(current, name, callable, mStackSize); + CoroData* newCoro = new(std::nothrow) CoroData(current, name, callable, mStackSize); + if (newCoro == NULL) + { + // Out of memory? + printActiveCoroutines(); + LL_ERRS("LLCoros") << "Failed to start coroutine: " << name << " Stacksize: " << mStackSize << " Total coroutines: " << mCoros.size() << LL_ENDL; + } // Store it in our pointer map mCoros.insert(name, newCoro); // also set it as current -- cgit v1.2.3 From 5f890af7077157f7a0bf161d5aebf48dceb1a2ac Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 13 Jun 2018 20:28:26 +0300 Subject: MAINT-8731 Click action to disable clicking objects, per-object in a linkset --- indra/llcommon/indra_constants.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fda84aa5a8..a00a82aff0 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -323,6 +323,7 @@ const U8 CLICK_ACTION_OPEN = 4; const U8 CLICK_ACTION_PLAY = 5; const U8 CLICK_ACTION_OPEN_MEDIA = 6; const U8 CLICK_ACTION_ZOOM = 7; +const U8 CLICK_ACTION_DISABLED = 8; // DO NOT CHANGE THE SEQUENCE OF THIS LIST!! -- cgit v1.2.3