https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-05-27T02:24:55ZRuby Issue Tracking SystemRuby master - Bug #8442: sendmesg (blocking) of class BasicSocket is repeatably sent by the ruby kernelhttps://bugs.ruby-lang.org/issues/8442?journal_id=395332013-05-27T02:24:55Zm_josenhans (Michael Josenhans)m_josenhans@web.de
<ul></ul><p>Similar bugs have been reported to Jruby & Rubinius:<br>
<a href="https://github.com/rubinius/rubinius/issues/2362" class="external">https://github.com/rubinius/rubinius/issues/2362</a><br>
<a href="http://jira.codehaus.org/browse/JRUBY-7169" class="external">http://jira.codehaus.org/browse/JRUBY-7169</a></p> Ruby master - Bug #8442: sendmesg (blocking) of class BasicSocket is repeatably sent by the ruby kernelhttps://bugs.ruby-lang.org/issues/8442?journal_id=689042017-12-25T18:15:12Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.6</i></del>)</li></ul> Ruby master - Bug #8442: sendmesg (blocking) of class BasicSocket is repeatably sent by the ruby kernelhttps://bugs.ruby-lang.org/issues/8442?journal_id=796912019-07-17T23:04:44Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Backport</strong> deleted (<del><i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN</i></del>)</li></ul><p>I tried the example program provided on Ruby 2.6 on OpenBSD, and did not experience the issue that you were experiencing with 2.0.0-p0 on Linux. Are you able to recreate the problem you were having with a supported version of Ruby?</p>
<p>In terms of Windows, from some research, Windows doesn't implement <code>sendmsg</code>, but Ruby emulates it using <code>WSASendMsg</code>. The emulation checks for errors that Windows returns, and the fallback if errors are detected but cannot be mapped to a specific exception class is to use EINVAL, which is the error you get when running the program on Windows.</p>
<p>From some basic testing, <code>recvmsg</code> and <code>sendmsg</code> work on Windows for UDP sockets, but do not work for TCP sockets, and your example uses <code>sendmsg</code> on a TCP socket. This appears to be expected as the Windows documentation for <code>WSASendMsg</code> (<a href="https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasendmsg" class="external">https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasendmsg</a>) states: <code>The socket descriptor in the s parameter must be opened with the socket type set to SOCK_DGRAM or SOCK_RAW</code>. TCP Sockets are going to use <code>SOCK_STREAM</code>, and as such it appears expected that <code>WSASendMsg</code> would not work on such sockets.</p> Ruby master - Bug #8442: sendmesg (blocking) of class BasicSocket is repeatably sent by the ruby kernelhttps://bugs.ruby-lang.org/issues/8442?journal_id=805502019-08-10T04:36:25Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul>