Below is the list of changes that have just been committed into a local
6.0 repository of aelkin. When aelkin does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-05-26 13:10:36+03:00, aelkin@stripped +2 -0
Bug #36929 crash in kill_zombie_dump_threads-> THD::awake() with replication tests
There was a crash in THD::awake () at attempt to access concurrently resetable
by the host thread THD::mysys_var.
Fixed with forcing the host thread to reset only after acquiring LOCK_delete mutex.
sql/scheduler.cc@stripped, 2008-05-26 13:10:34+03:00, aelkin@stripped +2 -0
Resetting mysys_var under protection of LOCK_delete
sql/sql_class.cc@stripped, 2008-05-26 13:10:34+03:00, aelkin@stripped +6 -1
Moving resetting of mysys_var under LOCK_delete protection.
diff -Nrup a/sql/scheduler.cc b/sql/scheduler.cc
--- a/sql/scheduler.cc 2008-05-14 16:33:27 +03:00
+++ b/sql/scheduler.cc 2008-05-26 13:10:34 +03:00
@@ -222,7 +222,9 @@ void thd_scheduler::thread_detach()
if (thread_attached)
{
THD* thd = (THD*)list.data;
+ pthread_mutex_lock(&thd->LOCK_delete);
thd->mysys_var= NULL;
+ pthread_mutex_lock(&thd->LOCK_delete);
thread_attached= FALSE;
#ifndef DBUG_OFF
/*
diff -Nrup a/sql/sql_class.cc b/sql/sql_class.cc
--- a/sql/sql_class.cc 2008-05-21 13:04:22 +03:00
+++ b/sql/sql_class.cc 2008-05-26 13:10:34 +03:00
@@ -902,6 +902,12 @@ THD::~THD()
DBUG_ENTER("~THD()");
/* Ensure that no one is using THD */
pthread_mutex_lock(&LOCK_delete);
+ /*
+ resetting this pointer to the thread specific memory is guarded by
+ the same mutex as a killer thread acquires in order to get access
+ to the pointer
+ */
+ mysys_var= NULL;
pthread_mutex_unlock(&LOCK_delete);
add_to_status(&global_status_var, &status_var);
@@ -929,7 +935,6 @@ THD::~THD()
#ifdef USING_TRANSACTIONS
free_root(&transaction.mem_root,MYF(0));
#endif
- mysys_var=0; // Safety (shouldn't be needed)
pthread_mutex_destroy(&LOCK_delete);
#ifndef DBUG_OFF
dbug_sentry= THD_SENTRY_GONE;
| Thread |
|---|
| • bk commit into 6.0 tree (aelkin:1.2639) BUG#36929 | Andrei Elkin | 26 May |