Skip to content

Commit dd579fc

Browse files
committed
ci: isolate sanitizer flags per matrix job
1 parent 77f2ba0 commit dd579fc

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,29 @@ jobs:
122122
CC: clang-18
123123
CXX: clang++-18
124124
run: |
125+
SAN="${{ matrix.sanitizer }}"
126+
EXTRA_SANITIZER_FLAGS="-DMETAGRAPH_SANITIZERS=ON"
127+
128+
case "$SAN" in
129+
address)
130+
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=ON -DMETAGRAPH_UBSAN=ON -DMETAGRAPH_TSAN=OFF -DMETAGRAPH_MSAN=OFF"
131+
;;
132+
undefined)
133+
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=OFF -DMETAGRAPH_UBSAN=ON -DMETAGRAPH_TSAN=OFF -DMETAGRAPH_MSAN=OFF"
134+
;;
135+
thread)
136+
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=OFF -DMETAGRAPH_UBSAN=OFF -DMETAGRAPH_TSAN=ON -DMETAGRAPH_MSAN=OFF"
137+
;;
138+
memory)
139+
EXTRA_SANITIZER_FLAGS="$EXTRA_SANITIZER_FLAGS -DMETAGRAPH_ASAN=OFF -DMETAGRAPH_UBSAN=OFF -DMETAGRAPH_TSAN=OFF -DMETAGRAPH_MSAN=ON"
140+
;;
141+
esac
142+
125143
cmake -B build -G Ninja \
126144
-DCMAKE_BUILD_TYPE=Debug \
127-
-DMETAGRAPH_SANITIZERS=ON \
128-
-DCMAKE_C_FLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer" \
129-
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}"
145+
${EXTRA_SANITIZER_FLAGS} \
146+
-DCMAKE_C_FLAGS="-fsanitize=${SAN} -fno-omit-frame-pointer" \
147+
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${SAN}"
130148
131149
- name: Build
132150
run: cmake --build build

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ See [docs/guides/DEBRIEF_FORMAT.md](docs/guides/DEBRIEF_FORMAT.md) for the JSONL
105105
{"date":"2025-10-20","time":"13:42","summary":"Hardened release builds with full stack canaries to satisfy CI security audit stack check.","topics":[{"topic":"Security audit parity","what":"Replaced -fstack-protector-strong with -fstack-protector-all","why":"Quality Matrix security audit marked stack canaries as disabled on the Linux runner","context":"Audit script checks mg-cli binary for __stack_chk_fail symbol","issue":"strong mode doesn’t emit canaries when functions lack risky frames","resolution":"Always request -fstack-protector-all so the guard symbol is emitted","future_work":"Monitor audit output on the next CI cycle","time_percent":100}],"key_decisions":[],"action_items":[]}
106106
{"date":"2025-10-20","time":"15:12","summary":"Taught the security audit to recognize safe-stack builds and dump details when failing in CI.","topics":[{"topic":"Audit false positive","what":"Detect __safestack_unsafe_stack_ptr alongside __stack_chk_fail","why":"Linux Release builds use Clang safe-stack so the previous detector flagged stack canaries as missing","context":"Quality Matrix security audit kept aborting despite hardening flags","issue":"Audit only looked for __stack_chk_fail which isn’t emitted with safe-stack","resolution":"Count either symbol and continue to report stack protection as enabled","future_work":"Keep an eye on future toolchain upgrades in case symbol names change","time_percent":70},{"topic":"CI diagnostics","what":"Emit the full .ignored/security-audit.txt before exiting","why":"Artifact upload isn’t always reliable, making it hard to inspect failures","context":"GitHub Actions quality matrix","issue":"Engineers could not see what triggered the critical flag","resolution":"Surface the report inline when the script exits non-zero","future_work":"None","time_percent":30}],"key_decisions":[],"action_items":[]}
107107
{"date":"2025-10-20","time":"15:55","summary":"Closed the loop on clang-tidy’s implicit-bool complaint by reinstating the explicit cast and confirmed the audit now reports PIE correctly in CI.","topics":[{"topic":"Digits buffer assert","what":"Restored the (_Bool) cast in the _Static_assert guarding the 64-byte scratch array","why":"GNU-GON-CRY clang-tidy treats int-to-bool conversions as errors","context":"readability-implicit-bool-conversion flagged the newer form","issue":"CI failed after removing the cast","resolution":"Reintroduced the explicit cast to satisfy the lint rule","future_work":"None","time_percent":60},{"topic":"CI audit parity","what":"Verified the updated PIE detection logic against the build artifacts","why":"Ensure Linux release jobs stop flagging false negatives","context":"Security audit now prints the report inline on failure","issue":"Needed a local run to confirm","resolution":"Ran the audit targeting build/ and observed PIE marked enabled","future_work":"Monitor the next Quality Matrix run","time_percent":40}],"key_decisions":[],"action_items":[]}
108+
{"date":"2025-10-20","time":"11:35","summary":"Unblocked the sanitizer CI leg by disabling conflicting ASAN flags when running the MSAN job.","topics":[{"topic":"Sanitizer matrix","what":"Gated METAGRAPH_*SAN toggles per workflow matrix leg","why":"CI memory sanitizer run failed because both -fsanitize=memory and -fsanitize=address were set","context":"GitHub Actions sanitizers job on feat/minimal-dpoi-qca-loop","issue":"ASAN defaults stayed enabled when requesting MSAN, causing clang to reject the flag combination","resolution":"Updated ci.yml to map each matrix entry to explicit METAGRAPH_{A,U,T,M}SAN settings before invoking CMake","future_work":"Watch the next CI cycle in case MSAN still lacks instrumented runtimes","time_percent":100}],"key_decisions":["Disable ASAN/UBSAN when invoking the MSAN and TSAN legs"],"action_items":[]}
108109
```

0 commit comments

Comments
 (0)