-
Notifications
You must be signed in to change notification settings - Fork 436
Integrate Clang AddressSanitizer in tests #1903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
39b44c1 to
efc5ee8
Compare
5659d05 to
0efd96b
Compare
.github/workflows/ci.yml
Outdated
| - name: Test ASAN | ||
| if: matrix.backend == 'asan' | ||
| run: | | ||
| ASAN_OPTIONS=detect_leaks=1:print_stats=1 tests/ctranslate2_test tests/data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force ASAN_OPTIONS=detect_leaks=1 in case os: [ubuntu-22.04] matrix expands in the future (leak detection is turned on by default on Linux).
|
For context: |
Thanks for the note. Worth noting that sanitisers still exist but are maintained under the LLVM project (link). |
5b85a40 to
43743ae
Compare
| build-and-test-cpp-x86_64-sanitizers: | ||
| runs-on: ${{ matrix.os }} | ||
| env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My take is that we will run this only in Linux. If this is the case we should consider removing the matrix execution to simplify the job. Same for the backends.
| tests/ctranslate2_test tests/data | ||
| build-and-test-cpp-x86_64-sanitizers: | ||
| runs-on: ${{ matrix.os }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that we only use a sanitizer, consider if "build-and-test-cpp-x86_64-sanitizer" makes more sense.
| option(WITH_TENSOR_PARALLEL "Compile with NCCL and MPI backend" OFF) | ||
| option(WITH_FLASH_ATTN "Compile with Flash Attention 2" OFF) | ||
| option(GOOGLE_ADDRESS_SANITIZER "ASAN" OFF) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two suggestions:
- ENABLE_ADDRESS_SANITIZER may be a better name than GOOGLE_ADDRESS_SANITIZER because it is not Google specific (you also changed the name of the PR).
- Consider a better description for the switch like "Enable AddressSanitizer for memory error detection"
Tested: temporarily introduced a memory leak in an operator to check that
asanworks:https://github.com/OpenNMT/CTranslate2/actions/runs/16419223767/job/46392885237#logs
resolves #1928