8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 17:23:03 +01:00

Do not delete system trace session with missing parent process (fix for https://github.com/FirebirdSQL/firebird/issues/8180) (#8179)

* Do not compact system session with missing parent process

* Replace assert with fb_assert

---------

Co-authored-by: Artyom Abakumov <artyom.abakumov@red-soft.ru>
This commit is contained in:
Artyom Abakumov 2024-07-10 11:24:27 +03:00 committed by dimitr
parent ea30152a9e
commit 6e07e3a5f4

View File

@ -163,6 +163,7 @@ void ConfigStorage::shutdown()
{
StorageGuard guard(this);
fb_assert(m_sharedMemory->getHeader()->cnt_uses != 0);
--(m_sharedMemory->getHeader()->cnt_uses);
if (m_sharedMemory->getHeader()->cnt_uses == 0)
{
@ -473,8 +474,10 @@ void ConfigStorage::compact()
for (TraceCSHeader::Slot* slot = header->slots; slot < header->slots + header->slots_cnt; slot++)
{
if (slot->used && slot->ses_pid != pid &&
((slot->ses_flags & trs_system) == 0) && // System sessions are shared for multiple connections so they may live without the original process
!ISC_check_process_existence(slot->ses_pid))
{
fb_assert(header->cnt_uses != 0);
header->cnt_uses--; // Process that created trace session disappeared, count it out
markDeleted(slot);
}