From 8f952a117870d2a3284a33988aa23e7af3a3a2d3 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 25 Mar 2025 12:05:01 -0700 Subject: [PATCH] Clear VM_CHECK lock info on fork We are resetting the actual lock so we should reset this information at the same time. Previously this caused an assertion to fail in debug mode. --- thread_pthread.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thread_pthread.c b/thread_pthread.c index 493350b520..993437f02b 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1549,6 +1549,11 @@ thread_sched_atfork(struct rb_thread_sched *sched) vm->ractor.sched.running_cnt = 0; rb_native_mutex_initialize(&vm->ractor.sched.lock); +#if VM_CHECK_MODE > 0 + vm->ractor.sched.lock_owner = NULL; + vm->ractor.sched.locked = false; +#endif + // rb_native_cond_destroy(&vm->ractor.sched.cond); rb_native_cond_initialize(&vm->ractor.sched.cond); rb_native_cond_initialize(&vm->ractor.sched.barrier_complete_cond);