Skip to content
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

BUILD/CONFIG: Introduce Address Sanitizer flag option #9519

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

ivankochin
Copy link
Contributor

@ivankochin ivankochin commented Nov 30, 2023

What

Introduces --enable-asan option which checks the Address Sanitizer availability and passes corresponding flags during compilation and linkage.

Why

Address Sanitizer is significantly faster then Valgrind and can detect more types of memory errors. For details go to the link: https://github.com/google/sanitizers/wiki/AddressSanitizerComparisonOfMemoryTools

Testing with GCC-7.2.0 on RHEL 7.6 detected false-positive buffer underflow errors during ucs_container_of call.
Testing with GCC-11 on Ubuntu-22.04 detected the following issues:

So it is important to test with fresh OS/compiler.

TODO:

  • Define ASAN_OPTIONS=protect_shadow_gap=0 if cuda support enabled. See details here: asan: problem calling NVIDIA CUDA libraries google/sanitizers#629
  • libcuda causes false positive leaks, consider creation lsan.supp (with one string: leak:libcuda) and passing LSAN_OPTIONS=suppressions=<path_to_lsan.supp> if cuda is enabled.
  • If cuda leaks are suppressed for ASAN, CUDA can be tested through compute sanitizer.
  • UCM is disabled if ASAN is enabled, and therefore rcache is disabled too. Can UCM or rcache be used with ASAN?

@ivankochin ivankochin self-assigned this Nov 30, 2023
@ivankochin ivankochin changed the title BUILD/CONFIG: Address Sanitizer flag option BUILD/CONFIG: Introduce Address Sanitizer flag option Nov 30, 2023
yosefe
yosefe previously approved these changes Nov 30, 2023
@ivankochin
Copy link
Contributor Author

CUDA failure example (ASAN_OPTIONS=protect_shadow_gap=0 is set):

image

@ivankochin ivankochin enabled auto-merge December 6, 2023 10:08
@ivankochin ivankochin merged commit c15da99 into openucx:master Dec 7, 2023
115 checks passed
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.

2 participants