ruby_memcheck 2.2.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +0 -2
- data/.github/workflows/test.yml +1 -0
- data/.gitignore +0 -2
- data/.rubocop.yml +0 -1
- data/.ruby-version +1 -0
- data/Gemfile.lock +68 -0
- data/README.md +1 -0
- data/lib/ruby_memcheck/configuration.rb +7 -1
- data/lib/ruby_memcheck/stack.rb +26 -0
- data/lib/ruby_memcheck/test_task_reporter.rb +1 -0
- data/lib/ruby_memcheck/version.rb +1 -1
- data/ruby_memcheck.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2a9e15e7960c9c0a8094be720d2ad74fa3104eecb91fba0e9e0e3618c882c08
|
4
|
+
data.tar.gz: 836ed52bab1fd322d7eb0fac48159560a68266b554a5f55f865c3d62f25564f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29de912221a25bbda4d389c72b352d5cbb24518068e127a7583e9bb08fe512a18a63b127066121f7b0f1de2d305cc8b225531993b32dc5e2ea6238aca0d78290
|
7
|
+
data.tar.gz: f1d492816966602826019d6980617399cc6199ab4f0f69ab4841a6112468def380f799f642c2d1757d403003e23dc38499882fdc5da7026ec0ea7671b95ae6a6
|
data/.github/workflows/lint.yml
CHANGED
data/.github/workflows/test.yml
CHANGED
@@ -10,6 +10,7 @@ jobs:
|
|
10
10
|
- { ruby: '3.0', allowed-failure: false }
|
11
11
|
- { ruby: '3.1', allowed-failure: false }
|
12
12
|
- { ruby: '3.2', allowed-failure: false }
|
13
|
+
- { ruby: '3.3', allowed-failure: false }
|
13
14
|
- { ruby: ruby-head, allowed-failure: false }
|
14
15
|
name: ruby ${{ matrix.entry.ruby }}
|
15
16
|
steps:
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.1
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ruby_memcheck (2.3.0)
|
5
|
+
nokogiri
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.2)
|
11
|
+
json (2.7.1)
|
12
|
+
language_server-protocol (3.17.0.3)
|
13
|
+
mini_portile2 (2.8.5)
|
14
|
+
minitest (5.22.3)
|
15
|
+
minitest-parallel_fork (1.3.1)
|
16
|
+
minitest (>= 5.15.0)
|
17
|
+
nokogiri (1.16.3)
|
18
|
+
mini_portile2 (~> 2.8.2)
|
19
|
+
racc (~> 1.4)
|
20
|
+
nokogiri (1.16.3-arm64-darwin)
|
21
|
+
racc (~> 1.4)
|
22
|
+
parallel (1.24.0)
|
23
|
+
parser (3.3.0.5)
|
24
|
+
ast (~> 2.4.1)
|
25
|
+
racc
|
26
|
+
racc (1.7.3)
|
27
|
+
rainbow (3.1.1)
|
28
|
+
rake (13.1.0)
|
29
|
+
rake-compiler (1.2.7)
|
30
|
+
rake
|
31
|
+
regexp_parser (2.9.0)
|
32
|
+
rexml (3.2.6)
|
33
|
+
rspec-core (3.13.0)
|
34
|
+
rspec-support (~> 3.13.0)
|
35
|
+
rspec-support (3.13.1)
|
36
|
+
rubocop (1.62.1)
|
37
|
+
json (~> 2.3)
|
38
|
+
language_server-protocol (>= 3.17.0)
|
39
|
+
parallel (~> 1.10)
|
40
|
+
parser (>= 3.3.0.2)
|
41
|
+
rainbow (>= 2.2.2, < 4.0)
|
42
|
+
regexp_parser (>= 1.8, < 3.0)
|
43
|
+
rexml (>= 3.2.5, < 4.0)
|
44
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
45
|
+
ruby-progressbar (~> 1.7)
|
46
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
47
|
+
rubocop-ast (1.31.2)
|
48
|
+
parser (>= 3.3.0.4)
|
49
|
+
rubocop-shopify (2.15.1)
|
50
|
+
rubocop (~> 1.51)
|
51
|
+
ruby-progressbar (1.13.0)
|
52
|
+
unicode-display_width (2.5.0)
|
53
|
+
|
54
|
+
PLATFORMS
|
55
|
+
ruby
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
minitest (~> 5.0)
|
59
|
+
minitest-parallel_fork (~> 1.2)
|
60
|
+
rake (~> 13.0)
|
61
|
+
rake-compiler (~> 1.1)
|
62
|
+
rspec-core
|
63
|
+
rubocop (~> 1.22)
|
64
|
+
rubocop-shopify (~> 2.3)
|
65
|
+
ruby_memcheck!
|
66
|
+
|
67
|
+
BUNDLED WITH
|
68
|
+
2.4.10
|
data/README.md
CHANGED
@@ -163,6 +163,7 @@ If you want to override any of the default configurations you can call `RubyMemc
|
|
163
163
|
- `temp_dir`: Optional. The directory to store temporary files. It defaults to a temporary directory. This is present for development debugging, so you shouldn't have to use it.
|
164
164
|
- `output_io`: Optional. The `IO` object to output Valgrind errors to. Defaults to standard error.
|
165
165
|
- `filter_all_errors`: Optional. Whether to filter all kinds of Valgrind errors (not just memory leaks). This feature should only be used if you're encountering a large number of illegal memory accesses coming from Ruby. If you need to use this feature, you may have found a bug inside of Ruby. Consider reporting it to the [Ruby bug tracker](https://bugs.ruby-lang.org/projects/ruby-master/issues/new). Defaults to `false`.
|
166
|
+
- `use_only_ruby_free_at_exit`: Optional. Use only the [`RUBY_FREE_AT_EXIT`](https://bugs.ruby-lang.org/issues/19993) feature introduced in Ruby 3.3 and disables most of the heuristics inside of ruby_memcheck. Disable this if you want to use the original heuristics. Defaults to `true` for Ruby 3.4 and later, `false` otherwise. Note: while `RUBY_FREE_AT_EXIT` was introduced in Ruby 3.3, there are bugs which prevents it from working well, so it is only enabled by default for Ruby 3.4 and later.
|
166
167
|
|
167
168
|
## Suppression files
|
168
169
|
|
@@ -31,6 +31,7 @@ module RubyMemcheck
|
|
31
31
|
/\Arb_thread_create\z/, # Threads are relased to a cache, so they may be reported as a leak
|
32
32
|
/\Arb_yield/,
|
33
33
|
].freeze
|
34
|
+
RUBY_FREE_AT_EXIT_SUPPORTED = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0")
|
34
35
|
|
35
36
|
attr_reader :binary_name
|
36
37
|
attr_reader :ruby
|
@@ -43,9 +44,11 @@ module RubyMemcheck
|
|
43
44
|
attr_reader :loaded_features_file
|
44
45
|
attr_reader :output_io
|
45
46
|
attr_reader :filter_all_errors
|
47
|
+
attr_reader :use_only_ruby_free_at_exit
|
46
48
|
|
47
49
|
alias_method :valgrind_generate_suppressions?, :valgrind_generate_suppressions
|
48
50
|
alias_method :filter_all_errors?, :filter_all_errors
|
51
|
+
alias_method :use_only_ruby_free_at_exit?, :use_only_ruby_free_at_exit
|
49
52
|
|
50
53
|
def initialize(
|
51
54
|
binary_name: nil,
|
@@ -57,7 +60,8 @@ module RubyMemcheck
|
|
57
60
|
skipped_ruby_functions: DEFAULT_SKIPPED_RUBY_FUNCTIONS,
|
58
61
|
temp_dir: Dir.mktmpdir,
|
59
62
|
output_io: $stderr,
|
60
|
-
filter_all_errors: false
|
63
|
+
filter_all_errors: false,
|
64
|
+
use_only_ruby_free_at_exit: RUBY_FREE_AT_EXIT_SUPPORTED
|
61
65
|
)
|
62
66
|
@binary_name = binary_name
|
63
67
|
@ruby = ruby
|
@@ -83,6 +87,8 @@ module RubyMemcheck
|
|
83
87
|
]
|
84
88
|
|
85
89
|
@loaded_features_file = Tempfile.create("", @temp_dir)
|
90
|
+
|
91
|
+
@use_only_ruby_free_at_exit = use_only_ruby_free_at_exit
|
86
92
|
end
|
87
93
|
|
88
94
|
def command(*args)
|
data/lib/ruby_memcheck/stack.rb
CHANGED
@@ -10,6 +10,32 @@ module RubyMemcheck
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def skip?
|
13
|
+
if @configuration.use_only_ruby_free_at_exit?
|
14
|
+
skip_using_ruby_free_at_exit?
|
15
|
+
else
|
16
|
+
skip_using_original_heuristics?
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def skip_using_ruby_free_at_exit?
|
23
|
+
if configuration.binary_name.nil?
|
24
|
+
false
|
25
|
+
else
|
26
|
+
in_binary = false
|
27
|
+
|
28
|
+
frames.each do |frame|
|
29
|
+
if frame.in_binary?
|
30
|
+
in_binary = true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
!in_binary
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def skip_using_original_heuristics?
|
13
39
|
in_binary = false
|
14
40
|
|
15
41
|
frames.each do |frame|
|
data/ruby_memcheck.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = "Use Valgrind memcheck without going crazy"
|
12
12
|
spec.homepage = "https://github.com/Shopify/ruby_memcheck"
|
13
13
|
spec.license = "MIT"
|
14
|
-
spec.required_ruby_version =
|
14
|
+
spec.required_ruby_version = ">= 3.0.0"
|
15
15
|
|
16
16
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
17
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_memcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Zhu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -135,7 +135,9 @@ files:
|
|
135
135
|
- ".github/workflows/test.yml"
|
136
136
|
- ".gitignore"
|
137
137
|
- ".rubocop.yml"
|
138
|
+
- ".ruby-version"
|
138
139
|
- Gemfile
|
140
|
+
- Gemfile.lock
|
139
141
|
- LICENSE.txt
|
140
142
|
- README.md
|
141
143
|
- Rakefile
|
@@ -167,14 +169,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
169
|
requirements:
|
168
170
|
- - ">="
|
169
171
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
172
|
+
version: 3.0.0
|
171
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
174
|
requirements:
|
173
175
|
- - ">="
|
174
176
|
- !ruby/object:Gem::Version
|
175
177
|
version: '0'
|
176
178
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
179
|
+
rubygems_version: 3.5.9
|
178
180
|
signing_key:
|
179
181
|
specification_version: 4
|
180
182
|
summary: Use Valgrind memcheck without going crazy
|