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

ruby-changes:63763

From: Takashi <ko1@a...>
Date: Fri, 27 Nov 2020 13:10:17 +0900 (JST)
Subject: [ruby-changes:63763] 4dbf6f1e51 (master): Call rb_bug_without_die on CI

https://git.ruby-lang.org/ruby.git/commit/?id=4dbf6f1e51

From 4dbf6f1e515bd6a3b03ba9edccabccb780c3f789 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Thu, 26 Nov 2020 20:08:20 -0800
Subject: Call rb_bug_without_die on CI

when GC.compact's SEGV handler is installed

diff --git a/error.c b/error.c
index 2e02fbf..5383124 100644
--- a/error.c
+++ b/error.c
@@ -733,17 +733,25 @@ die(void) https://github.com/ruby/ruby/blob/trunk/error.c#L733
 }
 
 void
-rb_bug(const char *fmt, ...)
+rb_bug_without_die(const char *fmt, ...)
 {
     const char *file = NULL;
     int line = 0;
 
     if (GET_EC()) {
-	file = rb_source_location_cstr(&line);
+        file = rb_source_location_cstr(&line);
     }
 
     report_bug(file, line, fmt, NULL);
+}
 
+void
+rb_bug(const char *fmt, ...)
+{
+    va_list args;
+    va_start(args, fmt);
+    rb_bug_without_die(fmt, args);
+    va_end(args);
     die();
 }
 
diff --git a/gc.c b/gc.c
index 195a753..48c1455 100644
--- a/gc.c
+++ b/gc.c
@@ -4597,7 +4597,12 @@ static struct sigaction old_sigsegv_handler; https://github.com/ruby/ruby/blob/trunk/gc.c#L4597
 static void
 read_barrier_signal(int sig, siginfo_t * info, void * data)
 {
-	read_barrier_handler((intptr_t)info->si_addr);
+    extern int ruby_on_ci;
+    if (ruby_on_ci) { // read_barrier_handler may crash. Report a backtrace first on CI.
+        extern void rb_bug_without_die(const char *fmt, ...);
+        rb_bug_without_die("died with read_barrier_signal installed");
+    }
+    read_barrier_handler((intptr_t)info->si_addr);
 }
 
 static void uninstall_handlers(void)
-- 
cgit v0.10.2


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

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