https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112008-12-27T03:28:09ZRuby Issue Tracking SystemBackport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=23462008-12-27T03:28:09Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>=begin<br>
<a href="http://redmine.ruby-lang.org/issues/show/755" class="external">http://redmine.ruby-lang.org/issues/show/755</a> patch helps with the 'hangs_windows' test case.<br>
=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=29912009-02-03T11:44:53Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Assignee</strong> set to <i>usa (Usaku NAKAMURA)</i></li></ul><p>=begin</p>
<p>=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=33812009-02-27T21:01:09Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>3</i></li><li><strong>ruby -v</strong> set to <i>-</i></li></ul><p>=begin<br>
When the patch is applied, every select call uses the stack by 112KB (about 1.8KB at present).<br>
And, if you pass 4097 sockets to select, the same problem occurs again.<br>
So this approach is not preferable.</p>
<p>In 1.9, this problem has already been solved, because we didn't have to consider the binary level compatibility.<br>
But in 1.8, we should give priority to maintenance of compatibility more than such a rare case.</p>
<p>Of course, it is necessary to correct this problem if we can.<br>
I leave this problem as Open until another effective ideas arise.<br>
=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=33822009-02-28T01:00:04Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>=begin<br>
Two things come to mind, if 4096 is not an acceptable option :)</p>
<ol>
<li>check for fd number count before doing a select. If it's > FD_SETSIZE raise error.</li>
<li>A compromise, ex: setting FD_SETSIZE to 512, since that's the limit of MSVCRT 6, which is used by 99% of 1.8.x compilers. I put 4096 as a conservative number.</li>
</ol>
<p>Thanks for looking into this.</p>
<p>-=r<br>
=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=45062009-07-07T10:51:46Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>=begin</p>
<p>=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=61062009-10-06T08:58:19Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>=begin<br>
Would it be possible to at least set FD_SETSIZE to 256 so that it works with VC6/mingw (which is 99% of ruby on windows distros)?</p>
<p>That would be good--currently there it is hard for extensions to use select correctly because they overflow the FD set and cannot reset it because it is hard compiled to too small on windows.<br>
Thanks!<br>
-r<br>
=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=82132010-02-08T23:13:59Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/844">socket.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/844/socket.diff">socket.diff</a> added</li></ul><p>=begin<br>
Attaching new patch that has a smaller FD_SETSIZE, with test (fails without FD_SETSIZE, succeeds with).<br>
Possible to commit this one, perhaps?<br>
-r<br>
=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=104632010-04-23T04:13:43Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>=begin<br>
Another option might be something like the following (any feedback?)<br>
Thanks!</p>
<a name="Index-win32win32h"></a>
<h1 >Index: win32/win32.h<a href="#Index-win32win32h" class="wiki-anchor">¶</a></h1>
<p>--- win32/win32.h (revision 26621)<br>
+++ win32/win32.h (working copy)<br>
@@ -23,6 +23,9 @@<br>
#ifdef <strong>BORLANDC</strong><br>
#define USE_WINSOCK2<br>
#endif<br>
+#ifndef FD_SETSIZE<br>
+#if defined <strong>MINGW32</strong><br>
+# define FD_SETSIZE 256 // larger default for msvcrt 6<br>
+#endif<br>
+#endif<br>
#ifdef USE_WINSOCK2<br>
#include <winsock2.h><br>
#include <ws2tcpip.h></p>
<p>=end</p> Backport186 - Backport #670: select doesn't handle fd's > FD_SETSIZE very wellhttps://redmine.ruby-lang.org/issues/670?journal_id=674132017-10-21T10:32:08Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby 1.8</i> to <i>Backport186</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/67413/diff?detail_id=46529">diff</a>)</li><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li><li><strong>ruby -v</strong> deleted (<del><i>-</i></del>)</li></ul><p>1.8.6 is out of date</p>