diff options
author | Aditya A <aditya.a@oracle.com> | 2012-11-08 15:21:02 +0530 |
---|---|---|
committer | Aditya A <aditya.a@oracle.com> | 2012-11-08 15:21:02 +0530 |
commit | 29d08621bbbab7ba75e01cdbe082fa56cd28824b (patch) | |
tree | 67daa8f565dbca82883fb51b0073f59cafa36ba6 /sql | |
parent | c4be4dc03da8ce61052737fcdc1925bbf9cbf7a1 (diff) | |
parent | 7a8c93e6dd879e451b983e0f0b31d1512e516129 (diff) | |
download | mariadb-git-29d08621bbbab7ba75e01cdbe082fa56cd28824b.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')
-rw-r--r-- | sql/mysqld.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 67856852983..0fbb824b6fb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1476,7 +1476,6 @@ void clean_up(bool print_message) item_user_lock_free(); lex_free(); /* Free some memory */ item_create_cleanup(); - free_charsets(); if (!opt_noacl) { #ifdef HAVE_DLOPEN @@ -1532,6 +1531,7 @@ void clean_up(bool print_message) logger.cleanup_end(); my_atomic_rwlock_destroy(&global_query_id_lock); my_atomic_rwlock_destroy(&thread_running_lock); + free_charsets(); mysql_mutex_lock(&LOCK_thread_count); DBUG_PRINT("quit", ("got thread count lock")); ready_to_exit=1; |