From e0baf882bb1cfef1d0d20370de392fcd512b1fae Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 3 Jun 2024 21:26:38 -0700 Subject: [PATCH] reduce UBSAN parameters to stay within pipeline limits --- CMakeLists.txt | 1 + test/test-stress.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f19bf90..7a730557 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,6 +258,7 @@ if(MI_DEBUG_UBSAN) if(CMAKE_BUILD_TYPE MATCHES "Debug") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(STATUS "Build with undefined-behavior sanitizer (MI_DEBUG_UBSAN=ON)") + list(APPEND mi_defines MI_UBSAN=1) list(APPEND mi_cflags -fsanitize=undefined -g -fno-sanitize-recover=undefined) list(APPEND mi_libraries -fsanitize=undefined) if (NOT MI_USE_CXX) diff --git a/test/test-stress.c b/test/test-stress.c index 0dfa1668..f9b3c9d6 100644 --- a/test/test-stress.c +++ b/test/test-stress.c @@ -25,14 +25,18 @@ terms of the MIT license. // > mimalloc-test-stress [THREADS] [SCALE] [ITER] // // argument defaults -#if !defined(MI_TSAN) +#if defined(MI_TSAN) // with thread-sanitizer reduce the threads to test within the azure pipeline limits +static int THREADS = 8; +static int SCALE = 25; +static int ITER = 200; +#elif defined(MI_UBSAN) // with undefined behavious sanitizer reduce parameters to stay within the azure pipeline limits +static int THREADS = 8; +static int SCALE = 25; +static int ITER = 20; +#else static int THREADS = 32; // more repeatable if THREADS <= #processors static int SCALE = 25; // scaling factor static int ITER = 50; // N full iterations destructing and re-creating all threads -#else // with thread-sanitizer reduce the threads to test within the azure pipeline limits -static int THREADS = 8; -static int SCALE = 25; // scaling factor -static int ITER = 200; // N full iterations destructing and re-creating all threads #endif