summaryrefslogtreecommitdiff
path: root/sql/signal_handler.cc
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-12-02 14:16:48 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2011-12-02 14:16:48 +0100
commitb522a6ce78bfe7bea3e52715c993c7d190159139 (patch)
tree9e4c9211a159f15e7bd8ab5ca489f53fd8b28a7c /sql/signal_handler.cc
parent8e6d41e278de3264d2a6e13cbc0ed328afca7f40 (diff)
downloadmariadb-git-b522a6ce78bfe7bea3e52715c993c7d190159139.tar.gz
Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS
handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush. include/my_stacktrace.h: Add safe versions of itoa() write() and snprintf(). libmysqld/CMakeLists.txt: Move signal handler to separate file. mysys/stacktrace.c: Remove unsafe function calls. sql/CMakeLists.txt: Move signal handler to separate file. sql/mysqld.cc: Move signal handler to separate file. sql/set_var.h: Add missing #include dependency. sql/sys_vars.cc: Cleanup .h and .cc files. sql/sys_vars.h: Cleanup .h and .cc files.
Diffstat (limited to 'sql/signal_handler.cc')
-rw-r--r--sql/signal_handler.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 54b456ec2c4..27fcf741e2a 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -16,7 +16,7 @@
#include "my_global.h"
#include <signal.h>
-#include "mysql_priv.h"
+#include "sys_vars.h"
#include "my_stacktrace.h"
#ifdef __WIN__
@@ -111,7 +111,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
(ulong) max_used_connections);
my_safe_printf_stderr("max_threads=%u\n",
- (uint) thread_scheduler.max_threads);
+ (uint) thread_scheduler->max_threads);
my_safe_printf_stderr("thread_count=%u\n", (uint) thread_count);
@@ -124,7 +124,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
((ulong) dflt_key_cache->key_cache_mem_size +
(global_system_variables.read_buff_size +
global_system_variables.sortbuff_size) *
- thread_scheduler.max_threads +
+ thread_scheduler->max_threads +
max_connections * sizeof(THD)) / 1024);
my_safe_printf_stderr("%s",