[#122973] [PATCH] Add Gem.default_install — Felipe Contreras via ruby-core <ruby-core@...>
We need a way to enable user installs by default so that tools like
3 messages
2025/08/17
[ruby-core:123062] [Ruby Bug#21551] Ractor isolation error points to the wrong place
From:
"tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>
Date:
2025-08-23 23:41:20 UTC
List:
ruby-core #123062
Issue #21551 has been reported by tenderlovemaking (Aaron Patterson).
----------------------------------------
Bug #21551: Ractor isolation error points to the wrong place
https://bugs.ruby-lang.org/issues/21551
* Author: tenderlovemaking (Aaron Patterson)
* Status: Open
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The following code has a bug in it. The block passed to `Ractor.new` references the outer `channel` variable, so it can't be isolated. The problem is that I forgot to add `|channel|` to the block:
```ruby
channel = Ractor::Port.new
coordinator = Ractor.new(channel) do
inbound_work = Ractor::Port.new
channel << inbound_work
end
```
However, the exception this raises is strange:
```
> ruby thing.rb
thing.rb:3: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
thing.rb:3:in 'Ractor.new': can not isolate a Proc because it accesses outer variables (channel). (ArgumentError)
coordinator = Ractor.new(channel) do
^^^^^^^
from thing.rb:3:in '<main>'
```
I would expect the `channel` local inside the block to be underlined instead of the parameter passed to `Ractor.new`.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/