https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-05-25T11:29:54ZRuby Issue Tracking SystemRuby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=172102011-05-25T11:29:54Zsorah (Sorah Fukumori)her@sorah.jp
<ul><li><strong>Priority</strong> changed from <i>6</i> to <i>Normal</i></li></ul><p>Could you produce <code>ruby -v</code> ? (Like ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux])</p>
<p>And we don't think this issue "Urgent", however you thought "Urgent".</p> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=172202011-05-25T19:17:28Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li></ul><p>Unfortunately, we are not ESPer. Please consider to make reproducer.<br>
Now we have no way to digging your issue.</p> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=174052011-06-01T05:18:59Znathansobo (Nathan Sobo)nathansobo@gmail.com
<ul></ul><p>"ruby -v" =><br>
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]</p>
<p>We have a test case documented here:<br>
<a href="https://github.com/carlhuda/bundler/issues/1200#comment_1269662" class="external">https://github.com/carlhuda/bundler/issues/1200#comment_1269662</a></p>
<p>Thanks!</p> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=174222011-06-01T09:59:06Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>ruby -v</strong> changed from <i>1.9.2-p180</i> to <i>-</i></li></ul><p>Hello, Nathan</p>
<p>I think that this issue is similar to <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: Ctrl-c to interrupt script causes hang and 100% cpu's core load (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/4608">#4608</a>.</p>
<p>In that ticket, a fault of 11.04 kernel is suspected.<br>
Jason Earl said that manual install of Maverick (10.10) kernel<br>
prevents that issue.</p>
<p>But nobody mentioned 10.04 LTS in that ticket.<br>
So I'm not sure that this ticket is really related to <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: Ctrl-c to interrupt script causes hang and 100% cpu's core load (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/4608">#4608</a>.</p>
<p>2011/6/1 Nathan Sobo <a href="mailto:nathansobo@gmail.com" class="email">nathansobo@gmail.com</a>:</p>
<blockquote>
<p>Issue <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONT (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/4777">#4777</a> has been updated by Nathan Sobo.</p>
<p>"ruby -v" =><br>
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]</p>
<p>We have a test case documented here:<br>
<a href="https://github.com/carlhuda/bundler/issues/1200#comment_1269662" class="external">https://github.com/carlhuda/bundler/issues/1200#comment_1269662</a></p>
<a name="Thanks"></a>
<h2 >Thanks!<a href="#Thanks" class="wiki-anchor">¶</a></h2>
<p>Bug <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONT (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/4777">#4777</a>: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONT<br>
<a href="http://redmine.ruby-lang.org/issues/4777" class="external">http://redmine.ruby-lang.org/issues/4777</a></p>
<p>Author: Nathan Sobo<br>
Status: Feedback<br>
Priority: Normal<br>
Assignee:<br>
Category:<br>
Target version:<br>
ruby -v: 1.9.2-p180</p>
<p>We're having an intermittent but fairly frequent issue with a resque worker process that we're daemonizing with daemontools on Ubuntu 10.04 LTS</p>
<p>When we send a QUIT or TERM signal to the process, it is not handled.<br>
When we send a CONT, the process traps and handles QUIT and TERM signals that were ignored just before handling the CONT.<br>
It's as if the CONT frees the signals that were previously ignored.</p>
<p>--<br>
<a href="http://redmine.ruby-lang.org" class="external">http://redmine.ruby-lang.org</a></p>
</blockquote>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=174392011-06-02T01:01:05Zpsanford (Peter Sanford)psanford@nearbuysystems.com
<ul></ul><p>I have reproduced the same issue with Ubuntu 11.04 + ruby 1.9.2-p180 (I have not tried with other ubuntu versions). Here is a simple test script to reproduce the problem:</p>
<p>#!/usr/bin/env ruby</p>
<p><code>/bin/true</code></p>
<p>begin<br>
require 'nonexisting/library'<br>
rescue LoadError<br>
end</p>
<p>while true do<br>
puts "loop"<br>
sleep 1<br>
end</p>
<p>If I remove either the backtick call or the rescue I don't have the problem. If I move the backtick call below the rescue I don't have the problem.</p> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=174602011-06-02T22:23:50Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Third Party's Issue</i></li></ul><p>Nice information!!</p>
<p>But unfortunately, I've confirmed ruby-1.9.2p180 + Fedora15 + your test case doesn't reproduce the issue.<br>
Also strace doesn't show any ruby fault. We have to conclude it's Ubuntu specific issue. I'm sorry.</p> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=174682011-06-03T01:13:15Zpsanford (Peter Sanford)psanford@nearbuysystems.com
<ul></ul><p>Ok. I upgraded to the 2.6.39 kernel (using the kernel-ppa) and the problem went away. I know that there were some issues with 2.6.38 + bash related to signal handling*, although it is not clear to me if there was any kernel change to address the issue.</p>
<ul>
<li>
<a href="http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00073.html" class="external">http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00073.html</a> and<br>
<a href="http://lkml.indiana.edu/hypermail/linux/kernel/1102.1/00742.html" class="external">http://lkml.indiana.edu/hypermail/linux/kernel/1102.1/00742.html</a>
</li>
</ul> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=175182011-06-05T22:45:23Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul></ul><p>OK, I and Endoh-san investigated more. I bet the guilty linux regression is below.<br>
Ruby's timer thread is using pthread_cond_timedwait() and it is using futex_wait() internally.</p>
<p>And, more importantly, this fixing patch was already backported to 2.6.38.4.<br>
Thus, the issue is really Ubuntu specific, unfortunately.</p>
<p>see <a href="https://bugzilla.kernel.org/show_bug.cgi?id=32922" class="external">https://bugzilla.kernel.org/show_bug.cgi?id=32922</a></p>
<hr>
<p>commit 0cd9c6494ee5c19aef085152bc37f3a4e774a9e1<br>
Author: Darren Hart <a href="mailto:dvhart@linux.intel.com" class="email">dvhart@linux.intel.com</a><br>
Date: Thu Apr 14 15:41:57 2011 -0700</p>
<pre><code>futex: Set FLAGS_HAS_TIMEOUT during futex_wait restart setup
The FLAGS_HAS_TIMEOUT flag was not getting set, causing the restart_block to
restart futex_wait() without a timeout after a signal.
Commit b41277dc7a18ee332d in 2.6.38 introduced the regression by accidentally
removing the the FLAGS_HAS_TIMEOUT assignment from futex_wait() during the setup
of the restart block. Restore the originaly behavior.
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=32922
Reported-by: Tim Smith <tsmith201104@yahoo.com>
Reported-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: John Kacur <jkacur@redhat.com>
Cc: stable@kernel.org
Link: http://lkml.kernel.org/r/%3Cdaac0eb3af607f72b9a4d3126b2ba8fb5ed3b883.1302820917.git.dvhart%40linux.intel.com%3E
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
</code></pre> Ruby master - Bug #4777: Ruby 1.9.2-p180 ignoring INT, TERM, and QUIT until it receives CONThttps://bugs.ruby-lang.org/issues/4777?journal_id=175202011-06-05T23:23:06Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>Hello,</p>
<p>2011/6/5 Motohiro KOSAKI <a href="mailto:kosaki.motohiro@gmail.com" class="email">kosaki.motohiro@gmail.com</a>:</p>
<blockquote>
<p>And, more importantly, this fixing patch was already backported to 2.6.38.4.<br>
Thus, the issue is really Ubuntu specific, unfortunately.</p>
</blockquote>
<p>The patch was backported on 18 Apr., while Ubuntu natty was released<br>
on the end of Apr. So it is cruel to blame Ubuntu :-)</p>
<p>The patch has already been backported to ubuntu kernel tree:</p>
<p><a href="http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-natty.git;a=blob;f=kernel/futex.c;h=d5065e8283dac90ec20daf4eee4d530096d048ad;hb=HEAD#l1889" class="external">http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-natty.git;a=blob;f=kernel/futex.c;h=d5065e8283dac90ec20daf4eee4d530096d048ad;hb=HEAD#l1889</a></p>
<p>So, time will solve this problem, I think.<br>
If you want to solve this now, it would be good to consider installing<br>
a new kernel by kernel ppa or manual install.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>