Project

General

Profile

Actions

Bug #19738

closed

`ObjectSpace.each_object.to_a` crashes in `make runirb`.

Added by ioquatix (Samuel Williams) 10 months ago. Updated 4 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:113951]

Description

> make runirb
RUBY_ON_BUG='gdb -x ./.gdbinit -p' ./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems  -r irb -e 'IRB.start("make runirb")' 
irb(main):001:0> ObjectSpace.each_object.to_a
Assertion Failed: ./vm_method.c:1366:callable_method_entry_or_negative:RB_TYPE_P(klass, T_CLASS) || RB_TYPE_P(klass, T_ICLASS)
ruby 3.3.0dev (2023-06-19T19:19:45Z master 9ff4399dec) [arm64-darwin22]

I have no idea why.


Files

error.txt (12.9 KB) error.txt ioquatix (Samuel Williams), 06/20/2023 02:22 AM

Updated by ioquatix (Samuel Williams) 10 months ago

In order to get the assertion failure, you must compile with RUBY_DEBUG=1:

./configure -C --disable-install-doc --prefix=/Users/samuel/.rubies/ruby-head cppflags=-DRUBY_DEBUG=1

Updated by marcelojr63 (Marcelo Marcinio Pereira Junior) 9 months ago

I found a bug in PP when call PP.pp(Thread.current[:__recursive_key__], ''.dup) and this resolved the problem with ObjectSpace.each_object.to_a to me.

Link of PR

Updated by ioquatix (Samuel Williams) 4 months ago

  • Status changed from Open to Closed

I tested Ruby 3.3.0 and it no longer crashes.

irb(main):001> ObjectSpace.each_object.to_a
An error occurred when inspecting the object: #<TypeError: uninitialized MatchData>
Result of Kernel#inspect: #<Array:0x0000000106048980>
=> 

However the output does look a little strange.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like1