[#120465] [Ruby master Bug#20998] rb_str_locktmp() changes flags of frozen strings and string literals — "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>
Issue #20998 has been reported by Eregon (Benoit Daloze).
17 messages
2025/01/03
[ruby-core:120656] [Ruby master Bug#19374] Issue with Ractor.make_shareable with curried procs
From:
"luke-gru (Luke Gruber) via ruby-core" <ruby-core@...>
Date:
2025-01-14 03:03:25 UTC
List:
ruby-core #120656
Issue #19374 has been updated by luke-gru (Luke Gruber).
There's a new feature request that should remedy this: https://bugs.ruby-lang.org/issues/21033
----------------------------------------
Bug #19374: Issue with Ractor.make_shareable with curried procs
https://bugs.ruby-lang.org/issues/19374#change-111483
* Author: luke-gru (Luke Gruber)
* Status: Assigned
* Assignee: ko1 (Koichi Sasada)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
This works, but shouldn't:
```ruby
class Worker
def start(&blk)
blk = blk.curry # bug in ruby allows sharing of non-shareable proc
Ractor.make_shareable(blk)
@ractor = Ractor.new(blk) do |b|
main = b.call
p "from ractor: #{main}"
end
end
def work
@ractor.take
end
end
worker = Worker.new
a = self # unshareable main object
p "from main: #{a}"
worker.start { a }
worker.work
```
The curried proc has a reference to the original proc and it's not checked for shareability.
--
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/