From e6c90ddec3113aa72f6a27645ff72fb1e7b392b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Fri, 5 Aug 2022 20:29:21 +0200 Subject: [PATCH] Enable s390x Travis CI build; Add coredump analyzer for Travis (#654) * [travis] Install PyPI packages from requirements-dev.txt * [travis] Install test dependencies * [travis] Add coredump analyzer * DISPATCH-2196 Fix compile options for c_unittests on s390x * Document the -DSANITIZE_PYTHON=OFF CMake option * [travis] Disable Python leak sanitization (Travis has Python 3.8) * [travis] Remove QPID_SYSTEM_TEST_SKIP_HTTP2_LARGE_IMAGE_UPLOAD_TEST suppression * [travis] Fix broken quart * [travis] skip grpcio pypi install on s390x because it fails * require new websockets * disallow s390x failure! * lower requirements for python 3.6 --- .travis.yml | 11 +++++++++-- CMakeLists.txt | 8 +++++++- README.adoc | 4 ++++ requirements-dev.txt | 4 ++-- scripts/travisci_build.sh | 9 ++------- tests/c_unittests/CMakeLists.txt | 7 ------- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69c6ee3d0..1528335ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,6 @@ jobs: allow_failures: - arch: arm64 - arch: ppc64le - - arch: s390x exclude: - arch: s390x env: RUNTIME_CHECK=tsan QD_ENABLE_ASSERTIONS=OFF @@ -60,5 +59,13 @@ addons: - libwebsockets-dev # code coverage - lcov + # tests + - curl + - ncat + # coredump analysis + - gdb -script: scripts/travisci_build.sh +script: + - ulimit -c unlimited + - scripts/travisci_build.sh + - find -name 'core' -exec ${TRAVIS_BUILD_DIR}/scripts/gha_analyze_coredump.sh {} \; diff --git a/CMakeLists.txt b/CMakeLists.txt index f2c7daf78..17637cf36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,13 @@ set(QPID_DISPATCH_CONFDIR ${SYSCONF_INSTALL_DIR}/skupper-router) # Set up runtime checks (valgrind, sanitizers etc.) include(cmake/RuntimeChecks.cmake) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZE_FLAGS}") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_FLAGS}") +# DISPATCH-2196 Linking object files containing instances of the same C++ template fails on s390x with sanitizers enabled +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x") + # set the sanitizer flags only for linking, not for compilation; this workarounds the failure + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}") +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_FLAGS}") +endif() ## ## Include directories used by all sub-directories. diff --git a/README.adoc b/README.adoc index 05a4f9d67..34dc0153f 100644 --- a/README.adoc +++ b/README.adoc @@ -351,6 +351,10 @@ Other options include `Debug` (disables optimizations) and `Coverage`. |`-DRUNTIME_CHECK=` |Enables C/C++ runtime checkers. See "Run Time Validation" chapter above. +|`-DSANITIZE_PYTHON=OFF` +|Enables Leak Sanitizer suppressions for libpython3. +Use it to disable sanitization with older Python version (< 3.9). + |`-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON` |With CMake 3.9+, compiles the project with LTO (Link Time Optimization) enabled. Older versions of `CMake`` only honor this option with the Intel compiler on Linux. diff --git a/requirements-dev.txt b/requirements-dev.txt index 248488824..03e456868 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -32,10 +32,10 @@ pytest pytest-instafail pytest-timeout -grpcio +grpcio; platform_machine != 's390x' h2 protobuf quart selectors -websockets +websockets>=9.1 psutil diff --git a/scripts/travisci_build.sh b/scripts/travisci_build.sh index 2021e08c0..af0a4d93e 100755 --- a/scripts/travisci_build.sh +++ b/scripts/travisci_build.sh @@ -26,12 +26,11 @@ set -Exeuo pipefail # PREFIX=$PWD/install -DISPATCH_CMAKE_ARGS="-DRUNTIME_CHECK=${RUNTIME_CHECK} -DQD_ENABLE_ASSERTIONS=${QD_ENABLE_ASSERTIONS} -DDISPATCH_TEST_TIMEOUT=500" +DISPATCH_CMAKE_ARGS="-DRUNTIME_CHECK=${RUNTIME_CHECK} -DQD_ENABLE_ASSERTIONS=${QD_ENABLE_ASSERTIONS} -DDISPATCH_TEST_TIMEOUT=500 -DSANITIZE_PYTHON=OFF" DISPATCH_CTEST_EXTRA='-E ^python-checker$' export NPROC=3 export QPID_SYSTEM_TEST_TIMEOUT=300 export QPID_SYSTEM_TEST_SKIP_FALLBACK_SWITCHOVER_TEST=True -export QPID_SYSTEM_TEST_SKIP_HTTP2_LARGE_IMAGE_UPLOAD_TEST=True echo '===' echo 'Install additional prerequisites' @@ -44,11 +43,6 @@ fi # Update pip, it may prevent issues later python3 -m pip install --user --upgrade pip -python3 -m pip install --user tox virtualenv -# Install quart to run the http2 tests. -python3 -m pip install --user quart -# DISPATCH-1883: Install selectors to run tcp echo server/client tools -python3 -m pip install --user selectors # Install grpcio and protobuf to run the grpc tests. # Installation on s390x currently broken https://github.com/grpc/grpc/pull/25363 # Binary wheel is not available in PyPI for s390x and source install requires fetching git submodules first @@ -58,6 +52,7 @@ else python3 -m pip install --user protobuf sudo apt install python3-grpcio fi +python3 -m pip install --user --ignore-installed -r requirements-dev.txt echo '===' echo 'Build and install qpid-proton from source' diff --git a/tests/c_unittests/CMakeLists.txt b/tests/c_unittests/CMakeLists.txt index 25db46df8..1cee1645f 100644 --- a/tests/c_unittests/CMakeLists.txt +++ b/tests/c_unittests/CMakeLists.txt @@ -20,13 +20,6 @@ # -fno-inline: just to be extra sure, no particular reason so far # -fno-builtin: GCC would optimize e.g. abs() and we would not be able to stub set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STANDARD_FLAGS} -fno-inline -fno-builtin -fno-stack-protector") -# DISPATCH-2196 Linking object files containing instances of the same C++ template fails on s390x with sanitizers enabled -if(CMAKE_SYSTEM_PROCESSOR STREQUAL "s390x") - # set the sanitizer flags only for linking, not for compilation; this workarounds the failure - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZE_FLAGS}") -endif() add_library(static_accessors_server_c SHARED static_accessors_server_c.c)