Actions
Bug #17360
closedObjects disappear from ObjectSpace after using Ractor
Description
Test:
GC.disable
STR = -"testing 123"
x = STR.dup
puts "before:"
ObjectSpace.each_object(String){ |s| puts s.object_id if s == STR }
Ractor.new{ }.take
puts "after:"
ObjectSpace.each_object(String){ |s| puts s.object_id if s == STR }
Result:
before:
60
80
100
<internal:ractor>:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
after:
80
Expected result:
Same object ids should be printed before and after
(BTW why 3 strings with the same value? shouldn't it be 2?)
Updated by shyouhei (Shyouhei Urabe) about 4 years ago
- Status changed from Open to Rejected
Yes this is an intentional behaviour as of 3.0. Currently Ractor and ObjectSpace do not interface well. You cannot mix them now.
Updated by wanabe (_ wanabe) 3 days ago
- Has duplicate Bug #21149: Strange behavior of ObjectSpace.each_object after Ractor.new added
Actions
Like0
Like0Like0