From a4d6fad698bc0f32c7b6779e16932c1e26b2d8dd Mon Sep 17 00:00:00 2001 From: Beq Date: Fri, 13 Sep 2024 23:03:16 +0100 Subject: [PATCH] FIRE-34497 - Bugsplat - crash during shutdown due to null mutex. This is evidently a race condition, not everyone is crashing and according to LL it does not repro in DeltaFPS (though it does in Atlasaurus for them too). This probably suggests that DeltaFPS just happened to move the race condition needle a little in the right direction. --- indra/llplugin/llpluginprocessparent.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 4b80a4e452..dd138f1a0c 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -187,8 +187,18 @@ LLPluginProcessParent::ptr_t LLPluginProcessParent::create(LLPluginProcessParent /*static*/ void LLPluginProcessParent::shutdown() { - LLCoros::LockType lock(*sInstancesMutex); - + // FIRE-34497 - lock maybe be null during shutdown due to fiber shutdown race condition + // LLCoros::LockType lock(*sInstancesMutex); + std::unique_ptr lock; + if (sInstancesMutex) + { + lock = std::make_unique(*sInstancesMutex); + } + else + { + LL_WARNS("Plugin") << "shutdown called but no instances mutex available" << LL_ENDL; + } + // mapInstances_t::iterator it; for (it = sInstances.begin(); it != sInstances.end(); ++it) {