https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-07-22T02:32:00ZRuby Issue Tracking SystemRuby master - Bug #6764: IO#read(size, buf) causes can't set length of shared string in trunk (2.0.0dev)https://bugs.ruby-lang.org/issues/6764?journal_id=282612012-07-22T02:32:00Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>This report is not contain small reproducible program.<br>
Why don't you introduce ruby-zip/zlib's case?</p> Ruby master - Bug #6764: IO#read(size, buf) causes can't set length of shared string in trunk (2.0.0dev)https://bugs.ruby-lang.org/issues/6764?journal_id=282652012-07-22T07:23:16Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul></ul><p>On Sun, Jul 22, 2012 at 2:32 AM, naruse (Yui NARUSE) <a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a> wrote:</p>
<blockquote>
<p>This report is not contain small reproducible program.<br>
Why don't you introduce ruby-zip/zlib's case?</p>
</blockquote>
<p>Indeed I should have tried. Let me try.</p>
<p>Here's one likely caused by the same bug:<br>
<a href="https://github.com/aussiegeek/rubyzip/issues/38" class="external">https://github.com/aussiegeek/rubyzip/issues/38</a></p> Ruby master - Bug #6764: IO#read(size, buf) causes can't set length of shared string in trunk (2.0.0dev)https://bugs.ruby-lang.org/issues/6764?journal_id=293242012-09-15T21:04:57Zh.shirosaki (Hiroshi Shirosaki)h.shirosaki@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/3053">fix_read_buf.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3053/fix_read_buf.patch">fix_read_buf.patch</a> added</li></ul><p>I see this bug with rubyzip. I tried to create a patch.</p> Ruby master - Bug #6764: IO#read(size, buf) causes can't set length of shared string in trunk (2.0.0dev)https://bugs.ruby-lang.org/issues/6764?journal_id=294032012-09-16T11:39:26Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r36980.<br>
Hiroshi, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>io.c: io_set_read_length</p>
<ul>
<li>io.c (io_set_read_length): if the read length equals to the buffer<br>
string size then nothing to do. or ensure the string modifiable<br>
before setting the length only when the former is shorter. based on<br>
the patch in <a href="/issues/6764">[ruby-core:47541]</a> by Hiroshi Shirosaki.<br>
<a href="/issues/6764">[ruby-core:46586]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: IO#read(size, buf) causes can't set length of shared string in trunk (2.0.0dev) (Closed)" href="https://bugs.ruby-lang.org/issues/6764">#6764</a>]</li>
</ul>