From 885135f84cd609fb1c7be3fa0a20ae77969eae9d Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 10 Dec 2020 21:56:48 -0800 Subject: Allow an MJIT worker to show a backtrace on SEGV An MJIT worker thread doesn't have ec, and it's required for SDR() and rb_backtrace_print_as_bugreport(). Therefore it must be checked. --- vm_dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm_dump.c b/vm_dump.c index 6548a705dc..46c2520769 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -941,8 +941,9 @@ rb_vm_bugreport(const void *ctx) enum {other_runtime_info = 0}; #endif const rb_vm_t *const vm = GET_VM(); + const rb_execution_context_t *ec = GET_EC(); - if (vm) { + if (vm && ec) { SDR(); rb_backtrace_print_as_bugreport(); fputs("\n", stderr); -- cgit v1.2.3