From 2b5a6744407d34ca81cfa91b2b69c13043981f86 Mon Sep 17 00:00:00 2001 From: Luke Gruber Date: Fri, 23 May 2025 13:53:00 -0400 Subject: [PATCH] ractor_wakeup was broken when compiled with USE_RUBY_DEBUG_LOG The `ractor_wakeup` function takes an optional `th` argument, so it can be NULL. There is a macro call to RUBY_DEBUG_LOG that dereferences `th` without checking if it's NULL first. To fix this, we never dereference `th` in this macro call. --- ractor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ractor.c b/ractor.c index e8d2f7a69e..6d47c918de 100644 --- a/ractor.c +++ b/ractor.c @@ -576,9 +576,8 @@ ractor_wakeup(rb_ractor_t *r, rb_thread_t *th /* can be NULL */, enum rb_ractor_ { ASSERT_ractor_locking(r); - RUBY_DEBUG_LOG("r:%u wait_by:%s -> wait:%s wakeup:%s", + RUBY_DEBUG_LOG("r:%u wait:%s wakeup:%s", rb_ractor_id(r), - wait_status_str(th->ractor_waiting.wait_status), wait_status_str(wait_status), wakeup_status_str(wakeup_status));