diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-04-09 12:25:25 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-04-09 12:25:25 -0300 |
commit | 214bd5a121058dfb31237c5326ad28b8c5f8eea3 (patch) | |
tree | 88259eaac8d31d3ec748805a745888380eb8f91f /sql/log.cc | |
parent | 8a41a0ba1f4f5d5ac0172f5bcb78fb636eb38b7a (diff) | |
download | mariadb-git-214bd5a121058dfb31237c5326ad28b8c5f8eea3.tar.gz |
Bug#43706: libmysqld segfaults when re-intialised
Bug#44091: libmysqld gets stuck waiting on mutex on initialization
The problem was that libmysqld wasn't enforcing a certain
initialization and deinitialization order for the mysys
library. Another problem was that the global object used
for management of log event handlers (aka LOGGER) wasn't
being prepared for a possible reutilization.
What leads to the hang/crash reported is that a failure
to load the language file triggers a double call of the
cleanup functions, causing an already destroyed mutex to
be used.
The solution is enforce a order on the initialization and
deinitialization of the mysys library within the libmysqld
library and to ensure that the global LOGGER object reset
it's internal state during cleanup.
mysys/my_init.c:
Deinitialize only if initialized already.
sql/log.cc:
Reset state.
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index 44296daa939..ed2eff6625d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -845,6 +845,7 @@ void LOGGER::cleanup_base() { table_log_handler->cleanup(); delete table_log_handler; + table_log_handler= NULL; } if (file_log_handler) file_log_handler->cleanup(); @@ -855,7 +856,11 @@ void LOGGER::cleanup_end() { DBUG_ASSERT(inited == 1); if (file_log_handler) + { delete file_log_handler; + file_log_handler=NULL; + } + inited= 0; } |