summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorAditya A <aditya.a@oracle.com>2012-11-08 15:14:29 +0530
committerAditya A <aditya.a@oracle.com>2012-11-08 15:14:29 +0530
commitb61f494c4bf1f88fdb0149dc9b20001c7fddf094 (patch)
tree6f1fe7928a760b60cd659848f9c1216388a2ae4e /sql/mysqld.cc
parentcebbe9a8077ef30c6f1769054441e5a144c5fdce (diff)
downloadmariadb-git-b61f494c4bf1f88fdb0149dc9b20001c7fddf094.tar.gz
Bug#14234028 - CRASH DURING SHUTDOWN WITH BACKGROUND PURGE THREAD
Analysis --------- my_stat() calls stat() and if the stat() call fails we try to set the variable my_errno which is actually a thread specific data . We try to get the address of this thread specific data using my_pthread_getspecifc(),but for the purge thread we have not defined any thread specific data so it returns null and when dereferencing null we get a segmentation fault. init_available_charsets() seen in the core stack is invoked through pthread_once() .pthread_once is used for one time initialization.Since free_charsets() is called before innodb plugin shutdown ,purge thread calls init_avaliable_charsets() which leads to the crash. Fix --- Call free_charsets() after the innodb plugin shutdown,since purge threads are still using the charsets.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 11e756381ab..aece8f28533 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1340,7 +1340,6 @@ void clean_up(bool print_message)
lex_free(); /* Free some memory */
item_create_cleanup();
set_var_free();
- free_charsets();
if (!opt_noacl)
{
#ifdef HAVE_DLOPEN
@@ -1390,6 +1389,7 @@ void clean_up(bool print_message)
#ifdef USE_REGEX
my_regex_end();
#endif
+ free_charsets();
#if defined(ENABLED_DEBUG_SYNC)
/* End the debug sync facility. See debug_sync.cc. */
debug_sync_end();