diff --git a/ChangeLog b/ChangeLog index 4a79c668d8..de473c22ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Oct 7 23:40:16 2014 Nobuyoshi Nakada + + * signal.c (rb_f_kill): get rid of deadlock as unhandled and + discarded signals do not make interrupt_cond signaled. + based on the patch by Kazuki Tsujimoto at [ruby-dev:48606]. + [Bug #9820] + Tue Oct 7 22:43:44 2014 Masaki Suketa * ext/win32ole/win32ole_method.c: use typed data. diff --git a/signal.c b/signal.c index 171f5ac971..c42ce0aee0 100644 --- a/signal.c +++ b/signal.c @@ -487,7 +487,8 @@ rb_f_kill(int argc, const VALUE *argv) default: t = signal_ignored(sig); if (t) { - if (t < 0) ruby_kill(pid, sig); + if (t < 0 && kill(pid, sig)) + rb_sys_fail(0); break; } signal_enque(sig); diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index 32068a407a..e74a2c4e1e 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -286,5 +286,10 @@ EOS assert_predicate(status, :signaled?, bug9820) assert_equal(trap, status.termsig, bug9820) end + + if Signal.list['CONT'] + bug9820 = '[ruby-dev:48606] [Bug #9820]' + assert_ruby_status(['-e', 'Process.kill(:CONT, $$)']) + end end if Process.respond_to?(:kill) end