Project

General

Profile

Actions

Bug #19387

open

Issue with ObjectSpace.each_objects not returning objects after starting a ractor

Added by luke-gru (Luke Gruber) 4 months ago. Updated 4 months ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:112091]

Description

r = Ractor.new do
  receive # block, the problem is not the termination of the ractor but the starting
end

ObjectSpace.each_object(IO) { |io|
  p io # we get no objects
}

Updated by luke-gru (Luke Gruber) 4 months ago

  • Subject changed from Issue with ObjectSpace.each_objects not returning IO objects after starting a ractor to Issue with ObjectSpace.each_objects not returning objects after starting a ractor

The problem is actually for any objects, not just IO.

PR here: https://github.com/ruby/ruby/pull/7191

Edit: I took down the PR because I realized it doesn't properly fix the issue. The only way to get this working, and also to get ObjectSpace._id2ref working, is to keep the RACTOR_BELONGING_ID in all builds, and use that info when letting ractors access the objects.

I'll create another PR with that in mind. But I'm wondering why was this only in debug builds? Does it have to do with speed?

Updated by hsbt (Hiroshi SHIBATA) 4 months ago

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)
Actions

Also available in: Atom PDF

Like0
Like0Like0