summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Gruber <luke.gruber@shopify.com>2025-05-23 13:53:00 -0400
committerJohn Hawthorn <john@hawthorn.email>2025-05-23 16:02:48 -0700
commit2b5a6744407d34ca81cfa91b2b69c13043981f86 (patch)
tree56088124085a369f1ec9bd9dc4472fd71c623e1b
parent75b92c5cd6485a6b236101771f571cdf53cbd6a4 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13431
-rw-r--r--ractor.c3
1 files changed, 1 insertions, 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));