[MDEV-3850] too early pthread_mutex_unlock in TC_LOG_MMAP::log_xid Created: 2012-11-10  Updated: 2012-11-17  Resolved: 2012-11-14

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.28, 5.3.9, 5.2.12, 5.1.62
Fix Version/s: 5.5.28a, 5.3.11, 5.2.13, 5.1.66

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

In this code:

5660 int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid)
5661 {
...
5713     for (;;)
5714     {
5715       int not_dirty = p->state != DIRTY;
5716       pthread_mutex_unlock(&p->lock);
5717       if (not_dirty || !syncing)
5718         break;
...
5733     pthread_mutex_unlock(&p->lock);

the mutex on the line 5716 is unlocked too early. After the break on the line 5718 the loop with end with the mutex being unlocked, while the code below assumes that it is locked.



 Comments   
Comment by Sergei Golubchik [ 2012-11-14 ]

pushed into 5.1

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