ruby_memcheck 2.1.2 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62852fcef1f92f736c7fb3ac7e32b5246661db102e6177f4c0f0e9ba71ee0fa1
4
- data.tar.gz: 8c6ea3da941069400b99cf73eb0ea6c881d9a2066486c72169a553ff6bf03e00
3
+ metadata.gz: d995f1c581f36353698de1ed410eb6c7728ff11313b59992f7c935f98a73e960
4
+ data.tar.gz: f499de55cd5d482a60cd33cb393c1cac415374188f19c97ae42545a884b6bb5d
5
5
  SHA512:
6
- metadata.gz: ed8c72be6f6753a11f778e72fe036d8f0f7f35214b2b8d94cfb39c7ebab99d2cd443e23b2a4fdc0b5e4f22e4b99a87e74292512ee39180bbb8f7d2a78061eaa6
7
- data.tar.gz: dc27d11869a745eb873683337c2fb72ebe9995a7c7f2faef76a7b79018b1e936e0b21a1e488b15997fa9909d4177e83316f0891527ecebdc636f09a8dd661eaa
6
+ metadata.gz: 61add3f638205732ea2e17dac9b970b18dcaa9177543321d6f6cf9f0fcdb2c9498f631e9d8cb40e1626f043e68864fe7995356c63d130c854b56554c9c5cd5c1
7
+ data.tar.gz: f089633851cf9d95ffc383dce6b8f62abb28f80adcf10f6d049fd0446cbca2202632ab4439e1bf5133de62d395552ae426a8f41dda59c7199ca8cecd4d33a55b
@@ -20,7 +20,9 @@ jobs:
20
20
  # - run: sudo apt-get install -y valgrind
21
21
  # We cannot use Valgrind from apt because we need at least Valgrind 3.20.0
22
22
  # to support DWARF 5
23
- - run: sudo apt-get install -y libc6-dbg
23
+ - run: |
24
+ sudo apt-get update
25
+ sudo apt-get install -y libc6-dbg
24
26
  - name: Install Valgrind from source
25
27
  run: |
26
28
  wget https://sourceware.org/pub/valgrind/valgrind-3.21.0.tar.bz2
data/.gitignore CHANGED
@@ -10,3 +10,4 @@ Gemfile.lock
10
10
  /tmp/
11
11
 
12
12
  *.so
13
+ .DS_Store
data/README.md CHANGED
@@ -153,6 +153,7 @@ If you want to override any of the default configurations you can call `RubyMemc
153
153
 
154
154
  `RubyMemcheck::Configuration` accepts a variety of keyword arguments. Here are all the arguments:
155
155
 
156
+ - `binary_name`: Optional. The name of the only binary to report errors for. Use this if there is too much noise caused by other binaries.
156
157
  - `ruby`: Optional. The command to run to invoke Ruby. Defaults to the Ruby that is currently being used.
157
158
  - `valgrind`: Optional. The command to run to invoke Valgrind. Defaults to the string `"valgrind"`.
158
159
  - `valgrind_options`: Optional. Array of options to pass into Valgrind. This is only present as an escape hatch, so avoid using it. This may be deprecated or removed in future versions.
@@ -14,6 +14,7 @@ module RubyMemcheck
14
14
  DEFAULT_VALGRIND_SUPPRESSIONS_DIR = "suppressions"
15
15
  DEFAULT_SKIPPED_RUBY_FUNCTIONS = [
16
16
  /\Aeval_string_with_cref\z/,
17
+ /\Aintern_str\z/, # Same as rb_intern, but sometimes rb_intern is optimized out
17
18
  /\Arb_add_method_cfunc\z/,
18
19
  /\Arb_check_funcall/,
19
20
  /\Arb_class_boot\z/, # Called for all the different ways to create a Class
@@ -31,6 +32,7 @@ module RubyMemcheck
31
32
  /\Arb_yield/,
32
33
  ].freeze
33
34
 
35
+ attr_reader :binary_name
34
36
  attr_reader :ruby
35
37
  attr_reader :valgrind
36
38
  attr_reader :valgrind_options
@@ -57,8 +59,7 @@ module RubyMemcheck
57
59
  output_io: $stderr,
58
60
  filter_all_errors: false
59
61
  )
60
- warn("ruby_memcheck: binary_name is no longer required for configuration") if binary_name
61
-
62
+ @binary_name = binary_name
62
63
  @ruby = ruby
63
64
  @valgrind = valgrind
64
65
  @valgrind_options = valgrind_options
@@ -42,9 +42,19 @@ module RubyMemcheck
42
42
  @loaded_binaries = loaded_features.keep_if do |feat|
43
43
  # Keep only binaries (ignore Ruby files).
44
44
  File.extname(feat) == ".so"
45
- end.freeze
45
+ end
46
+
47
+ if configuration.binary_name
48
+ @loaded_binaries.keep_if do |feat|
49
+ File.basename(feat, ".*") == configuration.binary_name
50
+ end
51
+
52
+ if @loaded_binaries.empty?
53
+ raise "The Ruby program executed never loaded a binary called `#{configuration.binary_name}`"
54
+ end
55
+ end
46
56
 
47
- @loaded_binaries
57
+ @loaded_binaries.freeze
48
58
  end
49
59
 
50
60
  def valgrind_xml_files
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyMemcheck
4
- VERSION = "2.1.2"
4
+ VERSION = "2.2.1"
5
5
  end
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: 2.1.2
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Zhu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-23 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubygems_version: 3.5.0.dev
177
+ rubygems_version: 3.4.10
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Use Valgrind memcheck without going crazy