summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-03-09 16:29:50 +0900
committerusa <usa@garbagecollect.jp>2022-11-24 20:01:26 +0900
commit5fb3cf463c2d78a161fba6a4486bd48e0cbd96c9 (patch)
tree5a1713dac684306d06192d48aa2c93decc7b067e
parent22ace33a78583d92e08f556dcf8c3433118d0408 (diff)
Keep GC disabled until VM bootstrap has done [Bug #17583]
-rw-r--r--test/ruby/test_thread.rb4
-rw-r--r--vm.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 3852cb7020..9643a61cb6 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1146,7 +1146,9 @@ q.pop
env = {}
env['RUBY_THREAD_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size
env['RUBY_THREAD_MACHINE_STACK_SIZE'] = machine_stack_size.to_s if machine_stack_size
- out, = EnvUtil.invoke_ruby([env, '-e', script], '', true, true)
+ out, err, status = EnvUtil.invoke_ruby([env, '-e', script], '', true, true)
+ assert_not_predicate(status, :signaled?, err)
+
use_length ? out.length : out
end
diff --git a/vm.c b/vm.c
index 2503ca9a9f..0259d9c9e7 100644
--- a/vm.c
+++ b/vm.c
@@ -3671,6 +3671,8 @@ Init_VM(void)
* The Binding of the top level scope
*/
rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new());
+
+ rb_objspace_gc_enable(vm->objspace);
}
vm_init_redefined_flag();
@@ -3736,8 +3738,6 @@ Init_vm_objects(void)
vm->mark_object_ary = rb_ary_tmp_new(128);
vm->loading_table = st_init_strtable();
vm->frozen_strings = st_init_table_with_size(&rb_fstring_hash_type, 10000);
-
- rb_objspace_gc_enable(vm->objspace);
}
/* top self */