Enable a seconary allocator support (e.g. GWP-Asan) (#737)

This commit is contained in:
Schrodinger ZHU Yifan
2025-02-05 17:03:11 +08:00
committed by GitHub
parent 32495fd42d
commit 16b96245f6
12 changed files with 290 additions and 33 deletions

View File

@@ -542,7 +542,52 @@ jobs:
run: |
cd ${{github.workspace}}/build
ctest --parallel
gwp-asan:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
profile: [RelWithDebInfo, Debug]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Ninja
run: |
sudo apt-get install -y ninja-build
- name: Install Compiler-RT
shell: bash
run: |
cd ..
git clone https://github.com/llvm/llvm-project --depth=1 -b llvmorg-19.1.7
mkdir compiler-rt
cmake -G Ninja \
-S llvm-project/runtimes \
-B llvm-project/build \
-DCMAKE_BUILD_TYPE=${{ matrix.profile }}\
-DLLVM_ENABLE_RUNTIMES=compiler-rt \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_INSTALL_PREFIX=$(realpath compiler-rt)
cmake --build llvm-project/build --parallel
cmake --build llvm-project/build --target=install
- name: Configure SnMalloc
run: >
cmake -GNinja
-B${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{ matrix.profile }}
-DCMAKE_CXX_COMPILER=clang++-18
-DCMAKE_C_COMPILER=clang-18
-DSNMALLOC_ENABLE_GWP_ASAN_INTEGRATION=On
-DSNMALLOC_GWP_ASAN_INCLUDE_PATH=${{github.workspace}}/../llvm-project/compiler-rt/lib
-DSNMALLOC_GWP_ASAN_LIBRARY_PATH=${{github.workspace}}/../compiler-rt/lib/linux
- name: Build
run: cmake --build ${{github.workspace}}/build --parallel
- name: Test
run: |
cd ${{github.workspace}}/build
ctest --parallel --output-on-failure
all-checks:
# Currently FreeBSD and NetBSD CI are not working, so we do not require them to pass.
# Add fuzzing back when the memove issue is fixed.