[Bug #21127] Thread deadlock does not display backtraces (#12721)

Previously, Ruby displayed backtraces for each thread on deadlock. However, it has not been shown since Ruby 3.0.
It should display the backtrace for debugging.

Co-authored-by: Jeremy Evans <code@jeremyevans.net>
This commit is contained in:
Masataka Pocke Kuwabara 2025-02-14 16:31:58 +09:00 committed by GitHub
parent b4ed6db096
commit 0cab608d3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
Notes: git 2025-02-14 07:32:15 +00:00
Merged-By: pocke <p.ck.t22@gmail.com>
4 changed files with 40 additions and 9 deletions

View file

@ -5588,7 +5588,7 @@ debug_deadlock_check(rb_ractor_t *r, VALUE msg)
}
}
rb_str_catf(msg, "\n ");
rb_str_concat(msg, rb_ary_join(rb_ec_backtrace_str_ary(th->ec, 0, 0), sep));
rb_str_concat(msg, rb_ary_join(rb_ec_backtrace_str_ary(th->ec, RUBY_BACKTRACE_START, RUBY_ALL_BACKTRACE_LINES), sep));
rb_str_catf(msg, "\n");
}
}