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

ruby-changes:53598

From: k0kubun <ko1@a...>
Date: Tue, 20 Nov 2018 07:10:33 +0900 (JST)
Subject: [ruby-changes:53598] k0kubun:r65814 (trunk): revert r65807

k0kubun	2018-11-20 07:10:12 +0900 (Tue, 20 Nov 2018)

  New Revision: 65814

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

  Log:
    revert r65807
    
    it didn't work.
    http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1468677
    
    and skips broken tests for now. But this issue should be fixed soon.

  Modified files:
    trunk/internal.h
    trunk/mjit.c
    trunk/process.c
    trunk/test/ruby/test_process.rb
Index: mjit.c
===================================================================
--- mjit.c	(revision 65813)
+++ mjit.c	(revision 65814)
@@ -677,7 +677,7 @@ mjit_init(struct mjit_options *opts) https://github.com/ruby/ruby/blob/trunk/mjit.c#L677
 }
 
 static void
-stop_worker(int check_ints_p)
+stop_worker(void)
 {
     rb_execution_context_t *ec = GET_EC();
 
@@ -687,17 +687,10 @@ stop_worker(int check_ints_p) https://github.com/ruby/ruby/blob/trunk/mjit.c#L687
         stop_worker_p = TRUE; /* Setting this inside loop because RUBY_VM_CHECK_INTS may make this FALSE. */
         rb_native_cond_broadcast(&mjit_worker_wakeup);
         CRITICAL_SECTION_FINISH(3, "in stop_worker");
-        if (check_ints_p) RUBY_VM_CHECK_INTS(ec);
+        RUBY_VM_CHECK_INTS(ec);
     }
 }
 
-/* A function to stop MJIT worker when it's not safe to allow interrupts. */
-void
-mjit_pause_without_ints(void)
-{
-    stop_worker(FALSE);
-}
-
 /* Stop JIT-compiling methods but compiled code is kept available. */
 VALUE
 mjit_pause(int wait_p)
@@ -723,7 +716,7 @@ mjit_pause(int wait_p) https://github.com/ruby/ruby/blob/trunk/mjit.c#L716
         }
     }
 
-    stop_worker(TRUE);
+    stop_worker();
     return Qtrue;
 }
 
@@ -816,7 +809,7 @@ mjit_finish(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L809
     CRITICAL_SECTION_FINISH(3, "in mjit_finish to wakeup from pch");
 
     /* Stop worker */
-    stop_worker(TRUE);
+    stop_worker();
 
     rb_native_mutex_destroy(&mjit_engine_mutex);
     rb_native_cond_destroy(&mjit_pch_wakeup);
Index: process.c
===================================================================
--- process.c	(revision 65813)
+++ process.c	(revision 65814)
@@ -1506,9 +1506,8 @@ static void https://github.com/ruby/ruby/blob/trunk/process.c#L1506
 before_fork_ruby(void)
 {
     if (mjit_enabled) {
-        /* Avoid leaving locked mutex and units being modified for child process. Here may not be
-           safe for proceeding SIGCHLD handler, so this does not allow RUBY_VM_CHECK_INTS. */
-        mjit_pause_without_ints();
+        /* avoid leaving locked mutex and units being modified for child process. */
+        mjit_pause(FALSE);
     }
 
     before_exec();
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 65813)
+++ test/ruby/test_process.rb	(revision 65814)
@@ -1724,6 +1724,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1724
 
   if Process.respond_to?(:daemon)
     def test_daemon_default
+      skip 'Process.daemon in IO.popen block deadlocks with MJIT [Bug #15320]' if RubyVM::MJIT.enabled?
       data = IO.popen("-", "r+") do |f|
         break f.read if f
         Process.daemon
@@ -1773,6 +1774,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1774
 
     if File.directory?("/proc/self/task") && /netbsd[a-z]*[1-6]/ !~ RUBY_PLATFORM
       def test_daemon_no_threads
+        skip 'Process.daemon in IO.popen block deadlocks with MJIT [Bug #15320]' if RubyVM::MJIT.enabled?
         pid, data = IO.popen("-", "r+") do |f|
           break f.pid, f.readlines if f
           Process.daemon(true, true)
Index: internal.h
===================================================================
--- internal.h	(revision 65813)
+++ internal.h	(revision 65814)
@@ -1633,12 +1633,10 @@ VALUE rb_math_sqrt(VALUE); https://github.com/ruby/ruby/blob/trunk/internal.h#L1633
 #if USE_MJIT
 extern int mjit_enabled;
 VALUE mjit_pause(int wait_p);
-void mjit_pause_without_ints(void);
 VALUE mjit_resume(void);
 #else
 #define mjit_enabled 0
 static inline VALUE mjit_pause(int wait_p){ return Qnil; } /* unreachable */
-static inline void mjit_pause_without_ints(void){} /* unreachable */
 static inline VALUE mjit_resume(void){ return Qnil; } /* unreachable */
 #endif
 

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

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