From 3512757b8eccc8957f3e4fc248ed191cfba46fff Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Nov 2024 10:10:05 +0100 Subject: [PATCH] CI: user newer OS versions in CI workflow also bump default development container to Ubuntu 24.04 This commit also contains some nitfixes that were detected by the newer CI components. If it is just nitfixes, we do not create separate commits for them. --- .github/workflows/ci_compile.yml | 14 +++++++------ .github/workflows/run_checks.yml | 36 +++++++++++++++++++++++++++++++- contrib/omhttpfs/omhttpfs.c | 4 ++-- devtools/default_dev_container | 2 +- tests/mangle_qi.c | 2 +- tests/test_id.c | 3 +-- tools/logctl.c | 20 ++++++++---------- 7 files changed, 57 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci_compile.yml b/.github/workflows/ci_compile.yml index a0bc3447bf..1839271ced 100644 --- a/.github/workflows/ci_compile.yml +++ b/.github/workflows/ci_compile.yml @@ -1,4 +1,4 @@ -# Copyright 2020 Rainer Gerhards and Others +# Copyright 2024 Rainer Gerhards and Others # # https://github.com/rsyslog/rsyslog-pkg-ubuntu # @@ -30,7 +30,7 @@ on: jobs: run: runs-on: ubuntu-latest - timeout-minutes: 50 + timeout-minutes: 30 strategy: # When set to true, cancel all in-progress jobs if any matrix job fails. fail-fast: false @@ -38,7 +38,7 @@ jobs: # note: we compile only with oldest and newest support compiler to # save ressources. Other important ones are used during the rest of # the check runs (most importantly the distro-default ones). - config: [clang9, clang-14-ndebug, gcc-11-ndebug, gcc8-ndebug, gcc8-debug] + config: [clang9, clang-18-ndebug, gcc-11-ndebug, gcc8-ndebug, gcc8-debug] steps: - name: git checkout project @@ -54,10 +54,10 @@ jobs: export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:20.04' export CC='clang-9' ;; - 'clang14-ndebug') + 'clang18-ndebug') export RSYSLOG_CONFIGURE_OPTIONS_EXTRA='--enable-debug=no' - export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:22.04' - export CC='clang-14' + export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:24.04' + export CC='clang-181' ;; 'gcc8-ndebug') export RSYSLOG_CONFIGURE_OPTIONS_EXTRA='--enable-debug=no' @@ -75,5 +75,7 @@ jobs: export CC='gcc-11' ;; esac + echo CC $CC + echo CFLAGS $CFLAGS devtools/devcontainer.sh --rm devtools/run-configure.sh devtools/devcontainer.sh --rm make -j20 diff --git a/.github/workflows/run_checks.yml b/.github/workflows/run_checks.yml index bd37453c8c..5cb357c830 100644 --- a/.github/workflows/run_checks.yml +++ b/.github/workflows/run_checks.yml @@ -1,4 +1,4 @@ -# Copyright 2022 Rainer Gerhards and Others +# Copyright 2024 Rainer Gerhards and Others # # https://github.com/rsyslog/rsyslog-pkg-ubuntu # @@ -38,6 +38,7 @@ jobs: config: [centos_7, centos_8, debian_10, debian_11, fedora_35, fedora_36, ubuntu_18, ubuntu_20, ubuntu_22, + ubuntu_24_san, ubuntu_24_tsan, ubuntu_22_san, ubuntu_22_tsan, ubuntu_22_distcheck, ubuntu_22_codecov, kafka_codecov, elasticsearch] @@ -155,6 +156,39 @@ jobs: --disable-omkafka --enable-debug --disable-elasticsearch \ --disable-elasticsearch-tests" ;; + 'ubuntu_24_san') + export CI_SANITIZE_BLACKLIST='tests/asan.supp' + export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:24.04' + export CC='clang' + export RSYSLOG_CONFIGURE_OPTIONS_EXTRA="--disable-elasticsearch-tests \ + --disable-libfaketime --without-valgrind-testbench --disable-valgrind \ + --disable-kafka-tests --enable-imdtls --enable-omdtls" + export CFLAGS="-fstack-protector -D_FORTIFY_SOURCE=2 \ + -fsanitize=address,undefined,nullability,unsigned-integer-overflow \ + -fno-sanitize-recover=undefined,nullability,unsigned-integer-overflow \ + -g -O3 -fno-omit-frame-pointer -fno-color-diagnostics" + export LSAN_OPTIONS='detect_leaks=0' + export UBSAN_OPTIONS='print_stacktrace=1' + export CI_MAKE_CHECK_OPT='-j2' + ;; + 'ubuntu_24_tsan') + export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:24.04' + export CI_VALGRIND_SUPPRESSIONS="ubuntu22.04.supp" + export CI_SANITIZE_BLACKLIST='tests/tsan.supp' + export CC='clang' + # impstats has known and OK races + # mmpstrucdata TEMPORARILY disabled because of a threading hang on shutdown + export RSYSLOG_CONFIGURE_OPTIONS_EXTRA="--disable-elasticsearch-tests --enable-imfile-tests \ + --disable-impstats --disable-kafka-tests --disable-mmpstrucdata \ + --disable-clickhouse --disable-clickhouse-tests --disable-kafka-tests \ + --disable-libfaketime --without-valgrind-testbench --disable-valgrind" + export CFLAGS="-std=c11 -g -fstack-protector -D_FORTIFY_SOURCE=2 -fsanitize=thread \ + -O0 -fno-omit-frame-pointer -fno-color-diagnostics" + # note: we need pathes in container, thus /rsyslog vs. $(pwd) in TSAN_OPTIONS + export TSAN_OPTIONS="halt_on_error=1 suppressions=/rsyslog/tests/tsan-rt.supp" + export ABORT_ALL_ON_TEST_FAIL='YES' + export CI_MAKE_CHECK_OPT='-j1' + ;; 'kafka_codecov') export RSYSLOG_DEV_CONTAINER='rsyslog/rsyslog_dev_base_ubuntu:22.04' export CI_VALGRIND_SUPPRESSIONS="ubuntu22.04.supp" diff --git a/contrib/omhttpfs/omhttpfs.c b/contrib/omhttpfs/omhttpfs.c index 1bdacf6eb4..8b7f38088a 100644 --- a/contrib/omhttpfs/omhttpfs.c +++ b/contrib/omhttpfs/omhttpfs.c @@ -255,7 +255,7 @@ static void httpfs_curl_set_put(CURL* curl) curl_easy_setopt(curl, CURLOPT_HTTPGET, 0L); curl_easy_setopt(curl, CURLOPT_NOBODY, 0L); curl_easy_setopt(curl, CURLOPT_POST, 0L); - curl_easy_setopt(curl, CURLOPT_PUT, 0L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 0L); curl_easy_setopt(curl, CURLOPT_UPLOAD, 0L); curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT"); @@ -270,7 +270,7 @@ static void httpfs_curl_set_post(CURL* curl) { curl_easy_setopt(curl, CURLOPT_HTTPGET, 0L); curl_easy_setopt(curl, CURLOPT_NOBODY, 0L); - curl_easy_setopt(curl, CURLOPT_PUT, 0L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 0L); curl_easy_setopt(curl, CURLOPT_UPLOAD, 0L); curl_easy_setopt(curl, CURLOPT_POST, 1L); diff --git a/devtools/default_dev_container b/devtools/default_dev_container index 77fe374522..ae8211d953 100644 --- a/devtools/default_dev_container +++ b/devtools/default_dev_container @@ -1 +1 @@ -rsyslog/rsyslog_dev_base_ubuntu:20.04 +rsyslog/rsyslog_dev_base_ubuntu:24.04 diff --git a/tests/mangle_qi.c b/tests/mangle_qi.c index 3775c962cc..f7a659ce46 100644 --- a/tests/mangle_qi.c +++ b/tests/mangle_qi.c @@ -30,7 +30,7 @@ processQI(FILE *const __restrict__ qi) int queuesize; int i; int c; - fgets(lnbuf, sizeof(lnbuf), qi); + (void) fgets(lnbuf, sizeof(lnbuf), qi); fputs(lnbuf, stdout); /* we now read the queue size line */ /* note: this is quick and dirty, no error checks diff --git a/tests/test_id.c b/tests/test_id.c index 326ad3ff0e..6069df404c 100644 --- a/tests/test_id.c +++ b/tests/test_id.c @@ -27,8 +27,7 @@ hash_from_string(void *k) int main(int argc, char *argv[]) { struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); if(argc != 2) { fprintf(stderr, "usage: test_id test-file-name\n"); exit(1); diff --git a/tools/logctl.c b/tools/logctl.c index 1010409c89..3ef54266d6 100644 --- a/tools/logctl.c +++ b/tools/logctl.c @@ -52,20 +52,18 @@ #include #include +#include "rsyslog.h" /* we need this to avoid issues with older versions of libbson */ -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpragmas" -#pragma GCC diagnostic ignored "-Wunknown-attributes" -#pragma GCC diagnostic ignored "-Wexpansion-to-defined" -#pragma GCC diagnostic ignored "-Wstrict-prototypes" -#pragma GCC diagnostic ignored "-Wold-style-definition" -#endif +PRAGMA_DIAGNOSTIC_PUSH +PRAGMA_IGNORE_Wpragmas +PRAGMA_IGNORE_Wunknown_warning_option +PRAGMA_IGNORE_Wunknown_attribute +PRAGMA_IGNORE_Wexpansion_to_defined +PRAGMA_IGNORE_Wstrict_prototypes +PRAGMA_IGNORE_Wold_style_definition #include #include -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif +PRAGMA_DIAGNOSTIC_POP #define N 80