From 0a546634690096915aef39e821a6788737fcbae6 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Tue, 7 Feb 2023 19:34:59 +0300 Subject: [PATCH] Fixed #7371: Various errors (fatal lock manager error, pthread_mutex_destroy failed) caused by races when opening/closing database (cherry picked from commit aabae5c5a84f349ab5dd2b5475ce9df5bd59544c) --- src/jrd/Database.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jrd/Database.cpp b/src/jrd/Database.cpp index 049171fdb6..2a42213b58 100644 --- a/src/jrd/Database.cpp +++ b/src/jrd/Database.cpp @@ -465,8 +465,8 @@ namespace Jrd void Database::initGlobalObjects() { - dbb_gblobj_holder = - GlobalObjectHolder::init(getUniqueFileId(), dbb_filename, dbb_config); + dbb_gblobj_holder.assignRefNoIncr(GlobalObjectHolder::init(getUniqueFileId(), + dbb_filename, dbb_config)); } // Database::Linger class implementation @@ -529,6 +529,7 @@ namespace Jrd g_hashTable->add(entry); } + entry->holder->addRef(); return entry->holder; }