diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2010-12-06 12:52:06 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2010-12-06 12:52:06 +0100 |
commit | 0eae06c43007d7e59275af2d437b3c19537bab46 (patch) | |
tree | 71fb765ab78a47e1071744cabe2ba85e60051009 /storage/heap/CMakeLists.txt | |
parent | 91a72ee314ce6b0ac7adfc6546390435c9ba164f (diff) | |
download | mariadb-git-0eae06c43007d7e59275af2d437b3c19537bab46.tar.gz |
Bug#473914: mysql_client_test fail with in debug compilaton on windows x64
Reason: inconsistent compilation, federatedx is compiled without SAFEMALLOC
flag, while anything else is compiled with SAFEMALLOC.
As a consequence, my_hash_init used inside federatedx initialization does not
provide correct caller info parameters (file, line) , so they are initialized with
whatever is on stack. When info about allocated memory is output in
COM_DEBUG command, the server crashes trying to output string starting at
0xcccccccccccccccc.
The fix is to remove SAFEMALLOC preprocessor flags
from every CMakeLists.txt, except the top-level one.
Also, SAFEMALLOC is not defined by default now, instead
there is WITH_DEBUG_FULL CMake option which adds
-DSAFEMALLOC to C and C++ flags in debug compilation.
This option is off by default, because
1) Debug C runtime already has heap debugging builtin with
overwrite and leak detection
2)safemalloc considerably slows down the tests.
Note also that
- SAFEMALLOC is gone in MySQL5.5
- On Windows, heap related overflows can also be found using free pageheap utility
(that is also part of application verifier). This is even more efficient if there are no other layers
on top of Windows heap allocator, e.g it is most efficient with release version.
Diffstat (limited to 'storage/heap/CMakeLists.txt')
-rwxr-xr-x | storage/heap/CMakeLists.txt | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt index c2d2cd1290f..1e560b5e3b1 100755 --- a/storage/heap/CMakeLists.txt +++ b/storage/heap/CMakeLists.txt @@ -13,9 +13,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") - INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c ha_heap.cc |