You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2021/03/25 18:31:27 UTC
[qpid-dispatch] branch master updated: DISPATCH-2011 Add aarch64
.travis.yml job; add HWASAN option (#1077)
This is an automated email from the ASF dual-hosted git repository.
jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 6e107b7 DISPATCH-2011 Add aarch64 .travis.yml job; add HWASAN option (#1077)
6e107b7 is described below
commit 6e107b7db48ed534c4b09a32cc70838a5ce6158e
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Thu Mar 25 19:31:20 2021 +0100
DISPATCH-2011 Add aarch64 .travis.yml job; add HWASAN option (#1077)
---
.travis.yml | 32 ++++++++++++++++++++++++++++++--
README | 9 ++++++++-
cmake/RuntimeChecks.cmake | 17 +++++++++++++----
3 files changed, 51 insertions(+), 7 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 2ed5720..0feca74 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,6 +24,7 @@ jobs:
allow_failures:
- os: osx
- name: "qdrouterd:TSAN"
+ - arch: arm64
include:
- name: "apache-rat:check"
os: linux
@@ -44,7 +45,7 @@ jobs:
after_script:
- cat target/rat.txt || true
# prepending /usr/bin to PATH to avoid mismatched python interpreters in /opt
- - name: "qdrouterd:Debug"
+ - name: "qdrouterd:Debug (gcc on xenial)"
os: linux
env:
- PATH="/usr/bin:$PATH" PROTON_VERSION=master BUILD_TYPE=Debug
@@ -79,6 +80,33 @@ jobs:
- CXX=clang++-11
- PATH="/usr/bin:$PATH" PROTON_VERSION=master BUILD_TYPE=RelWithDebInfo
- DISPATCH_CMAKE_ARGS='-DRUNTIME_CHECK=asan -DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG'
+ - name: "qdrouterd:RelWithDebInfo+MemoryDebug (clang on focal)"
+ arch: arm64
+ os: linux
+ dist: focal
+ compiler: clang
+ python:
+ - "3.9"
+ before_install:
+ - sudo apt-get install clang-11 llvm-11-dev
+ # Install and use the latest Node.js LTS version
+ - nvm install "lts/*"
+ # https://github.com/pypa/virtualenv/issues/1740
+ # https://github.com/pypa/virtualenv/issues/1873
+ - python3 -m pip install --user --upgrade pip
+ - python3 -m pip install --user --upgrade tox virtualenv==20.0.23
+ # 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 AArch64 currently broken https://github.com/grpc/grpc/pull/25363
+ #- python3 -m pip install --user grpcio protobuf
+ env:
+ - CC=clang-11
+ - CXX=clang++-11
+ - PROTON_VERSION=master BUILD_TYPE=RelWithDebInfo
+ - DISPATCH_CMAKE_ARGS='-DRUNTIME_CHECK=asan -DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG -DQD_ENABLE_ASSERTIONS=ON -DDISPATCH_TEST_TIMEOUT=500'
- name: "qdrouterd:Default Build"
os: linux
env:
@@ -148,7 +176,7 @@ install:
# Build and install proton from source.
- mkdir qpid-proton/build
- pushd qpid-proton/build
-- cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX -DBUILD_PYTHON=YES -DBUILD_JAVASCRIPT=NO -DBUILD_CPP=NO -DBUILD_GO=NO -DBUILD_RUBY=NO -DBUILD_PHP=NO -DBUILD_PERL=NO
+- cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_BINDINGS=python
- cmake --build . --target install -- -j $NPROC
- popd
diff --git a/README b/README
index f052aa7..45a4480 100644
--- a/README
+++ b/README
@@ -186,11 +186,18 @@ Applicable only to GCC versions >= 5.4 and Clang versions >= 6.0.
To enable the address sanitizer set the RUNTIME_CHECK build flag to "asan":
-cmake .. -DRUNTIME_CHECK=asan
+cmake .. -DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG -DRUNTIME_CHECK=asan
+
+On Aarch64, a hardware-assisted address sanitizer is enabled with "hwasan":
+
+cmake .. -DCMAKE_C_FLAGS=-DQD_MEMORY_DEBUG -DRUNTIME_CHECK=hwasan
The ASAN (libasan) and UBSAN (libubsan) libraries must be installed in
order to use this option.
+Memory pool will produce false leak reports unless QD_MEMORY_DEBUG
+is also defined.
+
False positive leak errors can be suppressed via the lsan.supp file in
the tests directory.
diff --git a/cmake/RuntimeChecks.cmake b/cmake/RuntimeChecks.cmake
index b2020fd..173ec99 100644
--- a/cmake/RuntimeChecks.cmake
+++ b/cmake/RuntimeChecks.cmake
@@ -24,6 +24,7 @@
#
# -DRUNTIME_CHECK=tsan # turns on thread sanitizer
# -DRUNTIME_CHECK=asan # address and undefined behavior sanitizer
+# -DRUNTIME_CHECK=hwasan # hardware-supported asan for aarch64
# -DRUNTIME_CHECK=memcheck # valgrind memcheck (in progress)
# -DRUNTIME_CHECK=helgrind # valgrind helgrind (in progress)
#
@@ -63,7 +64,7 @@ endmacro()
# Valid options for RUNTIME_CHECK
#
-set(runtime_checks OFF tsan asan memcheck helgrind)
+set(runtime_checks OFF tsan asan hwasan memcheck helgrind)
# Set RUNTIME_CHECK value and deal with the older cmake flags for
# valgrind and TSAN
@@ -95,7 +96,7 @@ elseif(RUNTIME_CHECK STREQUAL "helgrind")
message(STATUS "Runtime race checker: valgrind helgrind")
set(QDROUTERD_RUNNER "${VALGRIND_EXECUTABLE} --tool=helgrind ${VALGRIND_COMMON_ARGS}")
-elseif(RUNTIME_CHECK STREQUAL "asan")
+elseif(RUNTIME_CHECK STREQUAL "asan" OR RUNTIME_CHECK STREQUAL "hwasan")
assert_has_sanitizers()
find_library(ASAN_LIBRARY NAME asan libasan)
if(ASAN_LIBRARY-NOTFOUND)
@@ -105,7 +106,15 @@ elseif(RUNTIME_CHECK STREQUAL "asan")
if(UBSAN_LIBRARY-NOTFOUND)
message(FATAL_ERROR "libubsan not installed - address sanitizer not available")
endif(UBSAN_LIBRARY-NOTFOUND)
- message(STATUS "Runtime memory checker: gcc/clang address sanitizers")
+ if(RUNTIME_CHECK STREQUAL "asan")
+ set(ASAN_VARIANTS "address,undefined")
+ elseif(RUNTIME_CHECK STREQUAL "hwasan")
+ set(ASAN_VARIANTS "hwaddress,undefined")
+ # hwasan currently needs lld, otherwise binaries crash on invalid instruction
+ # https://github.com/google/sanitizers/issues/1241
+ add_link_options("-fuse-ld=lld")
+ endif()
+ message(STATUS "Runtime memory checker: gcc/clang address sanitizers: ${ASAN_VARIANTS}")
option(SANITIZE_3RD_PARTY "Detect leaks in 3rd party libraries used by Dispatch while running tests" OFF)
if (SANITIZE_3RD_PARTY)
add_custom_command(
@@ -124,7 +133,7 @@ elseif(RUNTIME_CHECK STREQUAL "asan")
endif ()
add_custom_target(generate_lsan.supp ALL
DEPENDS ${CMAKE_BINARY_DIR}/tests/lsan.supp)
- set(SANITIZE_FLAGS "-g -fno-omit-frame-pointer -fsanitize=address,undefined")
+ set(SANITIZE_FLAGS "-g -fno-omit-frame-pointer -fsanitize=${ASAN_VARIANTS}")
set(RUNTIME_ASAN_ENV_OPTIONS "detect_leaks=true suppressions=${CMAKE_SOURCE_DIR}/tests/asan.supp")
set(RUNTIME_LSAN_ENV_OPTIONS "suppressions=${CMAKE_BINARY_DIR}/tests/lsan.supp")
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org