Skip to content

Commit a8ae529

Browse files
authored
Merge pull request #42 from eisenhauer/add-msan-ci
Add MemorySanitizer CI build
2 parents fe13594 + b78247f commit a8ae529

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,39 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18+
# MemorySanitizer build to detect uninitialized memory reads
19+
msan:
20+
timeout-minutes: 30
21+
runs-on: ubuntu-24.04
22+
env:
23+
CC: clang
24+
CXX: clang++
25+
MSAN_FLAGS: "-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer"
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Install dependencies
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y clang llvm cmake ninja-build
34+
35+
- name: Configure with MSan
36+
run: |
37+
cmake -G Ninja -S . -B build \
38+
-DCMAKE_C_FLAGS="${MSAN_FLAGS}" \
39+
-DCMAKE_CXX_FLAGS="${MSAN_FLAGS}" \
40+
-DCMAKE_EXE_LINKER_FLAGS="${MSAN_FLAGS}" \
41+
-DCMAKE_SHARED_LINKER_FLAGS="${MSAN_FLAGS}" \
42+
-DCMAKE_BUILD_TYPE=Debug \
43+
-DBUILD_TESTING=ON
44+
45+
- name: Build
46+
run: ninja -C build
47+
48+
- name: Test
49+
run: ctest --test-dir build --output-on-failure
50+
1851
linux:
1952
# The jobs should run pretty quick; anything over 30m essentially means
2053
# someting is stuck somewhere

0 commit comments

Comments
 (0)