From cfe2a6e819214a7b76289d0e4b466cc319a44bcc Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Fri, 20 Jan 2023 11:57:21 +0100 Subject: [PATCH] Use postponed jobs on Ruby 3.2.0 Otherwise it can cause a VM crash. Won't be a problem in 3.2.1. --- lib/stackprof.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/stackprof.rb b/lib/stackprof.rb index d595d207..4de14e22 100644 --- a/lib/stackprof.rb +++ b/lib/stackprof.rb @@ -6,6 +6,11 @@ if defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled? StackProf.use_postponed_job! +elsif RUBY_VERSION == "3.2.0" + # 3.2.0 crash is the signal is received at the wrong time. + # Fixed in https://github.com/ruby/ruby/pull/7116 + # The fix is backported in 3.2.1: https://bugs.ruby-lang.org/issues/19336 + StackProf.use_postponed_job! end module StackProf