Ruby Issue Tracking System: Issueshttps://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-10-24T21:43:23ZRuby Issue Tracking System
Redmine Ruby master - Bug #9051 (Closed): open-uri meta_add_field method removed https://bugs.ruby-lang.org/issues/90512013-10-24T21:43:23Zeweb (Eamonn Webster)eamonn.webster@gmail.com
<p>In the fix for bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: open-uri failed to handle multiple "Set-Cookie" headers (Closed)" href="https://bugs.ruby-lang.org/issues/4964">#4964</a> the method Meta#meta_add_field(name, value) was removed and replaced with meta_add_field2(name, values) Note plural!</p>
<p>This breaks code that uses meta_add_field. e.g. HTTPClient.</p>
<p>The fix is to re-implement meta_add_field using meta_add_field2</p> Ruby master - Bug #9040 (Closed): Readline duplicate file descriptors but doesn't close them https://bugs.ruby-lang.org/issues/90402013-10-21T21:36:28Zeweb (Eamonn Webster)eamonn.webster@gmail.com
<p>This depends on the max open files limit, happens quicker the lower the limit.<br>
irb crashes just by holding down return. Uses two file descriptors per prompt.</p>
<p>input=': Too many open files - dup (Errno::EMFILE)</p>
<p>or if you don't want to hold down the key...</p>
<p>ulimit -n 100<br>
ruby -r readline -e "100.times{ Readline.input = STDIN }"</p>
<p>A recent patch to readline to avoid a segv when the underlying FILE has been closed, changed the way that the input and output streams<br>
are assigned.</p>
<p>When a stream is assigned, its file descriptor is extracted, dup'ed and passed to fdopen.<br>
As the file descriptor is dup'ed the two file descriptors (in the FILE owned by the readline library and the one inside the ruby rb_io_t)<br>
don't match.</p>
<p>Before assigning the previous value should be cleared. But this only happens when the ruby stream has been closed or when the two file descriptors are the same (never).</p>
<p>As we always dup the file descriptors, we own them, and should always close them.</p>