ruby-changes:35750
From: nobu <ko1@a...>
Date: Tue, 7 Oct 2014 23:40:30 +0900 (JST)
Subject: [ruby-changes:35750] nobu:r47832 (trunk): signal.c: get rid of deadlock by discarded signals
nobu 2014-10-07 23:40:16 +0900 (Tue, 07 Oct 2014) New Revision: 47832 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47832 Log: signal.c: get rid of deadlock by discarded signals * 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] Modified files: trunk/ChangeLog trunk/signal.c trunk/test/ruby/test_signal.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 47831) +++ ChangeLog (revision 47832) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Oct 7 23:40:16 2014 Nobuyoshi Nakada <nobu@r...> + + * 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 <masaki.suketa@n...> * ext/win32ole/win32ole_method.c: use typed data. Index: test/ruby/test_signal.rb =================================================================== --- test/ruby/test_signal.rb (revision 47831) +++ test/ruby/test_signal.rb (revision 47832) @@ -286,5 +286,10 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/ruby/test_signal.rb#L286 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 Index: signal.c =================================================================== --- signal.c (revision 47831) +++ signal.c (revision 47832) @@ -487,7 +487,8 @@ rb_f_kill(int argc, const VALUE *argv) https://github.com/ruby/ruby/blob/trunk/signal.c#L487 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/