summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-05-14 01:05:12 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2011-05-14 01:05:12 +0200
commit218c7665be6ca9c310ba1dd847b5ab88f70eeb33 (patch)
treed0cc198610cbc836d524c9a5dba8d07a0cf272b2 /storage
parentbd94d5b8284c4ecfe29d0caeb20c391cb2091f98 (diff)
downloadmariadb-git-218c7665be6ca9c310ba1dd847b5ab88f70eeb33.tar.gz
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
Diffstat (limited to 'storage')
-rw-r--r--storage/pbxt/src/cache_xt.cc5
-rw-r--r--storage/pbxt/src/heap_xt.cc1
-rw-r--r--storage/pbxt/src/lock_xt.cc5
-rw-r--r--storage/pbxt/src/lock_xt.h1
4 files changed, 12 insertions, 0 deletions
diff --git a/storage/pbxt/src/cache_xt.cc b/storage/pbxt/src/cache_xt.cc
index 24e42d9e984..090250dd802 100644
--- a/storage/pbxt/src/cache_xt.cc
+++ b/storage/pbxt/src/cache_xt.cc
@@ -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);
diff --git a/storage/pbxt/src/heap_xt.cc b/storage/pbxt/src/heap_xt.cc
index a4e3fec1611..11331f6489f 100644
--- a/storage/pbxt/src/heap_xt.cc
+++ b/storage/pbxt/src/heap_xt.cc
@@ -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;
}
diff --git a/storage/pbxt/src/lock_xt.cc b/storage/pbxt/src/lock_xt.cc
index 5dbba9db83a..e4a38716845 100644
--- a/storage/pbxt/src/lock_xt.cc
+++ b/storage/pbxt/src/lock_xt.cc
@@ -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;
}
/*
diff --git a/storage/pbxt/src/lock_xt.h b/storage/pbxt/src/lock_xt.h
index 4e5af648c37..28737478d48 100644
--- a/storage/pbxt/src/lock_xt.h
+++ b/storage/pbxt/src/lock_xt.h
@@ -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);