From 71cf71dee0bf22c94b59357f6676ea184408f2d5 Mon Sep 17 00:00:00 2001 From: d-netto Date: Wed, 24 Jul 2024 13:05:06 -0300 Subject: [PATCH] add an assertion to ensure we're not cleaning-up GC state for GC threads --- src/gc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gc.c b/src/gc.c index a82ad615d8c2b..e6c15471fedba 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3715,8 +3715,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) } // free empty GC state for threads that have exited if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) { - if (gc_is_parallel_collector_thread(t_i)) - continue; + // GC threads should never exit + assert(!gc_is_parallel_collector_thread(t_i)); + assert(!gc_is_concurrent_collector_thread(t_i)); jl_thread_heap_t *heap = &ptls2->gc_tls.heap; if (heap->weak_refs.len == 0) small_arraylist_free(&heap->weak_refs);