Skip to content

Commit 6e07e3a

Browse files
NoremosArtyom Abakumov
authored andcommitted
Do not delete system trace session with missing parent process (fix for #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>
1 parent ea30152 commit 6e07e3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jrd/trace/TraceConfigStorage.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ void ConfigStorage::shutdown()
163163

164164
{
165165
StorageGuard guard(this);
166+
fb_assert(m_sharedMemory->getHeader()->cnt_uses != 0);
166167
--(m_sharedMemory->getHeader()->cnt_uses);
167168
if (m_sharedMemory->getHeader()->cnt_uses == 0)
168169
{
@@ -473,8 +474,10 @@ void ConfigStorage::compact()
473474
for (TraceCSHeader::Slot* slot = header->slots; slot < header->slots + header->slots_cnt; slot++)
474475
{
475476
if (slot->used && slot->ses_pid != pid &&
477+
((slot->ses_flags & trs_system) == 0) && // System sessions are shared for multiple connections so they may live without the original process
476478
!ISC_check_process_existence(slot->ses_pid))
477479
{
480+
fb_assert(header->cnt_uses != 0);
478481
header->cnt_uses--; // Process that created trace session disappeared, count it out
479482
markDeleted(slot);
480483
}

0 commit comments

Comments
 (0)