[前][次][番号順一覧][スレッド一覧]

ruby-changes:66414

From: Takashi <ko1@a...>
Date: Thu, 3 Jun 2021 13:50:56 +0900 (JST)
Subject: [ruby-changes:66414] 007e439fe9 (master): Do not expect ec on rb_vm_bugreport

https://git.ruby-lang.org/ruby.git/commit/?id=007e439fe9

From 007e439fe965871c73127928f7244ebb96a86e58 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Wed, 2 Jun 2021 21:39:11 -0700
Subject: Do not expect ec on rb_vm_bugreport

because a SEGV might happen on an MJIT worker. As you can clearly see
from `if (vm && ec) {`, ec is not guaranteed to exist here.
---
 vm_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vm_dump.c b/vm_dump.c
index 26a2bf3..a3aaf14 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -1025,7 +1025,7 @@ rb_vm_bugreport(const void *ctx) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L1025
     enum {other_runtime_info = 0};
 #endif
     const rb_vm_t *const vm = GET_VM();
-    const rb_execution_context_t *ec = GET_EC();
+    const rb_execution_context_t *ec = rb_current_execution_context(false);
 
     if (vm && ec) {
 	SDR();
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]