NVIDIA / NVIDIA/cuda-quantum

Add AddressSanitizer (ASAN) CI Testing

Open
#3,757 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement stale-notified
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:

  1. we add ASAN as a cmake option
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.