ruby-changes:64248
From: Koichi <ko1@a...>
Date: Fri, 18 Dec 2020 01:20:50 +0900 (JST)
Subject: [ruby-changes:64248] 6538c89f1c (master): gc_verify_internal_consistency() needs barrier
https://git.ruby-lang.org/ruby.git/commit/?id=6538c89f1c From 6538c89f1c9d1af95c0fb3e58ac0e807a5fe47f4 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Fri, 18 Dec 2020 01:19:03 +0900 Subject: gc_verify_internal_consistency() needs barrier gc_verify_internal_consistency() accesses all slots (objects) so all ractors should stop before starting this function. diff --git a/gc.c b/gc.c index 386e140..f6bfaf6 100644 --- a/gc.c +++ b/gc.c @@ -7059,7 +7059,6 @@ gc_verify_heap_pages(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L7059 static VALUE gc_verify_internal_consistency_m(VALUE dummy) { - ASSERT_vm_locking(); gc_verify_internal_consistency(&rb_objspace); return Qnil; } @@ -7143,6 +7142,9 @@ gc_verify_internal_consistency_(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L7142 static void gc_verify_internal_consistency(rb_objspace_t *objspace) { + ASSERT_vm_locking(); + rb_vm_barrier(); // stop other ractors + unsigned int prev_during_gc = during_gc; during_gc = FALSE; // stop gc here { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/