[NO-TICKET] Add more memory leak testing for profiling using asan#3864
Merged
Conversation
See the huge comment for details :)
**What does this PR do?** This PR builds atop the work from #3852 and #3862 to enable running the profiler test suite using the AddressSanitizer ("asan") tool (see https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer ). This check will enable us to find bugs in the profiler that may not be otherwise caught. **Motivation:** Improve validation of the profiler native extension. **Additional Notes:** The "asan" tool is built into the clang compiler toolchain, and needs Ruby to be built with a special configuration. The special configuration is not yet available in the upstream `ruby/setup-ruby` github action, so I needed to fork it and push a small tweak to make it available. (The Ruby builds were added in ruby/ruby-dev-builder#10 ). **How to test the change?** Here's a passing CI run: https://github.com/DataDog/dd-trace-rb/actions/runs/10524502494/job/29161364590 I've also tested it by adding a memory leak (e.g. for instance commenting out `ddog_Vec_Tag_drop(tags);` in `http_transport.c` and confirmed the issue was flagged. Here's the failing CI run: https://github.com/DataDog/dd-trace-rb/actions/runs/10524803685/job/29162274392
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3864 +/- ##
=======================================
Coverage 97.85% 97.85%
=======================================
Files 1269 1269
Lines 75868 75868
Branches 3736 3736
=======================================
+ Hits 74240 74244 +4
+ Misses 1628 1624 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AlexJF
approved these changes
Aug 23, 2024
BenchmarksBenchmark execution time: 2024-08-23 11:59:29 Comparing candidate commit f43b485 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 23 metrics, 2 unstable metrics. |
ivoanjo
added a commit
that referenced
this pull request
Nov 7, 2024
**What does this PR do?** This PR re-enables the memory leak testing using the asan tool job in CI. For context, we added this testing in #3864 (more details about what asan is can be found in that PR), but had to disable it in #3915 as the upstream Ruby builds we were using were broken and unavailable for a while. This has since been fixed upstream, and so let's re-enable this CI job. In fact, upstream now officially allows these builds to be used, so we no longer even need our fork of `setup-ruby` to enable them. **Motivation:** Improve our testing for native memory leaks. **Additional Notes:** N/A **How to test the change?** Validate that the "test-asan" is now running in CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR builds atop the work from #3852 and #3862 to enable running the profiler test suite using the AddressSanitizer ("asan") tool (see https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer ).
This check will enable us to find bugs in the profiler that may not be otherwise caught.
Motivation:
Improve validation of the profiler native extension.
Additional Notes:
The "asan" tool is built into the clang compiler toolchain, and needs Ruby to be built with a special configuration.
The special configuration is not yet available in the upstream
ruby/setup-rubygithub action, so I needed to fork it and push a small tweak to make it available.(The Ruby builds were added in ruby/ruby-dev-builder#10 ).
How to test the change?
Here's a passing CI run: https://github.com/DataDog/dd-trace-rb/actions/runs/10524502494/job/29161364590
I've also tested it by adding a memory leak (e.g. for instance commenting out
ddog_Vec_Tag_drop(tags);inhttp_transport.cand confirmed the issue was flagged.Here's the failing CI run: https://github.com/DataDog/dd-trace-rb/actions/runs/10524803685/job/29162274392