mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix crash on bootup when RGENGC_CHECK_MODE=2 with GC stress
We need to unshare the array loaded_features because the shared root could be old gen (while loaded_features is young) which causes a WB miss.
This commit is contained in:
parent
9c15da0fd4
commit
44379805b0
Notes:
git
2022-01-05 04:46:42 +09:00
1 changed files with 4 additions and 1 deletions
3
ruby.c
3
ruby.c
|
@ -2062,7 +2062,10 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
|
|||
for (long i = loaded_before_enc; i < RARRAY_LEN(loaded_features); ++i) {
|
||||
VALUE path = RARRAY_AREF(loaded_features, i);
|
||||
if (!(path = copy_str(path, IF_UTF8_PATH(uenc, lenc), true))) continue;
|
||||
if (!modified) {
|
||||
rb_ary_modify(loaded_features);
|
||||
modified = true;
|
||||
}
|
||||
RARRAY_ASET(loaded_features, i, path);
|
||||
}
|
||||
if (modified) {
|
||||
|
|
Loading…
Reference in a new issue