-
Notifications
You must be signed in to change notification settings - Fork 5
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
[SDTEST-744] add memory leaks tests with ruby_memcheck #246
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Test for memory leaks | ||
on: [push] | ||
jobs: | ||
test-memcheck: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.4.0-preview1 # TODO: Use stable version once 3.4 is out | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
bundler: latest | ||
cache-version: v1 # bump this to invalidate cache | ||
- run: sudo apt-get update && (sudo apt-get install -y valgrind || sleep 5 && sudo apt-get install -y valgrind) && valgrind --version | ||
- run: bundle exec rake compile spec:ddcov_memcheck |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
|tasks | ||
|yard | ||
|vendor/rbs | ||
|suppressions | ||
)/ | ||
}x | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This is a valgrind suppression configuration file. | ||
# | ||
# We use it together with the ruby_memcheck gem to find issues in the datadog-ci-rb native extensions; in some cases | ||
# we need to ignore potential issues as they're not something we can fix (e.g. outside our code.) | ||
# | ||
# See https://valgrind.org/docs/manual/manual-core.html#manual-core.suppress for details. | ||
|
||
# When a Ruby process forks, it looks like Ruby doesn't clean up the memory of old threads? | ||
{ | ||
ruby-native-thread-memory | ||
Memcheck:Leak | ||
fun:calloc | ||
fun:calloc1 | ||
fun:rb_gc_impl_calloc | ||
fun:native_thread_alloc | ||
fun:native_thread_create_dedicated | ||
fun:native_thread_create | ||
fun:thread_create_core | ||
... | ||
} | ||
|
||
# When a Ruby process forks, it looks like Ruby doesn't clean up the memory of old threads? | ||
{ | ||
ruby-native-thread-memory-2 | ||
Memcheck:Leak | ||
fun:calloc | ||
fun:calloc1 | ||
fun:objspace_xcalloc | ||
fun:ruby_xcalloc_body | ||
fun:native_thread_alloc | ||
fun:native_thread_create_dedicated | ||
fun:native_thread_create | ||
fun:thread_create_core | ||
... | ||
} | ||
|
||
# We don't care about the pkg-config external tool | ||
{ | ||
pkg-config-memory | ||
Memcheck:Leak | ||
... | ||
obj:/usr/bin/pkg-config | ||
... | ||
} | ||
|
||
# We don't care about the tr external tool | ||
{ | ||
pkg-config-memory | ||
Memcheck:Leak | ||
... | ||
obj:/usr/bin/tr | ||
... | ||
} | ||
Oops, something went wrong.
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.
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.
I suspect you won't need these, but also they're harmless to keep, if you want to just keep this file mostly in sync with dd-trace-rb