[MDEV-2774] LP:782435 - xt_exit_row_locks() tries to release unallocated locks Created: 2011-05-13  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Vladislav Vaintroub Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug782435.xml    

 Description   

Sometimes (e.g during table creation), xt_exit_row_locks() is called without the corresponding xt_init_row_locks() .
This leads to at attempt to release unallocated locks in
xt_spinlock_free(NULL, &rl->rl_groups[i].lg_lock);

This makes Windows application verifier unhappy on x64.

Quick fix:
== verändert Datei storage/pbxt/src/lock_xt.cc
— storage/pbxt/src/lock_xt.cc 2011-04-07 16:28:52 +0000
+++ storage/pbxt/src/lock_xt.cc 2011-05-13 22:56:00 +0000
@@ -726,11 +726,15 @@
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 @@ rl->rl_groups[i].lg_list = NULL; }

}
+ rl->valid = 0;
}

/*

=== verändert Datei storage/pbxt/src/lock_xt.h
— storage/pbxt/src/lock_xt.h 2010-05-06 12:57:15 +0000
+++ storage/pbxt/src/lock_xt.h 2011-05-13 22:51:41 +0000
@@ -658,6 +658,7 @@
struct XTLockWait;

typedef struct XTRowLocks {
+ int valid;
XTLockGroupRec rl_groups[XT_ROW_LOCK_GROUP_COUNT];

void xt_cancel_temp_lock(XTLockWaitPtr lw);



 Comments   
Comment by Vladislav Vaintroub [ 2011-06-14 ]

Re: xt_exit_row_locks() tries to release unallocated locks
Fixed in MariaDB 5.2.7

Comment by Rasmus Johansson (Inactive) [ 2012-03-21 ]

Launchpad bug id: 782435

Generated at Thu Feb 08 06:44:08 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.