From 6608f84158d3561ef2c2f12a7136aa05cc39d7b4 Mon Sep 17 00:00:00 2001 From: Nisha Gopalakrishnan Date: Mon, 14 Mar 2016 15:20:21 +0530 Subject: BUG#22594514: HANDLE_FATAL_SIGNAL (SIG=11) IN UNIQUE::~UNIQUE | SQL/UNIQUES.CC:355 Analysis ======== Enabling the sort_buffer_size with a large value can cause operations utilizing the sort buffer like DELETE as mentioned in the bug report to fail. 5.5 and 5.6 versions reports OOM error while in 5.7+, the server crashes. While initializing the mem_root for the sort buffer tree, the block size for the mem_root is determined from the 'sort_buffer_size' value. This unsigned long value is typecasted to unsigned int, hence it becomes zero. Further block_size computation while initializing the mem_root results in a very large block_size value. Hence while trying to allocate a block during the DELETE operation, an OOM error is reported. In case of 5.7+, the PFS instrumentation for memory allocation, overshoots the unsigned value and allocates a block of just one byte. While trying to free the block of the mem_root, the original block_size is used. This triggers the crash since the server tries to free unallocated memory. Fix: ==== In order to restrict usage of such unreasonable sort_buffer_size, the typecast of block size to 'unsigned int' is removed and hence reports OOM error across all versions for sizes exceeding unsigned int range. --- include/my_tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/my_tree.h b/include/my_tree.h index 451e2b72b3c..4457bb1bc85 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ typedef struct st_tree { } TREE; /* Functions on whole tree */ -void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit, +void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit, int size, qsort_cmp2 compare, my_bool with_delete, tree_element_free free_element, void *custom_arg); void delete_tree(TREE*); -- cgit v1.2.1 From 7adf04e237c41d323b5181c108e7babed3c015fa Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 5 Jan 2016 22:48:50 +0100 Subject: MDEV-9366 : do_shutdown_server fails to detect server shutdown on Windows. Fix test whether process is alive in mysqltest. Also fix SHUT_RD definition on Windows to be SD_RECEIVE. SD_BOTH was used instead prior to this patch, and this would occasionally make mysql_shutdown() fail - when the socket for the current connection is not able send the COM_SHUTDOWN response anymore. --- include/violite.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/violite.h b/include/violite.h index ea7e3d7897c..da58de4373c 100644 --- a/include/violite.h +++ b/include/violite.h @@ -184,7 +184,7 @@ void vio_end(void); /* shutdown(2) flags */ #ifndef SHUT_RD -#define SHUT_RD SD_BOTH +#define SHUT_RD SD_RECEIVE #endif /* -- cgit v1.2.1 From c3c272cca45205b8ffc5c44b2cce136576649967 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 10 Jun 2016 13:47:00 +0200 Subject: MDEV-10166 probes_mysql_nodtrace.h is not provided anymore by mariadb-10.0.25 backport of commit bba3d42 Author: Sergei Golubchik Date: Sat Apr 30 10:27:42 2016 +0200 MDEV-9926 probes_mysql.h includes nonexisting files install private generated files --- include/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 33eaa28ae1e..219a2917917 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -69,3 +69,9 @@ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Developm PATTERN CMakeFiles EXCLUDE PATTERN mysql EXCLUDE REGEX "\\./(${EXCL_RE}$)" EXCLUDE) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/. DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development + FILES_MATCHING PATTERN "*.h" + PATTERN CMakeFiles EXCLUDE + PATTERN mysql EXCLUDE + REGEX "\\./(${EXCL_RE}$)" EXCLUDE) -- cgit v1.2.1 From 2b47832a2d261dbaf735b26e796aa126bccafb20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Thu, 10 Dec 2015 03:56:31 +0200 Subject: Fixed compilation failure using clang Both aria and myisam storage engines feature a logic path in thr_find_all_keys that leads to undefined behaviour by bypassing the initialization code of variables after my_thread_init(). By refactoring the nested logic into a separate function, this problem is resolved. --- include/myisam.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/myisam.h b/include/myisam.h index d50b1dc360e..186b049b32e 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -330,7 +330,8 @@ typedef struct st_sort_info my_off_t filelength, dupp, buff_length; ha_rows max_records; uint current_key, total_keys; - uint got_error, threads_running; + volatile uint got_error; + uint threads_running; myf myf_rw; enum data_file_type new_data_file_type; } MI_SORT_INFO; -- cgit v1.2.1