Skip to content

Add ASAN/UBSAN CI testing and fix signed left shift UB#399

Merged
ekilmer merged 5 commits intomasterfrom
ekilmer/run-asan-v2
Feb 25, 2026
Merged

Add ASAN/UBSAN CI testing and fix signed left shift UB#399
ekilmer merged 5 commits intomasterfrom
ekilmer/run-asan-v2

Conversation

@ekilmer
Copy link
Contributor

@ekilmer ekilmer commented Feb 25, 2026

Add a sanitizer CI job that builds and tests with AddressSanitizer and UndefinedBehaviorSanitizer using clang on Ubuntu for both stable and HEAD release tracks.

Fix three UBSAN signed left shift errors found during sanitizer testing by casting signed values to unsigned before left shifting:

  • address.hh sign_extend(): left shift of negative value / overflow
  • slghpatexpress.cc LeftShiftExpression: left shift of negative value

ekilmer and others added 2 commits February 25, 2026 21:16
Add a sanitizer CI job that builds and tests with AddressSanitizer and
UndefinedBehaviorSanitizer using clang on Ubuntu for both stable and
HEAD release tracks.

Fix three UBSAN signed left shift errors found during sanitizer testing
by casting signed values to unsigned before left shifting:
- address.hh sign_extend(): left shift of negative value / overflow
- slghpatexpress.cc LeftShiftExpression: left shift of negative value

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a ci-assertions CMake preset that builds with libc++ in debug
hardening mode (_LIBCPP_HARDENING_MODE_DEBUG), which catches STL
contract violations at runtime — most importantly strict-weak ordering
violations in comparators passed to std::sort.

Add a corresponding assertions CI job that runs HEAD-only, since new
comparator bugs from upstream Ghidra surface there first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ekilmer ekilmer force-pushed the ekilmer/run-asan-v2 branch 2 times, most recently from 4272304 to 67be5ff Compare February 25, 2026 21:30
ekilmer and others added 2 commits February 25, 2026 22:02
Use the official LLVM apt script to install clang rather than relying
on whichever version happens to ship on the runner. The version is
configured via a workflow-level LLVM_VERSION env variable (currently 21)
so bumping is a one-line change.

The assertions job also installs the matching versioned libc++-dev and
libc++abi-dev packages.

Remove CMAKE_CXX_COMPILER from the ci-assertions preset so the CXX
environment variable is respected by CMake in both CI and local use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The sanitizer and assertions CI jobs provide more useful Debug-like
coverage on Linux than a plain Debug build. Keep Debug builds only for
Windows where sanitizers are not available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ekilmer ekilmer force-pushed the ekilmer/run-asan-v2 branch from 67be5ff to f696911 Compare February 25, 2026 22:05
Port the existing HEAD patch (0007) to stable as well.
FlowBlock::compareFinalOrder returns true when both blocks have
index 0, violating strict weak ordering irreflexivity. This is
caught by the libc++ assertions CI job.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ekilmer ekilmer merged commit 6ecd80e into master Feb 25, 2026
17 checks passed
@ekilmer ekilmer deleted the ekilmer/run-asan-v2 branch February 25, 2026 23:05
@ekilmer ekilmer mentioned this pull request Feb 25, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant