From 8404c4668d7e29be524efdd18f0a3e102d0d716d Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 14 Aug 2025 17:32:13 -0700 Subject: [PATCH] Don't check for stack overflow when ec is NULL --- signal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/signal.c b/signal.c index 9edac5a789..b34b38c60b 100644 --- a/signal.c +++ b/signal.c @@ -877,6 +877,8 @@ static void check_stack_overflow(int sig, const void *addr) { int ruby_stack_overflowed_p(const rb_thread_t *, const void *); + rb_execution_context_t *ec = rb_current_execution_context(false); + if (!ec) return; rb_thread_t *th = GET_THREAD(); if (ruby_stack_overflowed_p(th, addr)) { reset_sigmask(sig);