[ruby-core:112091] [Ruby master Bug#19387] Issue with ObjectSpace.each_objects not returning IO objects after starting a ractor

Issue #19387 has been reported by luke-gru (Luke Gruber). ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning IO objects after starting a ractor https://bugs.ruby-lang.org/issues/19387 * Author: luke-gru (Luke Gruber) * Status: Open * Priority: Normal * 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/

Issue #19387 has been updated by luke-gru (Luke Gruber). 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. ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-101525 * Author: luke-gru (Luke Gruber) * Status: Open * Priority: Normal * 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/

Issue #19387 has been updated by hsbt (Hiroshi SHIBATA). Status changed from Open to Assigned Assignee set to ko1 (Koichi Sasada) ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-101680 * Author: luke-gru (Luke Gruber) * Status: Assigned * Priority: Normal * Assignee: ko1 (Koichi Sasada) * 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/

Issue #19387 has been updated by ko1 (Koichi Sasada). Status changed from Closed to Assigned c08fdc68383ee368c18e15e298502e6ee0089e18 is not related to this ticket. ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-104467 * Author: luke-gru (Luke Gruber) * Status: Assigned * Priority: Normal * Assignee: ko1 (Koichi Sasada) * 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/

Issue #19387 has been updated by luke-gru (Luke Gruber). ruby -v set to 3.3.0 I believe this was closed prematurely due to an unrelated git commit that wrongly tagged it. Please reopen :) ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-106007 * Author: luke-gru (Luke Gruber) * Status: Closed * Priority: Normal * 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/

Issue #19387 has been updated by luke-gru (Luke Gruber). It happened again :( I notified the committer of the mistake. Please reopen, thanks! ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-106176 * Author: luke-gru (Luke Gruber) * Status: Closed * Priority: Normal * 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/

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/

Issue #19387 has been updated by tenderlovemaking (Aaron Patterson). Assignee changed from ko1 (Koichi Sasada) to ractor ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-112427 * Author: luke-gru (Luke Gruber) * Status: Assigned * Assignee: ractor * 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/

Issue #19387 has been updated by osyoyu (Daisuke Aritomo). I also ran into this, so I opened an pull request document this behavior. https://github.com/ruby/ruby/pull/13278 ---------------------------------------- Bug #19387: Issue with ObjectSpace.each_objects not returning objects after starting a ractor https://bugs.ruby-lang.org/issues/19387#change-113039 * Author: luke-gru (Luke Gruber) * Status: Assigned * Assignee: ractor * 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/
participants (6)
-
Eregon (Benoit Daloze)
-
hsbt (Hiroshi SHIBATA)
-
ko1 (Koichi Sasada)
-
luke-gru (Luke Gruber)
-
osyoyu (Daisuke Aritomo)
-
tenderlovemaking (Aaron Patterson)