From 713128246417ee3300e01d0a92f540da79bebb7e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 17 Feb 2014 11:10:22 +0100 Subject: [PATCH] At --log-warnings=9 or more, log at what address a dynamic plugin was loaded. It helps to interpret valgrind/safemalloc memory-related warnings that are printed when a plugin is unloaded (and thus cannot resolve addresses automatically) --- sql/sql_plugin.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 726d1944052..c127b82b3b6 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1357,6 +1357,16 @@ static int plugin_initialize(MEM_ROOT *tmp_root, struct st_plugin_int *plugin, goto err; } + if (plugin->plugin_dl && global_system_variables.log_warnings >= 9) + { + void *sym= dlsym(plugin->plugin_dl->handle, + plugin->plugin_dl->mariaversion ? + maria_plugin_declarations_sym : plugin_declarations_sym); + DBUG_ASSERT(sym); + sql_print_information("Plugin %s loaded at %p", + plugin->name.str, sym); + } + if (plugin_type_initialize[plugin->plugin->type]) { if ((*plugin_type_initialize[plugin->plugin->type])(plugin))