Add AddressSanitizer (ASAN) CI Testing
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 455
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
Required prerequisites
- Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature
As noted in #3748 and #3711 we have caught quite a few latent bugs (Also #3752 and #3755) in development of MacOS support that would likely have been caught at development time with address sanitizer builds (or maybe static analysis). This would enable catching many memory errors like buffer overflows, use-after-free, and memory leaks early in development.
The current CI pipeline (ci.yml, test_in_devenv.yml) builds and tests CUDA-Q with standard Debug/Release configurations using clang16, gcc11, and gcc12 toolchains. However, there is no sanitizer-enabled build configuration.
I propose:
- we add ASAN as a cmake option
- We add a new CI job for this
As ASAN builds can have a relatively large slowdown I hope we can do it in such a way that they are pipelined early and don't add to the total wall-clock build time. We might want to limit to only one or two compilers/platform targets to avoid duplicating the consumption of too many CI resources.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading ci.yml and test_in_devenv.yml to understand the current Debug/Release jobs, toolchains, and pipeline ordering. Then inspect the existing CMake configuration for an appropriate sanitizer option. Done means an ASAN-enabled build and test job runs in CI without unnecessarily duplicating compiler or platform coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, github-actions
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100