From 01248650be61fa7b27fa03c85ce6d858af7f84f9 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Wed, 16 Oct 2024 13:04:13 +0200 Subject: [PATCH 1/2] Revert "Temporarily comment out tests that are clogging the CI" This reverts commit 50d7579dd1230e4e77c2a6e14ea8c75110cd4bcb. Signed-off-by: Valerio Setti --- tests/suites/test_suite_pkwrite.data | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/suites/test_suite_pkwrite.data b/tests/suites/test_suite_pkwrite.data index d333dddb79..62c3e8d9ed 100644 --- a/tests/suites/test_suite_pkwrite.data +++ b/tests/suites/test_suite_pkwrite.data @@ -30,16 +30,13 @@ Public key write check EC 521 bits (DER) depends_on:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_ECP_HAVE_SECP521R1 pk_write_pubkey_check:"../framework/data_files/ec_521_pub.der":TEST_DER -## The pk_write_pubkey_check sometimes take ~3 hours to run with -## GCC+Asan on the CI in the full config. Comment out the slowest -## ones while we investigate and release 3.6.2. -# Public key write check EC Brainpool 512 bits -# depends_on:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_PEM_PARSE_C:MBEDTLS_PEM_WRITE_C:MBEDTLS_ECP_HAVE_BP512R1 -# pk_write_pubkey_check:"../framework/data_files/ec_bp512_pub.pem":TEST_PEM +Public key write check EC Brainpool 512 bits +depends_on:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_PEM_PARSE_C:MBEDTLS_PEM_WRITE_C:MBEDTLS_ECP_HAVE_BP512R1 +pk_write_pubkey_check:"../framework/data_files/ec_bp512_pub.pem":TEST_PEM -# Public key write check EC Brainpool 512 bits (DER) -# depends_on:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_ECP_HAVE_BP512R1 -# pk_write_pubkey_check:"../framework/data_files/ec_bp512_pub.der":TEST_DER +Public key write check EC Brainpool 512 bits (DER) +depends_on:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_ECP_HAVE_BP512R1 +pk_write_pubkey_check:"../framework/data_files/ec_bp512_pub.der":TEST_DER Public key write check EC X25519 depends_on:MBEDTLS_PK_HAVE_ECC_KEYS:MBEDTLS_PEM_PARSE_C:MBEDTLS_PEM_WRITE_C:MBEDTLS_ECP_HAVE_CURVE25519 From bdca1fe3375d0e0117516a56067776c2a3c19705 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Wed, 16 Oct 2024 13:28:44 +0200 Subject: [PATCH 2/2] CMakeLists: use -O2 as ASAN_FLAG only in GCC versions before 7.0 Since the bug affecting the performance only affects GCC versions before 7.0, use -O2 flag instead of -O3 for them and keep the better optimization for newer compilers. Signed-off-by: Valerio Setti --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc85ae7b83..6c1058059a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,9 +235,15 @@ if(CMAKE_COMPILER_IS_GNU) # test_suite_pkwrite taking >3h on the CI. Observed with GCC 5.4 on # Ubuntu 16.04 x86_64 and GCC 6.5 on Ubuntu 18.04 x86_64. # GCC 7.5 and above on Ubuntu 18.04 appear fine. - # To avoid the performance problem, we use -O2 here. It doesn't slow - # down much even with modern compiler versions. - set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O2") + # To avoid the performance problem, we use -O2 when GCC version is lower than 7.0. + # It doesn't slow down much even with modern compiler versions. + if (GCC_VERSION VERSION_LESS 7.0) + message(STATUS "USING O2") + set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O2") + else() + message(STATUS "USING O3") + set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3") + endif() set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls") set(CMAKE_C_FLAGS_TSAN "-fsanitize=thread -O3") set(CMAKE_C_FLAGS_TSANDBG "-fsanitize=thread -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")