-
Notifications
You must be signed in to change notification settings - Fork 10
109 lines (101 loc) · 4.57 KB
/
linux_asan_ubsan_lsan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Copyright (c) 2024 ETH Zurich
# Copyright (c) 2020 EXASOL
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
name: Linux CI (asan/ubsan/lsan)
on:
merge_group:
pull_request:
push:
branches:
# Development and release branches
- main
- release**
jobs:
build:
name: github/linux/sanitizers/address-undefined-leak
runs-on: ubuntu-24.04
container:
image: pikaorg/pika-ci-base:28
# --privileged is enabled for sysctl further down.
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Update apt repositories for ccache
run: apt update
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-linux-sanitizers-address-undefined-leak
- name: Configure
shell: bash
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Debug \
-DPIKA_WITH_MALLOC=system \
-DPIKA_WITH_MPI=ON \
-DPIKA_WITH_EXAMPLES=ON \
-DPIKA_WITH_TESTS=ON \
-DPIKA_WITH_TESTS_EXAMPLES=ON \
-DPIKA_WITH_TESTS_HEADERS=OFF \
-DPIKA_WITH_TESTS_MAX_THREADS=$(nproc) \
-DPIKA_WITH_COMPILER_WARNINGS=ON \
-DPIKA_WITH_COMPILER_WARNINGS_AS_ERRORS=ON \
-DPIKA_WITH_SANITIZERS=On \
-DPIKA_WITH_VERIFY_LOCKS=Off \
-DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=undefined -fno-omit-frame-pointer -Wno-error=ignored-optimization-argument" \
-DPIKA_WITH_STACKOVERFLOW_DETECTION=Off \
-DPIKA_WITH_CHECK_MODULE_DEPENDENCIES=On
- name: Build
if: always()
shell: bash
run: |
cmake --build build --target examples
cmake --build build --target tests
- name: Test
if: always()
shell: bash
run: |
# Newer GitHub actions runners increased the number of bits used for address space
# layout randomization to a higher number such that thread sanitizer breaks. Newer
# versions of LLVM (17 and newer) should fix this again.
# https://github.com/google/sanitizers/issues/1716
# https://github.com/actions/runner-images/issues/9491
sysctl --write vm.mmap_rnd_bits=28
# We are certain that we want to run mpiexec as root despite warnings as that is the
# only user available in the container. Mistakes will only affect the current step.
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
export ASAN_OPTIONS=fast_unwind_on_malloc=0:strict_string_checks=1:detect_leaks=1:detect_stack_use_after_return=0:check_initialization_order=1:strict_init_order=1:suppressions=$PWD/tools/asan.supp
export UBSAN_OPTIONS=print_stacktrace=1:suppressions=$PWD/tools/ubsan.supp
export LSAN_OPTIONS=suppressions=$PWD/tools/lsan.supp
cd build
ctest \
--timeout 120 \
--output-on-failure \
-E "$(${GITHUB_WORKSPACE}/.github/blacklist_to_ctest_regex.sh ${GITHUB_WORKSPACE}/.github/workflows/linux_asan_ubsan_lsan_blacklist.txt)"
- name: Test blacklisted tests
if: always()
continue-on-error: true
shell: bash
run: |
# See above.
sysctl --write vm.mmap_rnd_bits=28
# We are certain that we want to run mpiexec as root despite warnings as that is the
# only user available in the container. Mistakes will only affect the current step.
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
export ASAN_OPTIONS=fast_unwind_on_malloc=0:strict_string_checks=1:detect_leaks=1:detect_stack_use_after_return=0:check_initialization_order=1:strict_init_order=1:suppressions=$PWD/tools/asan.supp
export UBSAN_OPTIONS=print_stacktrace=1:suppressions=$PWD/tools/ubsan.supp
export LSAN_OPTIONS=suppressions=$PWD/tools/lsan.supp
cd build
ctest \
--timeout 120 \
--output-on-failure \
-R "$(${GITHUB_WORKSPACE}/.github/blacklist_to_ctest_regex.sh ${GITHUB_WORKSPACE}/.github/workflows/linux_asan_ubsan_lsan_blacklist.txt)"