From b28e0dd68958da96978a054195aefe19db2262a0 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 17 Dec 2021 21:29:01 +0300 Subject: [PATCH] 01502_jemalloc_percpu_arena: add a test with MALLOC_CONF=abort_conf:true --- .../01502_jemalloc_percpu_arena.reference | 1 + .../0_stateless/01502_jemalloc_percpu_arena.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/queries/0_stateless/01502_jemalloc_percpu_arena.reference b/tests/queries/0_stateless/01502_jemalloc_percpu_arena.reference index d00491fd7e5..c921182a092 100644 --- a/tests/queries/0_stateless/01502_jemalloc_percpu_arena.reference +++ b/tests/queries/0_stateless/01502_jemalloc_percpu_arena.reference @@ -1 +1,2 @@ 1 +: Number of CPUs is not deterministic diff --git a/tests/queries/0_stateless/01502_jemalloc_percpu_arena.sh b/tests/queries/0_stateless/01502_jemalloc_percpu_arena.sh index c2bf029dde9..2abd6593cd9 100755 --- a/tests/queries/0_stateless/01502_jemalloc_percpu_arena.sh +++ b/tests/queries/0_stateless/01502_jemalloc_percpu_arena.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Tags: no-tsan, no-asan, no-msan, no-ubsan +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# NOTE: jemalloc is disabled under sanitizers CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) # shellcheck source=../shell_config.sh @@ -6,6 +9,9 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ncpus="$(getconf _NPROCESSORS_ONLN)" +# In debug build abort_conf:true is set by default, disable it explicitly +export MALLOC_CONF=abort_conf:false + # Regression for: # # $ taskset --cpu-list 8 ./clickhouse local -q 'select 1' @@ -14,3 +20,11 @@ ncpus="$(getconf _NPROCESSORS_ONLN)" taskset --cpu-list $((ncpus-1)) ${CLICKHOUSE_LOCAL} -q 'select 1' # just in case something more complicated taskset --cpu-list $((ncpus-1)) ${CLICKHOUSE_LOCAL} -q 'select * from numbers_mt(100000000) settings max_threads=100 FORMAT Null' + +# this command should fail because percpu arena will be disabled, +# and with abort_conf:true it is not allowed +( + # subshell is required to suppress "Aborted" message from the shell. + MALLOC_CONF=abort_conf:true + taskset --cpu-list $((ncpus-1)) ${CLICKHOUSE_LOCAL} -q 'select 1' +) |& grep -F 'Number of CPUs is not deterministic'