Bug #56652 | Valgrind warnings for memory leak in ALTER TABLE and/or plugin/semisync | ||
---|---|---|---|
Submitted: | 8 Sep 2010 13:56 | Modified: | 10 Nov 2011 19:00 |
Reporter: | Sven Sandberg | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S2 (Serious) |
Version: | trunk, 5.6 | OS: | Any |
Assigned to: | Mats Kindahl | CPU Architecture: | Any |
Tags: | ALTER TABLE, memory leak, plugin, semisync, valgrind |
[8 Sep 2010 13:56]
Sven Sandberg
[31 Jan 2011 9:22]
Jon Olav Hauglid
This looks like a plugin issue rather than an issue with ALTER TABLE. The failing test is fulltext_plugin. The bytes that are leaked are allocated by my_strdup() in sql_plugin.cc /* Here we do anything special that may be required of the data types */ if ((pi->plugin_var->flags & PLUGIN_VAR_TYPEMASK) == PLUGIN_VAR_STR && pi->plugin_var->flags & PLUGIN_VAR_MEMALLOC) { char **pp= (char**) (thd->variables.dynamic_variables_ptr + *(int*)(pi->plugin_var + 1)); if ((*pp= *(char**) (global_system_variables.dynamic_variables_ptr + *(int*)(pi->plugin_var + 1)))) *pp= my_strdup(*pp, MYF(MY_WME|MY_FAE)); } } (Is the second if-statement really supposed to have an assignment and not a comparison?) This code block is only hit by fulltext_plugin.test in the whole MTR test suite. It is called when MyISAM tries to get the value of the sort_buffer_size system variable.
[10 Nov 2011 19:00]
Paul DuBois
Noted in 5.5.19, 5.6.4 changelogs. If a plugin was uninstalled, thread local variables for plugin variables of string type with wth PLUGIN_VAR_MEMALLOC flag were not freed.