https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112010-12-08T09:41:31ZRuby Issue Tracking SystemBackport187 - Backport #4132: Socket.close attempting to close the socket twicehttps://redmine.ruby-lang.org/issues/4132?journal_id=145712010-12-08T09:41:31Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>=begin<br>
Hi,</p>
<p>In message "Re: <a href="/issues/4132">[ruby-core:33628]</a> [Ruby 1.8-Bug#4132][Open] Socket.close attempting to close the socket twice"<br>
on Wed, 8 Dec 2010 07:57:58 +0900, Claudio Villalobos <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> writes:</p>
<p>|Bug <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Socket.close attempting to close the socket twice (Closed)" href="https://redmine.ruby-lang.org/issues/4132">#4132</a>: Socket.close attempting to close the socket twice<br>
|<a href="http://redmine.ruby-lang.org/issues/show/4132" class="external">http://redmine.ruby-lang.org/issues/show/4132</a><br>
|<br>
|Author: Claudio Villalobos<br>
|Status: Open, Priority: Normal<br>
|Category: ext<br>
|ruby -v: ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]<br>
|<br>
|Socket.close calls shutdown twice on the same file descriptor</p>
<p>Ruby 1.8 creates two FILE* streams on a socket to implement<br>
bidirectional communication. Two calls to close(2) is a side effect.<br>
Since it shouldn't do any harm, we don't consider it a bug. Tell us<br>
if it would cause any trouble (other than one useless system call, and<br>
a failure in strace log).</p>
<pre><code> matz.
</code></pre>
<p>=end</p> Backport187 - Backport #4132: Socket.close attempting to close the socket twicehttps://redmine.ruby-lang.org/issues/4132?journal_id=145722010-12-08T10:16:42Zdevmod (Claudio Villalobos)
<ul></ul><p>=begin<br>
Hi,</p>
<p>Since file descriptors are reused after closing, wouldn't there be an edge case where that file descriptor could have been assigned to another socket before the second close had been executed?</p>
<p>=end</p> Backport187 - Backport #4132: Socket.close attempting to close the socket twicehttps://redmine.ruby-lang.org/issues/4132?journal_id=145732010-12-08T10:54:41Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>=begin<br>
Hi,</p>
<p>In message "Re: <a href="https://blade.ruby-lang.org/ruby-core/33630">[ruby-core:33630]</a> [Ruby 1.8-Bug#4132] Socket.close attempting to close the socket twice"<br>
on Wed, 8 Dec 2010 10:18:22 +0900, Claudio Villalobos <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> writes:<br>
|<br>
|Since file descriptors are reused after closing, wouldn't there be an edge case where that file descriptor could have been assigned to another socket before the second close had been executed?</p>
<p>On 1.8 (and mostly on 1.9 too), the execution is protected from<br>
multithreading, so that we don't have to worry about concurrency here.</p>
<pre><code> matz.
</code></pre>
<p>=end</p> Backport187 - Backport #4132: Socket.close attempting to close the socket twicehttps://redmine.ruby-lang.org/issues/4132?journal_id=145742010-12-08T10:58:56Zdevmod (Claudio Villalobos)
<ul></ul><p>=begin<br>
Understood. Thanks<br>
=end</p> Backport187 - Backport #4132: Socket.close attempting to close the socket twicehttps://redmine.ruby-lang.org/issues/4132?journal_id=795282019-07-15T16:10:00Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<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>Backport187</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/79528/diff?detail_id=53083">diff</a>)</li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>ruby -v</strong> deleted (<del><i>ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]</i></del>)</li></ul>