Skip to content

Commit

Permalink
Use postponed jobs on Ruby 3.2.0
Browse files Browse the repository at this point in the history
Otherwise it can cause a VM crash.
Won't be a problem in 3.2.1.
  • Loading branch information
byroot committed Jan 20, 2023
1 parent 86b9cc6 commit cfe2a6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/stackprof.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cfe2a6e

Please sign in to comment.