diff --git a/ci/jobs/scripts/clickhouse_proc.py b/ci/jobs/scripts/clickhouse_proc.py index 3b77a71b216d4..b1a90c0b112bc 100644 --- a/ci/jobs/scripts/clickhouse_proc.py +++ b/ci/jobs/scripts/clickhouse_proc.py @@ -577,6 +577,20 @@ def start(self, replica_num=0): ) tsan_options = env["TSAN_OPTIONS"] print(f"TSAN_OPTIONS = {tsan_options}") + # With `poison_in_dtor=1` every destructor stores a stack in the MSan stack + # depot. With the default depth of 20 almost every stack is unique, the + # fixed-size depot fills up, and the server slows down during the run. + env["MSAN_OPTIONS"] = " ".join( + filter( + lambda x: x is not None, + [ + env.get("MSAN_OPTIONS", None), + "malloc_context_size=8", + ], + ) + ) + msan_options = env["MSAN_OPTIONS"] + print(f"MSAN_OPTIONS = {msan_options}") proc = subprocess.Popen( command, stderr=subprocess.STDOUT, diff --git a/tests/clickhouse-test b/tests/clickhouse-test index 8c1c6eee366ae..6f896ee7f96b9 100755 --- a/tests/clickhouse-test +++ b/tests/clickhouse-test @@ -3876,6 +3876,8 @@ class TestCase: log_opt = " --client_logs_file=" + self.fatal_sanitizer_prefix + " " client_options += log_opt + # These apply to processes started by the tests (clients, `clickhouse-local`). + # In CI the server gets its sanitizer options in `ci/jobs/scripts/clickhouse_proc.py`. for env_name in [ "TSAN_OPTIONS", "ASAN_OPTIONS",