mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Bug #38816: kill + flush tables with read lock + stored
procedures causes crashes! The problem of that bugreport was mostly fixed by the patch for bug 38691. However, attached test case focused on another crash or valgrind warning problem: SHOW PROCESSLIST query accesses freed memory of SP instruction that run in a parallel connection. Changes of thd->query/thd->query_length in dangerous places have been guarded with the per-thread LOCK_thd_data mutex (the THD::LOCK_delete mutex has been renamed to THD::LOCK_thd_data).
This commit is contained in:
@ -1044,7 +1044,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
|
||||
if (tmp->command == COM_BINLOG_DUMP &&
|
||||
tmp->server_id == slave_server_id)
|
||||
{
|
||||
pthread_mutex_lock(&tmp->LOCK_delete); // Lock from delete
|
||||
pthread_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1057,7 +1057,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
|
||||
again. We just to do kill the thread ourselves.
|
||||
*/
|
||||
tmp->awake(THD::KILL_QUERY);
|
||||
pthread_mutex_unlock(&tmp->LOCK_delete);
|
||||
pthread_mutex_unlock(&tmp->LOCK_thd_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user