From: "Eregon (Benoit Daloze) via ruby-core" Date: 2025-03-12T20:12:28+00:00 Subject: [ruby-core:121311] [Ruby master Bug#19387] Issue with ObjectSpace.each_objects not returning objects after starting a ractor Issue #19387 has been updated by Eregon (Benoit Daloze). One idea to solve this would be to implement `ObjectSpace.each_object` like TruffleRuby does it (at least when there are multiple Ractors): basically it's just the transitive `ObjectSpace.reachable_objects_from(roots)`. I.e. it uses the same mechanism as GC traversal/marking to find every object reachable from some roots objects (like `Object` class, the stack frames, etc). Context: the latest breakage due to this bug: https://github.com/ruby/prism/pull/3491 And I know of many before, it's a very common issue that `Ractor.new` can't be used in `make test-all`. ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-112275 * Author: luke-gru (Luke Gruber) * Status: Assigned * Assignee: ko1 (Koichi Sasada) * ruby -v: 3.3.0 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ```ruby 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 } ``` -- 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/