ruby/internal
KJ Tsanaktsidis 25f5b83689 Fix crash when printing RGENGC_DEBUG=5 output from GC
I was trying to debug an (unrelated) issue in the GC, and wanted to turn
on the trace-level GC output by compiling it with -DRGENGC_DEBUG=5.
Unfortunately, this actually causes a crash in newobj_init() because the
code there tries to log the obj_info() of the newly created object.
However, the object is not actually sufficiently set up for some of the
things that obj_info() tries to do:

* The instance variable table for a class is not yet initialized, and
  when using variable-length RVALUES, said ivar table is embedded in
  as-yet unitialized memory after the struct RValue. Attempting to read
  this, as obj_info() does, causes a crash.
* T_DATA variables need to dereference their ->type field to print out
  the underlying C type name, which is not set up until newobj_fill() is
  called.

To fix this, create a new method `obj_info_basic`, which dumps out only
the parts of the object that are valid before the object is fully
initialized.

[Fixes #18795]
2024-01-11 10:44:57 +11:00
..
2023-10-05 20:03:54 +09:00
2023-12-19 13:09:36 -08:00
2023-12-07 15:52:35 -05:00
2023-12-07 15:52:35 -05:00
2023-12-07 15:52:35 -05:00
2023-10-14 11:08:43 +09:00
2023-10-14 11:08:43 +09:00
2023-12-07 15:52:35 -05:00
2023-12-01 15:04:31 -05:00
2023-12-07 15:52:35 -05:00
2024-01-05 05:51:25 +09:00
2023-12-07 15:52:35 -05:00
2023-11-24 13:29:04 -05:00