<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_settracefunc.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[Bug #20915] Fix SEGV with `TracePoint#parameters` and aliased C method</title>
<updated>2024-11-29T23:42:48+00:00</updated>
<author>
<name>viralpraxis</name>
<email>iaroslav2k@gmail.com</email>
</author>
<published>2024-11-29T21:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=660b995365f719fa59ed6f2809bb1527e6470d14'/>
<id>660b995365f719fa59ed6f2809bb1527e6470d14</id>
<content type='text'>
The following snippet results with a SEGV:

```ruby
C = Class.new do
  alias_method :new_to_s, :to_s
end

TracePoint.new(:c_call, &amp;:parameters).enable { C.new.new_to_s }
```

at MRI 3.3.6 and ruby 3.4.0dev

The root cause of the issue lies in the `rb_tracearg_parameters` function
within the `RUBY_EVENT_C_RETURN` branch. Specifically, when the invoked
method is an alias for a C function,
`rb_method_entry_without_refinements(..., trace_arg-&gt;called_id, ...)`
may return NULL. In that case we can fallback to `trace_arg-&gt;id`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following snippet results with a SEGV:

```ruby
C = Class.new do
  alias_method :new_to_s, :to_s
end

TracePoint.new(:c_call, &amp;:parameters).enable { C.new.new_to_s }
```

at MRI 3.3.6 and ruby 3.4.0dev

The root cause of the issue lies in the `rb_tracearg_parameters` function
within the `RUBY_EVENT_C_RETURN` branch. Specifically, when the invoked
method is an alias for a C function,
`rb_method_entry_without_refinements(..., trace_arg-&gt;called_id, ...)`
may return NULL. In that case we can fallback to `trace_arg-&gt;id`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move Array#map to Ruby</title>
<updated>2024-11-13T20:27:26+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-13T04:47:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=01db456196e17eb067f70eb1d4fceba143a51c01'/>
<id>01db456196e17eb067f70eb1d4fceba143a51c01</id>
<content type='text'>
Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-Authored-By: Aaron Patterson &lt;tenderlove@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent a warning: assigned but unused variable - exp_events</title>
<updated>2024-09-13T02:34:20+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-09-13T02:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5e3f1b6a6d64598982219644edfa9c3da09bafed'/>
<id>5e3f1b6a6d64598982219644edfa9c3da09bafed</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix assertion error when TracePoint has incompatible events</title>
<updated>2024-08-16T20:12:49+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2024-08-16T14:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2fe6a4f84d2bcf97d3be9bffa5f3232604201f55'/>
<id>2fe6a4f84d2bcf97d3be9bffa5f3232604201f55</id>
<content type='text'>
TracePoints with incompatible events (i.e. events not in ISEQ_TRACE_EVENTS)
with a method target will fail an assertion error because it does not
filter for the supported events. For example, the following lines will
cause an assertion error:

    def foo; end
    # No arguments passed into TracePoint.new enables all ISEQ_TRACE_EVENTS
    TracePoint.new {}.enable(target: method(:foo))
    # Raise is not supported with a target
    TracePoint.new(:raise, :return) {}.enable(target: method(:foo))
    foo

Crashes with:

    Assertion Failed: vm_insnhelper.c:7026:vm_trace:(iseq_local_events &amp; ~(0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010| 0x0020| 0x0040 | 0x0100 | 0x0200 | 0x4000 | 0x010000| 0x020000)) == 0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TracePoints with incompatible events (i.e. events not in ISEQ_TRACE_EVENTS)
with a method target will fail an assertion error because it does not
filter for the supported events. For example, the following lines will
cause an assertion error:

    def foo; end
    # No arguments passed into TracePoint.new enables all ISEQ_TRACE_EVENTS
    TracePoint.new {}.enable(target: method(:foo))
    # Raise is not supported with a target
    TracePoint.new(:raise, :return) {}.enable(target: method(:foo))
    foo

Crashes with:

    Assertion Failed: vm_insnhelper.c:7026:vm_trace:(iseq_local_events &amp; ~(0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010| 0x0020| 0x0040 | 0x0100 | 0x0200 | 0x4000 | 0x010000| 0x020000)) == 0
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix flaky TestSetTraceFunc#test_remove_in_trace by filtering trace events</title>
<updated>2024-08-16T00:47:07+00:00</updated>
<author>
<name>Naoto Ono</name>
<email>onoto1998@gmail.com</email>
</author>
<published>2024-08-13T10:37:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c06fbb192f61e3b7af82c0c99a062a4e3938f9aa'/>
<id>c06fbb192f61e3b7af82c0c99a062a4e3938f9aa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert moving things to Ruby</title>
<updated>2024-07-29T21:18:11+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2024-07-29T20:28:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2c1655314a0700a90b7ed12bf8c920ad2d78654f'/>
<id>2c1655314a0700a90b7ed12bf8c920ad2d78654f</id>
<content type='text'>
This is slowing down benchmarks on x86, so lets revert it for now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is slowing down benchmarks on x86, so lets revert it for now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Report a TracePoint log when the TracePoint tests fail</title>
<updated>2024-07-17T09:41:39+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-07-17T07:11:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3f65df48bdc48e720643209a7a6d58ab60c3609b'/>
<id>3f65df48bdc48e720643209a7a6d58ab60c3609b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Move Array#map to Ruby</title>
<updated>2024-07-03T19:32:53+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2024-07-03T18:40:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b974c84606535d8f58addc5ab2ceb6d3ea827d15'/>
<id>b974c84606535d8f58addc5ab2ceb6d3ea827d15</id>
<content type='text'>
Improves activerecord by about 1% on the interpreter:

```
before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) [arm64-darwin23]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  235.2        0.8         233.6       0.7         1.01           1.01
------------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```

Improves YJIT by about 4%:

```
before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) +YJIT [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) +YJIT [arm64-darwin23]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  142.1        1.2         137.0       0.6         1.00           1.04
------------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improves activerecord by about 1% on the interpreter:

```
before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) [arm64-darwin23]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  235.2        0.8         233.6       0.7         1.01           1.01
------------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```

Improves YJIT by about 4%:

```
before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) +YJIT [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) +YJIT [arm64-darwin23]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  142.1        1.2         137.0       0.6         1.00           1.04
------------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Move to test/.excludes-prism</title>
<updated>2024-06-25T03:42:16+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-06-25T03:42:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3b4ff810d2fefdf0194bd774bc04f6f17e2ccae7'/>
<id>3b4ff810d2fefdf0194bd774bc04f6f17e2ccae7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Pending `EVENT_RETURN` settracefunc tests with Prism</title>
<updated>2024-06-25T03:37:50+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-06-25T03:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a7f33c99c69e3cc62b7a24ce35f51f76cc5bfaa2'/>
<id>a7f33c99c69e3cc62b7a24ce35f51f76cc5bfaa2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
