Commit 218c7665 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix PBXT bugs found while testing with Application Verifier :

LPBUG#782269 : critical sections are initialized twice in   xt_xn_init_db() 
LPBUG#782431: active lock in memory released by   xt_ind_exit()
LPBUG#782433 : xt_heap_release() does not release spinlock  hp->h_lock initialized in xt_heap_new().
LPBUG#782435: xt_exit_row_locks() tries to release unallocated locks
parent bd94d5b8
......@@ -717,6 +717,11 @@ xtPublic void xt_ind_exit(XTThreadPtr self)
ind_handle_exit(self);
if (ind_cac_globals.cg_blocks) {
XTIndBlockPtr block = ind_cac_globals.cg_blocks;
for (u_int i=0; i<ind_cac_globals.cg_block_count; i++) {
XT_IPAGE_FREE_LOCK(self, &block->cb_lock);
block++;
}
xt_free(self, ind_cac_globals.cg_blocks);
ind_cac_globals.cg_blocks = NULL;
xt_free_mutex(&ind_cac_globals.cg_lock);
......
......@@ -109,6 +109,7 @@ xtPublic void xt_heap_release(XTThreadPtr self, XTHeapPtr hp)
if (hp->h_finalize)
(*hp->h_finalize)(self, hp);
xt_spinlock_unlock(&hp->h_lock);
xt_spinlock_free(NULL, &hp->h_lock);
xt_free(self, hp);
return;
}
......
......@@ -726,11 +726,15 @@ xtBool xt_init_row_locks(XTRowLocksPtr rl)
rl->rl_groups[i].lg_list_in_use = 0;
rl->rl_groups[i].lg_list = NULL;
}
rl->valid = 1;
return OK;
}
void xt_exit_row_locks(XTRowLocksPtr rl)
{
if (!rl->valid)
return;
for (int i=0; i<XT_ROW_LOCK_GROUP_COUNT; i++) {
xt_spinlock_free(NULL, &rl->rl_groups[i].lg_lock);
rl->rl_groups[i].lg_wait_queue = NULL;
......@@ -741,6 +745,7 @@ void xt_exit_row_locks(XTRowLocksPtr rl)
rl->rl_groups[i].lg_list = NULL;
}
}
rl->valid = 0;
}
/*
......
......@@ -658,6 +658,7 @@ typedef struct XTLockGroup {
struct XTLockWait;
typedef struct XTRowLocks {
int valid;
XTLockGroupRec rl_groups[XT_ROW_LOCK_GROUP_COUNT];
void xt_cancel_temp_lock(XTLockWaitPtr lw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment