From 5e0432f59bb85dd3d98be3c1043a1f9c5b41d86b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 28 Oct 2022 16:10:45 -0700 Subject: [PATCH] fix ASAN error in GC --- gc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gc.c b/gc.c index b8c4bfb009..76a1f0f2de 100644 --- a/gc.c +++ b/gc.c @@ -5217,7 +5217,9 @@ try_move(rb_objspace_t *objspace, rb_heap_t *heap, struct heap_page *free_page, if (gc_is_moveable_obj(objspace, src)) { GC_ASSERT(MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(src), src)); + asan_unlock_freelist(free_page); VALUE dest = (VALUE)free_page->freelist; + asan_lock_freelist(free_page); asan_unpoison_object(dest, false); if (!dest) { /* if we can't get something from the freelist then the page must be