Skip to content

MDEV-40410 follow-up: also fix TSan build for Clang < 22 - #6281

Open
FooBarrior wants to merge 2 commits into
10.11from
10.11-MDEV-40410-tsan-clang
Open

FooBarrior wants to merge 2 commits into
10.11from
10.11-MDEV-40410-tsan-clang

Conversation

@FooBarrior

Copy link
Copy Markdown
Contributor

Follow-up to c9294c9: Clang predefines __SANITIZE_THREAD__ only from version 22, so a Clang 21 -fsanitize=thread build still reserves the 8 TiB innodb_buffer_pool_size_max default and InnoDB fails with Cannot map innodb_buffer_pool_size_max=8388608m.
Check __has_feature(thread_sanitizer) as well; a GCC without that builtin gets the __has_feature(x) 0 fallback from my_pthread.h / my_valgrind.h.
Checked with Ubuntu clang 21.1.8 and GCC 16.2: under TSan buf0buf.cc now gets size_in_bytes_max_default{0}; without TSan it keeps {8ULL << 40}.

Clang predefines __SANITIZE_THREAD__ only from version 22; check
__has_feature(thread_sanitizer) as well.
@grooverdan
grooverdan enabled auto-merge (rebase) December 1, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants