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

ruby-changes:23574

From: naruse <ko1@a...>
Date: Sat, 12 May 2012 05:39:46 +0900 (JST)
Subject: [ruby-changes:23574] naruse:r35625 (trunk): * thread.c (rb_threadptr_execute_interrupts_common):

naruse	2012-05-12 05:39:35 +0900 (Sat, 12 May 2012)

  New Revision: 35625

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

  Log:
    * thread.c (rb_threadptr_execute_interrupts_common):
      test_signal_requiring of test/ruby/test_signal.rb fail if the sub
      process is killed on waiting IO in lex_io_gets in rb_load_file in
      rb_load_internal in require.
      This is because
      (1) the process receive the killing signal in
          rb_thread_io_blocking_region in rb_read_internal in lex_io_gets.
      (2) set th->errinfo as INT2FIX(TAG_FATAL) at
          rb_threadptr_execute_interrupts_common.
      (3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG()
          without set loaded as TRUE.
      (4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded
          is FALSE as above. this errinfo should be an exception object
          but this is INT2FIX(TAG_FATAL).
      Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum.

  Modified files:
    trunk/ChangeLog
    trunk/load.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35624)
+++ ChangeLog	(revision 35625)
@@ -1,3 +1,21 @@
+Sat May 12 05:23:06 2012  NARUSE, Yui  <naruse@r...>
+
+	* thread.c (rb_threadptr_execute_interrupts_common):
+	  test_signal_requiring of test/ruby/test_signal.rb fail if the sub
+	  process is killed on waiting IO in lex_io_gets in rb_load_file in
+	  rb_load_internal in require.
+	  This is because
+	  (1) the process receive the killing signal in
+	      rb_thread_io_blocking_region in rb_read_internal in lex_io_gets.
+	  (2) set th->errinfo as INT2FIX(TAG_FATAL) at
+	      rb_threadptr_execute_interrupts_common.
+	  (3) escape rb_load_file in rb_load_internal and jump to EXEC_TAG()
+	      without set loaded as TRUE.
+	  (4) call first rb_exc_raise(GET_THREAD()->errinfo); because loaded
+	      is FALSE as above. this errinfo should be an exception object
+	      but this is INT2FIX(TAG_FATAL).
+	  Don't call first rb_exc_raise if GET_THREAD()->errinfo is Fixnum.
+
 Fri May 11 14:23:11 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (primary): begin/end block should be isolated from outside.
Index: load.c
===================================================================
--- load.c	(revision 35624)
+++ load.c	(revision 35625)
@@ -319,7 +319,8 @@
     th->top_self = self;
     th->top_wrapper = wrapper;
 
-    if (!loaded) {
+    if (!loaded && !FIXNUM_P(GET_THREAD()->errinfo)) {
+	/* an error on loading don't include INT2FIX(TAG_FATAL) see r35625 */
 	rb_exc_raise(GET_THREAD()->errinfo);
     }
     if (state) {

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

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