-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new
mem:check
task to run Valgrind in CI (#26)
- Loading branch information
Showing
6 changed files
with
105 additions
and
2 deletions.
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,49 @@ | ||
--- | ||
name: Memcheck | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ruby-version: | ||
description: 'Ruby version to memcheck' | ||
required: true | ||
default: '3.1' | ||
type: choice | ||
options: | ||
- 'head' | ||
- '3.1' | ||
- '3.0' | ||
- '2.7' | ||
push: | ||
|
||
jobs: | ||
memcheck: | ||
name: Memcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: oxidize-rb/actions/setup-ruby-and-rust@main | ||
with: | ||
ruby-version: ${{ inputs.ruby-version || '3.1' }} | ||
bundler-cache: true | ||
cargo-cache: true | ||
cache-version: v1 | ||
|
||
- name: Install deps | ||
run: | | ||
bundle config unset deployment | ||
bundle add ruby_memcheck & # avoid usage in Gemfile bc it pulls in nokogiri | ||
sudo apt install -y valgrind & | ||
wait | ||
bundle config set deployment true | ||
- name: Run "mem:check" task | ||
env: | ||
RSPEC_FORMATTER: "progress" | ||
RSPEC_FAILURE_EXIT_CODE: "0" | ||
run: | | ||
if ! bundle exec rake mem:check; then | ||
echo "::error::Valgrind memory check failed, for more info please see ./suppressions/readme.md" | ||
exit 1 | ||
fi |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
--format documentation | ||
--color | ||
--require spec_helper |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Suppressions | ||
|
||
This folder includes Valgrind suppressions used by the | ||
[`ruby_memcheck`][ruby_memcheck] gem. If you the `memcheck` CI job fails, you | ||
may need to add a suppression to `ruby-3.1.supp` to fix it. | ||
|
||
[ruby_memcheck]: https://github.com/Shopify/ruby_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
Rust probes for statx(buf) | ||
Memcheck:Param | ||
statx(buf) | ||
... | ||
fun:*try_statx* | ||
... | ||
} | ||
{ | ||
Rust probes for statx(file_name) | ||
Memcheck:Param | ||
statx(file_name) | ||
... | ||
fun:*try_statx* | ||
... | ||
} | ||
{ | ||
Valgrind is detecting a "Invalid read of size 8" during this process, not sure why | ||
Memcheck:Addr8 | ||
fun:each_location.constprop.1 | ||
fun:gc_mark_children | ||
... | ||
} |