https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-11-08T17:43:53ZRuby Issue Tracking SystemRuby master - Bug #5577: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30.https://bugs.ruby-lang.org/issues/5577?journal_id=219962011-11-08T17:43:53Zznz (Kazuhiro NISHIYAMA)
<ul><li><strong>Assignee</strong> set to <i>sorah (Sorah Fukumori)</i></li></ul> Ruby master - Bug #5577: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30.https://bugs.ruby-lang.org/issues/5577?journal_id=244992012-03-11T17:28:50Zsorah (Sorah Fukumori)her@sorah.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r34968.<br>
Akira, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>
<p>lib/test/unit.rb: Put error message into STDERR if failed to lanch<br>
worker (job) process. <a href="/issues/5577">[ruby-dev:44802]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30. (Closed)" href="https://bugs.ruby-lang.org/issues/5577">#5577</a>]</p>
</li>
<li>
<p>lib/test/unit/parallel.rb: If failed to increment_io, exit with code<br>
2. <a href="/issues/5577">[ruby-dev:44802]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30. (Closed)" href="https://bugs.ruby-lang.org/issues/5577">#5577</a>]</p>
</li>
</ul> Ruby master - Bug #5577: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30.https://bugs.ruby-lang.org/issues/5577?journal_id=245182012-03-11T18:53:13Zsorah (Sorah Fukumori)her@sorah.jp
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li></ul><p>とりあえず根本の原因である worker の起動に失敗したときはエラーメッセージを表示して exit 1 するようにしました。 (r34968)</p>
<p>ただ、(ulimit -n 30; make test-all TESTS='test/testunit/test_parallel.rb') は治す前から OS X だと刺さって<br>
timeout 待ちになるのでそこを調査してます。</p>
<p>lib/test/unit.rb:464 の while _io=IO.select(@ios)[0] の行の上に p @workers を入れて、以下のようにテストすると</p>
<p>$ make install-nodoc<br>
$ cat ../../test.rb<br>
ARGV = ["-j1"]<br>
require "#{File.dirname(<strong>FILE</strong>)/test/testunit/tests_for_parallel/runner"<br>
$ ( ulimit -n 15; make gdb-ruby )<br>
gdb -x run.gdb --quiet --args ruby ../../test.rb<br>
Reading symbols for shared libraries .... done<br>
Breakpoint 1 at 0x20c49ba5d5e854: file ../../debug.c, line 137.<br>
Reading symbols for shared libraries +++............................ done<br>
Reading symbols for shared libraries . done<br>
Reading symbols for shared libraries . done<br>
../../test.rb:1: warning: already initialized constant ARGV<br>
Run options: -j1</p>
<a name="Running-tests"></a>
<h1 >Running tests:<a href="#Running-tests" class="wiki-anchor">¶</a></h1>
<p>[15463:waiting]<br>
^C<br>
Program received signal SIGINT, Interrupt.<br>
0x000000010006aece in rb_newobj () at ../../gc.c:1328<br>
1328 objspace->heap.free_slots->freelist = RANY(obj)->as.free.next;<br>
Current language: auto; currently minimal<br>
(gdb) rb_backtrace<br>
from ../../test.rb:2:in <code><main>' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/rubygems/custom_require.rb:36:in </code>require'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/rubygems/custom_require.rb:36:in <code>require' from /.../ruby/test/testunit/tests_for_parallel/runner.rb:10:in </code><top (required)>'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:696:in <code>run' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:692:in </code>run'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:660:in <code>run' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:21:in </code>run'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/minitest/unit.rb:911:in <code>run' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/minitest/unit.rb:922:in </code>_run'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/minitest/unit.rb:922:in <code>each' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/minitest/unit.rb:923:in </code>block in _run'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/minitest/unit.rb:936:in <code>run_tests' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/minitest/unit.rb:773:in </code>_run_anything'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:614:in <code>_run_suites' from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:465:in </code>_run_parallel'<br>
from /.../ruby/builds/trunk/local/lib/ruby/2.0.0/test/unit.rb:465:in `select'</p>
<p>while _io=IO.select(@ios)[0] の行で動作が止まり終了してくれない状態です。<br>
p @workers の出力 [15463:waiting] は、 Worker#to_s の出力で "pid:状態" というフォーマットになっており、<br>
pid 15463 で waiting の状態 (worker が起動した後最初に worker が出力 ready という文字列を待っている状態) である事がわかります。<br>
また @ios は @workers.map(&:io) で、worker プロセスとのパイプ (IO.popen で生成) の配列になっています。</p>
<p>^C する前に別のターミナルで <code>ps 15463</code> して確認すると既に worker が終了しているので、<br>
何故 @ios に含まれる IO に EOF が来ないか、というのを調べています。</p> Ruby master - Bug #5577: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30.https://bugs.ruby-lang.org/issues/5577?journal_id=829152019-12-03T08:26:34Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io `(ulimit -n 30; make test..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/409e4ab740de3852c3667217bcf41b55040f638f">git|409e4ab740de3852c3667217bcf41b55040f638f</a>.</p>
<hr>
<p>tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io</p>
<p><code>(ulimit -n 30; make test-tool)</code> fails with unexplicit message:<br>
"undefined method `write' for nil:NilClass" due to lack of stdout.</p>
<p>This change makes it explicit. [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30. (Closed)" href="https://bugs.ruby-lang.org/issues/5577">#5577</a>]</p> Ruby master - Bug #5577: test/testunit/test_parallel.rb causes NoMethodError when file descriptor is limited to 30.https://bugs.ruby-lang.org/issues/5577?journal_id=829162019-12-03T08:27:33Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>いまmacOSで試してみましたが、特に刺さるようなことはありませんでした。閉じておきます。</p>