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/llerror.cpp') 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/llerror.cpp') 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