1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-34388 default stack size under MSAN needs increasing

Without this increase the mtr test case pre/post conditions will
fail as the stack usage has increased under MSAN with clang-20.1.

ASAN takes a 11M stack, however there was no obvious gain in MSAN
test success after 2M.

The resulting behaviour observed on smaller stack size was a
SEGV normally.

Hide the default stack size from the sysvar tests that expose
thread-stack as a variable with its default value.
This commit is contained in:
Daniel Black
2025-03-20 09:24:37 +11:00
parent 2811559337
commit 8d2665e56b
4 changed files with 13 additions and 3 deletions

View File

@@ -668,7 +668,17 @@ extern void my_mutex_end(void);
We need to have at least 256K stack to handle calls to myisamchk_init() We need to have at least 256K stack to handle calls to myisamchk_init()
with the current number of keys and key parts. 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 Optimized WITH_ASAN=ON executables produced
by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6 by GCC 12.3.0, GCC 13.2.0, or clang 16.0.6

View File

@@ -1891,7 +1891,6 @@ thread-pool-oversubscribe 3
thread-pool-prio-kickup-timer 1000 thread-pool-prio-kickup-timer 1000
thread-pool-priority auto thread-pool-priority auto
thread-pool-stall-limit 500 thread-pool-stall-limit 500
thread-stack 299008
time-format %H:%i:%s time-format %H:%i:%s
tmp-disk-table-size 18446744073709551615 tmp-disk-table-size 18446744073709551615
tmp-memory-table-size 16777216 tmp-memory-table-size 16777216

View File

@@ -27,7 +27,7 @@ perl;
large-files-support lower-case-file-system system-time-zone large-files-support lower-case-file-system system-time-zone
collation-server character-set-server log-tc-size table-cache collation-server character-set-server log-tc-size table-cache
table-open-cache table-open-cache-instances max-connections 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 which may or may not be there:
@plugins=qw/innodb archive blackhole federated partition s3 @plugins=qw/innodb archive blackhole federated partition s3

View File

@@ -3,6 +3,7 @@
# #
--source include/not_asan.inc --source include/not_asan.inc
--source include/not_ubsan.inc --source include/not_ubsan.inc
--source include/not_msan.inc
--replace_result 392192 299008 --replace_result 392192 299008
select @@global.thread_stack; select @@global.thread_stack;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR --error ER_INCORRECT_GLOBAL_LOCAL_VAR