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

ruby-changes:54072

From: normal <ko1@a...>
Date: Sun, 9 Dec 2018 07:04:55 +0900 (JST)
Subject: [ruby-changes:54072] normal:r66291 (trunk): Revert "thread_pthread.c: fix memory leak from fork loop leapfrog (v2)"

normal	2018-12-09 07:04:43 +0900 (Sun, 09 Dec 2018)

  New Revision: 66291

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66291

  Log:
    Revert "thread_pthread.c: fix memory leak from fork loop leapfrog (v2)"
    
    This reverts r66290 / commit 043047a8fd5315d98eac38ddbd04ebe8db361817.
    
    Still fails on CI, and I'm not able to reproduce the failure, either :<
    http://ci.rvm.jp/results/trunk-test@ruby-sky1/1508228

  Modified files:
    trunk/thread_pthread.c
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 66290)
+++ thread_pthread.c	(revision 66291)
@@ -1726,12 +1726,16 @@ rb_thread_create_timer_thread(void) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1726
     if (setup_communication_pipe_internal(signal_self_pipe.normal) < 0) return;
     if (setup_communication_pipe_internal(signal_self_pipe.ub_main) < 0) return;
 
-    ubf_timer_create(current);
     if (owner != current) {
         /* validate pipe on this process */
+        ubf_timer_create(current);
         sigwait_th = THREAD_INVALID;
         signal_self_pipe.owner_process = current;
     }
+    else if (UBF_TIMER == UBF_TIMER_PTHREAD) {
+        /* UBF_TIMER_PTHREAD needs to recreate after fork */
+        ubf_timer_pthread_create(current);
+    }
 }
 
 static void
@@ -1759,14 +1763,7 @@ ubf_timer_disarm(void) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1763
 static void
 ubf_timer_destroy(void)
 {
-#if UBF_TIMER == UBF_TIMER_POSIX
-    if (timer_posix.owner == getpid()) {
-        ubf_timer_disarm();
-        if (timer_delete(timer_posix.timerid) < 0)
-            rb_sys_fail("timer_delete");
-        memset(&timer_posix, 0, sizeof(timer_posix));
-    }
-#elif UBF_TIMER == UBF_TIMER_PTHREAD
+#if UBF_TIMER == UBF_TIMER_PTHREAD
     int err;
 
     timer_pthread.owner = 0;
@@ -1777,6 +1774,7 @@ ubf_timer_destroy(void) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1774
         rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err);
     }
 #endif
+/* no need to destroy real POSIX timers */
 }
 
 static int

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

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