diff --git a/include/my_pthread.h b/include/my_pthread.h index 5dceacb6399..9157e8204bc 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -668,7 +668,17 @@ extern void my_mutex_end(void); We need to have at least 256K stack to handle calls to myisamchk_init() with the current number of keys and key parts. */ -# if defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN) +#if !defined(__has_feature) +#define __has_feature(x) 0 +#endif +#if defined(__clang__) && __has_feature(memory_sanitizer) && !defined(DBUG_OFF) +/* + MSAN in Debug with clang-20.1 required more memory to complete + mtr begin/end checks. The result without increase was MSAN + errors triggered on a call instruction. +*/ +# define DEFAULT_THREAD_STACK (2L<<20) +# elif defined(__SANITIZE_ADDRESS__) || defined(WITH_UBSAN) /* Optimized WITH_ASAN=ON executables produced by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6 diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index abe7c10952b..7ce8ef6cd97 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -1891,7 +1891,6 @@ thread-pool-oversubscribe 3 thread-pool-prio-kickup-timer 1000 thread-pool-priority auto thread-pool-stall-limit 500 -thread-stack 299008 time-format %H:%i:%s tmp-disk-table-size 18446744073709551615 tmp-memory-table-size 16777216 diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test index 44449cd3ad5..ce75924c757 100644 --- a/mysql-test/main/mysqld--help.test +++ b/mysql-test/main/mysqld--help.test @@ -27,7 +27,7 @@ perl; large-files-support lower-case-file-system system-time-zone collation-server character-set-server log-tc-size table-cache table-open-cache table-open-cache-instances max-connections - server-uid tls-version version.* analyze-max-length/; + server-uid tls-version version.* analyze-max-length thread-stack/; # Plugins which may or may not be there: @plugins=qw/innodb archive blackhole federated partition s3 diff --git a/mysql-test/suite/sys_vars/t/thread_stack_basic.test b/mysql-test/suite/sys_vars/t/thread_stack_basic.test index 39f120e0de1..a1f52576d15 100644 --- a/mysql-test/suite/sys_vars/t/thread_stack_basic.test +++ b/mysql-test/suite/sys_vars/t/thread_stack_basic.test @@ -3,6 +3,7 @@ # --source include/not_asan.inc --source include/not_ubsan.inc +--source include/not_msan.inc --replace_result 392192 299008 select @@global.thread_stack; --error ER_INCORRECT_GLOBAL_LOCAL_VAR