[ruby-core:105651] [Ruby master Bug#18023] Ractor#make_shareable changes the values of closured shareable objects
From:
"nagachika (Tomoyuki Chikanaga)" <noreply@...>
Date:
2021-10-16 04:56:02 UTC
List:
ruby-core #105651
Issue #18023 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.6: DONTNEED, 2.7: DONTNEED, 3.0: REQUIRED to 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
ruby_3_0 5427b08381fb0d644ec69d5aa94234f90a4fbed1 merged revision(s) 76228191474c76810043b294a74bbb2f1808b3d9.
----------------------------------------
Bug #18023: Ractor#make_shareable changes the values of closured shareable objects
https://bugs.ruby-lang.org/issues/18023#change-94153
* Author: slowpilot (Ivan Razuvaev)
* Status: Closed
* Priority: Normal
* ruby -v: 3.0.0, 3.0.1
* Backport: 2.6: DONTNEED, 2.7: DONTNEED, 3.0: DONE
----------------------------------------
Hi. I encountered strange behaviour or shareable procs when every even closured shareable variable becomes the FalseClass instance.
``` ruby
[usr@srvr ~]$ irb
3.0.1 :001 > v1, v2, v3, v4 = :a, :b, :c, :d
=> [:a, :b, :c, :d]
3.0.1 :002 > p = Proc.new { p v1, v2, v3, v4 }
=> #<Proc:0x000000000248ed18 (irb):2>
3.0.1 :003 > p.()
:a
:b
:c
:d
=> [:a, :b, :c, :d]
3.0.1 :004 > Ractor.make_shareable(p).()
:a
false
:c
false
=> [:a, false, :c, false]
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>