Project

General

Profile

Actions

Bug #17360

closed

Objects disappear from ObjectSpace after using Ractor

Added by Dan0042 (Daniel DeLorme) over 3 years ago. Updated over 3 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:101204]

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) over 3 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.

Actions

Also available in: Atom PDF

Like0
Like0