[#105450] [Ruby master Feature#18228] Add a `timeout` option to `IO.copy_stream` — "byroot (Jean Boussier)" <noreply@...>
Issue #18228 has been reported by byroot (Jean Boussier).
11 messages
2021/09/27
[ruby-core:105397] [Ruby master Bug#18189] `rb_cString` can be NULL during `Init_Object`
From:
"nobu (Nobuyoshi Nakada)" <noreply@...>
Date:
2021-09-23 14:15:46 UTC
List:
ruby-core #105397
Issue #18189 has been updated by nobu (Nobuyoshi Nakada).
I see.
```diff
diff --git i/variable.c w/variable.c
index aa1fdd022eb..c6e1012bddc 100644
--- i/variable.c
+++ w/variable.c
@@ -202,8 +202,7 @@ build_const_pathname(VALUE head, VALUE tail)
VALUE path = rb_str_dup(head);
rb_str_cat2(path, "::");
rb_str_append(path, tail);
- OBJ_FREEZE(path);
- return path;
+ return rb_fstring(path);
}
static VALUE
```
----------------------------------------
Bug #18189: `rb_cString` can be NULL during `Init_Object`
https://bugs.ruby-lang.org/issues/18189#change-93809
* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
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.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>