-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #246 from DataDog/anmarchenko/memcheck_tests
[SDTEST-744] add memory leaks tests with ruby_memcheck
- Loading branch information
Showing
5 changed files
with
98 additions
and
1 deletion.
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 | ||
... | ||
} |