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

Add AddressSanitizer to CI tests #812

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

sashacmc
Copy link
Member

@sashacmc sashacmc commented Nov 22, 2024

Add AddressSanitizer to CI tests and fix memory issues:

  • weak reference counting
  • keyexpr memory access
  • unitest memory leaks

Closes: #801

Copy link

PR missing one of the required labels: {'documentation', 'dependencies', 'new feature', 'internal', 'breaking-change', 'enhancement', 'bug'}

@sashacmc sashacmc added the internal Changes not included in the changelog label Nov 22, 2024
@sashacmc sashacmc force-pushed the asan_ci_tests branch 3 times, most recently from 89b9505 to 39ea2b0 Compare November 22, 2024 21:35
@sashacmc sashacmc marked this pull request as ready for review November 23, 2024 02:42
@sashacmc sashacmc requested a review from jean-roland November 23, 2024 02:42
@@ -453,6 +454,11 @@ if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if(ASAN)
add_compile_options(-fsanitize=address)
Copy link
Contributor

@DenisBiryukov91 DenisBiryukov91 Nov 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not correct, since -fsanitize is a clang/gcc feature only and thus will fail with other compilers (for example for MSVC it is /fsanitize=address)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't tested it with MSVC, but as far as I see there
https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options?view=msvc-170
and there
https://learn.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-170
this type of option is also correct.
In addition, this is an optional option that does not have to be enabled for all compilers.

@milyin milyin merged commit 546cf24 into eclipse-zenoh:main Nov 25, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Changes not included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add memory leak check for unit tests
4 participants