diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index a75d42b962..19a3529005 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 3963d67168..b12021668c 100644 --- a/vm.c +++ b/vm.c @@ -3669,6 +3669,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(); @@ -3734,8 +3736,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 */