Project

General

Profile

Actions

Bug #18189

closed

`rb_cString` can be NULL during `Init_Object`

Added by ioquatix (Samuel Williams) about 3 years ago. Updated about 3 years ago.

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

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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0