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

ruby-changes:34494

From: usa <ko1@a...>
Date: Fri, 27 Jun 2014 16:57:44 +0900 (JST)
Subject: [ruby-changes:34494] usa:r46575 (ruby_2_0_0): merge revision(s) 46194: [Backport #9835]

usa	2014-06-27 16:57:24 +0900 (Fri, 27 Jun 2014)

  New Revision: 46575

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

  Log:
    merge revision(s) 46194: [Backport #9835]
    
    * signal.c (signal_exec): ignore immediate cmd for SIG_IGN
    
    * signal.c (trap_handler): set cmd to true for SIG_IGN
    
    * signal.c (trap): handle nil and true values for oldcmd
      [Bug #9835]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/signal.c
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 46574)
+++ ruby_2_0_0/ChangeLog	(revision 46575)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Jun 27 16:56:38 2014  Eric Wong  <e@8...>
+
+	* signal.c (signal_exec): ignore immediate cmd for SIG_IGN
+	* signal.c (trap_handler): set cmd to true for SIG_IGN
+	* signal.c (trap): handle nil and true values for oldcmd
+	  [Bug #9835]
+
 Mon Jun 23 18:51:43 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* class.c (rb_mod_init_copy): always clear instance variable,
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 46574)
+++ ruby_2_0_0/version.h	(revision 46575)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2014-06-23"
-#define RUBY_PATCHLEVEL 499
+#define RUBY_RELEASE_DATE "2014-06-27"
+#define RUBY_PATCHLEVEL 500
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_DAY 27
 
 #include "ruby/version.h"
 
Index: ruby_2_0_0/signal.c
===================================================================
--- ruby_2_0_0/signal.c	(revision 46574)
+++ ruby_2_0_0/signal.c	(revision 46575)
@@ -680,6 +680,15 @@ signal_exec(VALUE cmd, int safe, int sig https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/signal.c#L680
     volatile unsigned long old_interrupt_mask = cur_th->interrupt_mask;
     int state;
 
+    /*
+     * workaround the following race:
+     * 1. signal_enque queues signal for execution
+     * 2. user calls trap(sig, "IGNORE"), setting SIG_IGN
+     * 3. rb_signal_exec runs on queued signal
+     */
+    if (IMMEDIATE_P(cmd))
+	return;
+
     cur_th->interrupt_mask |= TRAP_INTERRUPT_MASK;
     TH_PUSH_TAG(cur_th);
     if ((state = EXEC_TAG()) == 0) {
@@ -831,7 +840,7 @@ trap_handler(VALUE *cmd, int sig) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/signal.c#L840
 		if (strncmp(RSTRING_PTR(command), "SIG_IGN", 7) == 0) {
 sig_ign:
                     func = SIG_IGN;
-                    *cmd = 0;
+                    *cmd = Qtrue;
 		}
 		else if (strncmp(RSTRING_PTR(command), "SIG_DFL", 7) == 0) {
 sig_dfl:
@@ -912,10 +921,13 @@ trap(int sig, sighandler_t func, VALUE c https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/signal.c#L921
     oldcmd = vm->trap_list[sig].cmd;
     switch (oldcmd) {
       case 0:
+      case Qtrue:
 	if (oldfunc == SIG_IGN) oldcmd = rb_str_new2("IGNORE");
 	else if (oldfunc == sighandler) oldcmd = rb_str_new2("DEFAULT");
 	else oldcmd = Qnil;
 	break;
+      case Qnil:
+	break;
       case Qundef:
 	oldcmd = rb_str_new2("EXIT");
 	break;

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r46194


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

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