<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_ractor.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Prevent ifunc procs from being made shareable</title>
<updated>2025-12-12T19:27:37+00:00</updated>
<author>
<name>Étienne Barrié</name>
<email>etienne.barrie@gmail.com</email>
</author>
<published>2025-12-11T15:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5903ed7ba9ca60546aa0dd97e92b3d381b7918d3'/>
<id>5903ed7ba9ca60546aa0dd97e92b3d381b7918d3</id>
<content type='text'>
[Bug #21775]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #21775]
</pre>
</div>
</content>
</entry>
<entry>
<title>Method and UnboundMethod can be sharable</title>
<updated>2025-12-04T17:28:30+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-12-04T16:19:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4c893e2ff1077b977483da14c0540e9247b87c7e'/>
<id>4c893e2ff1077b977483da14c0540e9247b87c7e</id>
<content type='text'>
with `RUBY_TYPED_FROZEN_SHAREABLE_NO_REC`,
if the receiver object is shareable on Method objects.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
with `RUBY_TYPED_FROZEN_SHAREABLE_NO_REC`,
if the receiver object is shareable on Method objects.
</pre>
</div>
</content>
</entry>
<entry>
<title>test_ractor.rb: Delete unnecessary GC.stress fiddling</title>
<updated>2025-11-11T21:41:46+00:00</updated>
<author>
<name>Alan Wu</name>
<email>alanwu@ruby-lang.org</email>
</author>
<published>2025-11-11T21:41:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9363231d249365b6426dc8579b6adcb813661cf2'/>
<id>9363231d249365b6426dc8579b6adcb813661cf2</id>
<content type='text'>
assert_ractor() runs in a subprocess.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
assert_ractor() runs in a subprocess.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix segfault when moving nested objects between ractors during GC</title>
<updated>2025-10-26T22:59:43+00:00</updated>
<author>
<name>Joshua Young</name>
<email>djry1999@gmail.com</email>
</author>
<published>2025-10-25T04:40:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=52ea222027c7315a5d66f0d7b4ab73c1cc0c7344'/>
<id>52ea222027c7315a5d66f0d7b4ab73c1cc0c7344</id>
<content type='text'>
Fixes a segmentation fault when moving nested objects between ractors with GC stress enabled and YJIT.

The issue is a timing problem: `move_enter` allocates new object shells but leaves their contents uninitialized until `move_leave` copies the actual data. If GC runs between these steps (which GC stress makes likely), it tries to follow what appear to be object pointers but are actually uninitialized memory, encountering null or invalid addresses.

The fix zero-initializes the object contents immediately after allocation in `move_enter`, ensuring the GC finds safe null pointers instead of garbage data.

The crash reproduced most consistently with nested hashes and YJIT, likely because nested structures create multiple uninitialized objects simultaneously while YJIT's memory usage increases the probability of GC triggering during moves.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a segmentation fault when moving nested objects between ractors with GC stress enabled and YJIT.

The issue is a timing problem: `move_enter` allocates new object shells but leaves their contents uninitialized until `move_leave` copies the actual data. If GC runs between these steps (which GC stress makes likely), it tries to follow what appear to be object pointers but are actually uninitialized memory, encountering null or invalid addresses.

The fix zero-initializes the object contents immediately after allocation in `move_enter`, ensuring the GC finds safe null pointers instead of garbage data.

The crash reproduced most consistently with nested hashes and YJIT, likely because nested structures create multiple uninitialized objects simultaneously while YJIT's memory usage increases the probability of GC triggering during moves.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ractor.shareable_proc</title>
<updated>2025-09-23T18:59:03+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2025-07-17T06:38:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=55b1ba3bf276ba82173bd961fb8e0f08bf4182a6'/>
<id>55b1ba3bf276ba82173bd961fb8e0f08bf4182a6</id>
<content type='text'>
call-seq:
  Ractor.sharable_proc(self: nil){} -&gt; sharable proc

It returns shareable Proc object. The Proc object is
shareable and the self in a block will be replaced with
the value passed via `self:` keyword.

In a shareable Proc, the outer variables should
* (1) refer shareable objects
* (2) be not be overwritten

```ruby
  a = 42
  Ractor.shareable_proc{ p a }
  #=&gt; OK

  b = 43
  Ractor.shareable_proc{ p b; b = 44 }
  #=&gt; Ractor::IsolationError because 'b' is reassigned in the block.

  c = 44
  Ractor.shareable_proc{ p c }
  #=&gt; Ractor::IsolationError because 'c' will be reassigned outside of the block.
  c = 45

  d = 45
  d = 46 if cond
  Ractor.shareable_proc{ p d }
  #=&gt; Ractor::IsolationError because 'd' was reassigned outside of the block.
```

The last `d`'s case can be relaxed in a future version.

The above check will be done in a static analysis at compile time,
so the reflection feature such as `Binding#local_varaible_set`
can not be detected.

```ruby
  e = 42
  shpr = Ractor.shareable_proc{ p e } #=&gt; OK
  binding.local_variable_set(:e, 43)
  shpr.call #=&gt; 42 (returns captured timing value)
```

Ractor.sharaeble_lambda is also introduced.
[Feature #21550]
[Feature #21557]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
call-seq:
  Ractor.sharable_proc(self: nil){} -&gt; sharable proc

It returns shareable Proc object. The Proc object is
shareable and the self in a block will be replaced with
the value passed via `self:` keyword.

In a shareable Proc, the outer variables should
* (1) refer shareable objects
* (2) be not be overwritten

```ruby
  a = 42
  Ractor.shareable_proc{ p a }
  #=&gt; OK

  b = 43
  Ractor.shareable_proc{ p b; b = 44 }
  #=&gt; Ractor::IsolationError because 'b' is reassigned in the block.

  c = 44
  Ractor.shareable_proc{ p c }
  #=&gt; Ractor::IsolationError because 'c' will be reassigned outside of the block.
  c = 45

  d = 45
  d = 46 if cond
  Ractor.shareable_proc{ p d }
  #=&gt; Ractor::IsolationError because 'd' was reassigned outside of the block.
```

The last `d`'s case can be relaxed in a future version.

The above check will be done in a static analysis at compile time,
so the reflection feature such as `Binding#local_varaible_set`
can not be detected.

```ruby
  e = 42
  shpr = Ractor.shareable_proc{ p e } #=&gt; OK
  binding.local_variable_set(:e, 43)
  shpr.call #=&gt; 42 (returns captured timing value)
```

Ractor.sharaeble_lambda is also introduced.
[Feature #21550]
[Feature #21557]
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip a Ractor test unstable on Windows for MinGW</title>
<updated>2025-08-26T23:48:50+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-08-26T23:48:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d1330fcf945832752606d72e62e0d636ca0e80c2'/>
<id>d1330fcf945832752606d72e62e0d636ca0e80c2</id>
<content type='text'>
MinGW is also Windows, so it doesn't work for MinGW either.
https://github.com/ruby/ruby/actions/runs/17250269899/job/48950567246
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MinGW is also Windows, so it doesn't work for MinGW either.
https://github.com/ruby/ruby/actions/runs/17250269899/job/48950567246
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust snt &lt; max_cpu calculation</title>
<updated>2025-08-21T18:37:07+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-08-20T05:22:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7ac16eff311f9bc762586bda9540d82e8eb7f135'/>
<id>7ac16eff311f9bc762586bda9540d82e8eb7f135</id>
<content type='text'>
[Bug #20146]

Previously we dealt with the main Ractor not being enabled for M:N by
incrementing snt_cnt++. This worked for comparing against ractor count,
but meant that we always had one less SNT than was specified by
RUBY_MAX_CPU.

This was notably a problem for RUBY_MAX_CPU=1, which would cause Ractors
to hang.

This commit instead of adjusting snt, adjusts a
"schedulable_ractor_cnt". This way snt_cnt will actually reach
RUBY_MAX_CPU.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20146]

Previously we dealt with the main Ractor not being enabled for M:N by
incrementing snt_cnt++. This worked for comparing against ractor count,
but meant that we always had one less SNT than was specified by
RUBY_MAX_CPU.

This was notably a problem for RUBY_MAX_CPU=1, which would cause Ractors
to hang.

This commit instead of adjusting snt, adjusts a
"schedulable_ractor_cnt". This way snt_cnt will actually reach
RUBY_MAX_CPU.
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip an unstable Ractor test for windows (#14247)</title>
<updated>2025-08-15T19:29:31+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2025-08-15T19:29:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=88906e13e6ed9e5fdd94886ef8ab15d21d26743d'/>
<id>88906e13e6ed9e5fdd94886ef8ab15d21d26743d</id>
<content type='text'>
https://github.com/ruby/ruby/actions/runs/16995599804/job/48185434078?pr=14242</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/ruby/actions/runs/16995599804/job/48185434078?pr=14242</pre>
</div>
</content>
</entry>
<entry>
<title>Increase timeout for a flaky test (#14233)</title>
<updated>2025-08-14T23:41:01+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-08-14T23:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5e8f9ea4953af1737a477613aa31e72ca81031c6'/>
<id>5e8f9ea4953af1737a477613aa31e72ca81031c6</id>
<content type='text'>
https://github.com/ruby/ruby/actions/runs/16977882022/job/48131284556</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/ruby/actions/runs/16977882022/job/48131284556</pre>
</div>
</content>
</entry>
<entry>
<title>Skip an unstable Ractor test for macOS (#14231)</title>
<updated>2025-08-14T22:09:35+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashi.kokubun@shopify.com</email>
</author>
<published>2025-08-14T22:09:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e305a6721e8adcde32fbdba2782094477eb3a53b'/>
<id>e305a6721e8adcde32fbdba2782094477eb3a53b</id>
<content type='text'>
https://github.com/ruby/ruby/actions/runs/16977094733/job/48128667252?pr=14229</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/ruby/actions/runs/16977094733/job/48128667252?pr=14229</pre>
</div>
</content>
</entry>
</feed>
