Skip to content

Commit 0b5b9d5

Browse files
authored
Merge pull request #596 from elbeno/enable-sanitizers
👷 Fix GCC sanitizers
2 parents 12f434a + f401538 commit 0b5b9d5

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/unit_tests.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,18 @@ jobs:
222222
fail-fast: false
223223
matrix:
224224
sanitizer: [undefined, address, thread]
225-
compiler: [clang]
225+
compiler: [clang, gcc]
226226
include:
227227
- compiler: clang
228228
cc: "clang"
229229
cxx: "clang++"
230230
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18
231231
toolchain_root: "/usr/lib/llvm-18"
232+
- compiler: gcc
233+
cc: "gcc-13"
234+
cxx: "g++-13"
235+
install: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt-get install -y gcc-13 g++-13
236+
toolchain_root: "/usr"
232237

233238
steps:
234239
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -265,6 +270,13 @@ jobs:
265270
path: ~/cpm-cache
266271
key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
267272

273+
# https://github.com/actions/runner-images/issues/9524
274+
- name: Fix kernel mmap rnd bits
275+
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
276+
# high-entropy ASLR in much newer kernels that GitHub runners are
277+
# using leading to random crashes: https://reviews.llvm.org/D148280
278+
run: sudo sysctl vm.mmap_rnd_bits=28
279+
268280
- name: Build Unit Tests
269281
run: cmake --build ${{github.workspace}}/build -t unit_tests
270282

@@ -274,7 +286,9 @@ jobs:
274286
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
275287

276288
- name: Install build tools
277-
run: sudo apt update && sudo apt install -y gcc-${{env.DEFAULT_GCC_VERSION}} g++-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind
289+
run: |
290+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
291+
sudo apt update && sudo apt-get install -y gcc-${{env.DEFAULT_GCC_VERSION}} g++-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind
278292
279293
- name: Restore CPM cache
280294
env:

0 commit comments

Comments
 (0)