https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112009-01-09T19:18:38ZRuby Issue Tracking SystemRuby 1.8 - Bug #993: obsolete "nonblocking IO#read" used in system callshttps://bugs.ruby-lang.org/issues/993?journal_id=25562009-01-09T19:18:38Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>=begin<br>
Sorry but I've not been able to reproduce this.</p>
<p>Can you shou us a short ruby script that shows that error message?<br>
=end</p> Ruby 1.8 - Bug #993: obsolete "nonblocking IO#read" used in system callshttps://bugs.ruby-lang.org/issues/993?journal_id=25572009-01-09T19:48:31ZJWuttke (Joachim Wuttke)j.wuttke@fz-juelich.de
<ul></ul><p>=begin<br>
It is not that easy to reproduce the warning. I am issuing the <code>ls ..</code> command every ten seconds, and I get only a couple of warning messages per day, at irregular intervals. I should also explain that the directory I am running the ls against is mounted via NFS. Probably the warning only appears when a network congestion causes some delay in the execution of ls.</p>
<p>I would approach the problem in a very different way: Since IO#read is obsolete, I would search for obsolete lines in the Ruby source. Unfortunately, my knowledge of CRuby (the program) is basically zero so that I have no idea where to start searching.<br>
=end</p> Ruby 1.8 - Bug #993: obsolete "nonblocking IO#read" used in system callshttps://bugs.ruby-lang.org/issues/993?journal_id=25582009-01-09T20:55:16ZJWuttke (Joachim Wuttke)j.wuttke@fz-juelich.de
<ul></ul><p>=begin<br>
Well, I searched in the source. The "nonblocking" warning comes from io.c:io_fread. It is issued only if<br>
a C library function (getc) raises EAGAIN or EWOULDBLOCK. This is consistent with my observation that<br>
the warning appears only at irregular intervals - namely, if some anomaly occurs during execution of the<br>
<code>..</code> statement.</p>
<p>I think this is a very unsatisfactory state of affairs: If "IO#read" should not be used, (1) a warning should be given at "compile time", not at run time, and (2) it should not be used internally by the implementation of <code>..</code> (which I am still not able to locate in the source code).</p>
<p>=end</p> Ruby 1.8 - Bug #993: obsolete "nonblocking IO#read" used in system callshttps://bugs.ruby-lang.org/issues/993?journal_id=25592009-01-09T22:32:31Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>=begin<br>
(1) "compile time" is not obvious for this language (as is a dynamic interpreter).</p>
<p>(2) On calling io_fread a backtick does <em>not</em> set its pipe a O_NONBLOCK flag, so<br>
io_fread call should block until piped subprocess says anything (at least<br>
according to Linux man page).</p>
<p>(3) A quick grance at the ls implementation of GNU coreutils does not find any<br>
use of O_NONBLOCK.</p>
<p>So approaching from the source it is suspicious for a backtick to result in<br>
EWOURLDBLOCK.</p>
<p>Of course there can be bugs and that can perhaps happen on occasion, that is<br>
another reason why we want to reproduce that on our environment.<br>
=end</p> Ruby 1.8 - Bug #993: obsolete "nonblocking IO#read" used in system callshttps://bugs.ruby-lang.org/issues/993?journal_id=28962009-02-02T12:52:16Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Assignee</strong> set to <i>shyouhei (Shyouhei Urabe)</i></li><li><strong>ruby -v</strong> set to <i>ruby 1.8.7 </i></li></ul><p>=begin</p>
<p>=end</p> Ruby 1.8 - Bug #993: obsolete "nonblocking IO#read" used in system callshttps://bugs.ruby-lang.org/issues/993?journal_id=621252016-12-21T05:14:50Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul>