Actions
Bug #18189
closed`rb_cString` can be NULL during `Init_Object`
Bug #18189:
`rb_cString` can be NULL during `Init_Object`
Description
It's possible for rb_cString to be NULL during Init_Object and thus Init_class_hierarchy which means that rb_fstring_lit, which invokes setup_fake_str, invokes RBASIC_SET_CLASS_RAW(..., NULL) (or possibly just something totally random if it's not zero initialized!).
Later on in register_fstring we have an assertion which also fails to detect the abnormality:
assert(RBASIC_CLASS(args.fstr) == rb_cString);
Because both are NULL. Oops.
It seems that later on, rb_cString is set on that specific fstring. But in my own usage of rb_define_module_under during InitVM_Object, this creates invalid class names which fail when passed into Ruby land.
Actions