From 151093b97ed3c394a47d54bc59f299262d964360 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 11 May 2012 20:39:35 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 18 ++++++++++++++++++ load.c | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4e3d016cf1..987c823253 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +Sat May 12 05:23:06 2012 NARUSE, Yui + + * 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 * parse.y (primary): begin/end block should be isolated from outside. diff --git a/load.c b/load.c index 26d8568a03..8659dec38c 100644 --- a/load.c +++ b/load.c @@ -319,7 +319,8 @@ rb_load_internal(VALUE fname, int wrap) 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) {