From d7b4a467f943daa39ee7e947c7cb09bf32d7ecde Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Fri, 6 May 2022 19:10:16 -0400 Subject: [PATCH] workflows: test with address sanitizer to catch memory safety issues This enables address sanitizer for CI debug builds on all distributions, which has proven useful in tracing undefined behaviour that only occurs on an arbitrary but reproducible subset of distributions. See https://github.com/intel/fpga-runtime-for-opencl/issues/194 Signed-off-by: Peter Colberg --- .github/workflows/build-linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 1bc9d918..37e9aaf2 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -91,8 +91,9 @@ jobs: - name: create build files run: | + test ${{ matrix.config }} = Debug && ASAN=1 cd build - cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=/fpga-runtime-for-opencl -DCMAKE_INSTALL_LIBDIR=lib + cmake -G Ninja .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=/fpga-runtime-for-opencl -DCMAKE_INSTALL_LIBDIR=lib ${ASAN:+-DACL_WITH_ASAN=ON} env: CC: ${{ matrix.cross }}gcc CXX: ${{ matrix.cross }}g++