Bug#14363985: MYSQLD CRASHED WHEN DISABL AND

ENABLE AUDI PLUGIN WHEN DDL
              OPERATION HAPPENING

PROBLEM: While unloading the plugin, state is
         not checked before it is to be reaped.
         This can lead to simultaneous free of
         plugin memory by more than one thread.
         Multiple deallocation leads to server
         crash. In the present bug two threads
         deallocate the alog_log plugin.

SOLUTION: A check is added to ensure that only
          one thread is unloading the plugin.

NOTE: No mtr test is added as it requires
      multiple threads to access critical
      section. debug_sync cannot be used in
      the current senario because we dont
      have access to thread pointer in
      some of the plugin functions. IMHO no
      test case in the current time frame.
This commit is contained in:
Ashish Agarwal 2012-08-24 14:55:47 +05:30
parent 9bc328a41a
commit 8c239b09a2

View File

@ -1900,7 +1900,8 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
mysql_audit_acquire_plugins(thd, MYSQL_AUDIT_GENERAL_CLASS);
mysql_mutex_lock(&LOCK_plugin);
if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)) ||
plugin->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_DYING))
{
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
goto err;