summaryrefslogtreecommitdiff
path: root/sql/sql_test.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-03-28 11:44:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2023-03-28 11:44:24 +0300
commitdfa90257f6a7be45b421798e56e7e9c1f27caf77 (patch)
treebe28b2c37aa50b742be57ea4e046a42905c7604c /sql/sql_test.cc
parenta8b616d1e92ca9a4f4ba929aba41f64b19b2d169 (diff)
downloadmariadb-git-dfa90257f6a7be45b421798e56e7e9c1f27caf77.tar.gz
MDEV-30936 clang 15.0.7 -fsanitize=memory fails massively
handle_slave_io(), handle_slave_sql(), os_thread_exit(): Remove a redundant pthread_exit(nullptr) call, because it would cause SIGSEGV. mysql_print_status(): Add MEM_MAKE_DEFINED() to work around some missing instrumentation around mallinfo2(). que_graph_free_stat_list(): Invoke que_node_get_next(node) before que_graph_free_recursive(node). That is the logical and MSAN_OPTIONS=poison_in_dtor=1 compatible way of freeing memory. ins_node_t::~ins_node_t(): Invoke mem_heap_free(entry_sys_heap). que_graph_free_recursive(): Rely on ins_node_t::~ins_node_t(). fts_t::~fts_t(): Invoke mem_heap_free(fts_heap). fts_free(): Replace with direct calls to fts_t::~fts_t(). The failures in free_root() due to MSAN_OPTIONS=poison_in_dtor=1 will be covered in MDEV-30942.
Diffstat (limited to 'sql/sql_test.cc')
-rw-r--r--sql/sql_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 07ebcc7a37a..41adcce2135 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -623,6 +623,10 @@ Next alarm time: %lu\n",
#elif defined(HAVE_MALLINFO)
struct mallinfo info= mallinfo();
#endif
+#if __has_feature(memory_sanitizer)
+ /* Work around missing MSAN instrumentation */
+ MEM_MAKE_DEFINED(&info, sizeof info);
+#endif
#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)
char llbuff[10][22];
printf("\nMemory status:\n\