https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112021-08-10T23:00:12ZRuby Issue Tracking SystemRuby master - Bug #12540: test failures when SHARABLE_MIDDLE_SUBSTRING=1https://redmine.ruby-lang.org/issues/12540?journal_id=932262021-08-10T23:00:12Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>I think this was caused by <a class="changeset" title="string.c: no terminator * string.c (rb_str_{,l,r}strip_bang): rb_str_subseq() will not NUL-ter..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/a707ab4bc8a29241440f56696098efa2f7f3ff45">a707ab4bc8a29241440f56696098efa2f7f3ff45</a>, which removed the term filling if SHARABLE_MIDDLE_SUBSTRING was enabled. I submitted a pull request that basically reverts that commit: <a href="https://github.com/ruby/ruby/pull/4731" class="external">https://github.com/ruby/ruby/pull/4731</a>. I think the term filling can still be done safely, because the places where it was used already call <code>str_modify_keep_cr</code>, which should ensure they are dealing with a unique memory buffer.</p> Ruby master - Bug #12540: test failures when SHARABLE_MIDDLE_SUBSTRING=1https://redmine.ruby-lang.org/issues/12540?journal_id=932312021-08-11T04:41:13Zjeremyevans (Jeremy Evans)code@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset <a class="changeset" title="Term fill in String#{,l,r}strip! even when SHARABLE_MIDDLE_SUBSTRING Each of these methods calls..." href="https://redmine.ruby-lang.org/projects/ruby-master/repository/git/revisions/84bf4d2ce55e16a4fb51b407a8c9c79e583596b3">git|84bf4d2ce55e16a4fb51b407a8c9c79e583596b3</a>.</p>
<hr>
<p>Term fill in String#{,l,r}strip! even when SHARABLE_MIDDLE_SUBSTRING</p>
<p>Each of these methods calls str_modify_keep_cr before<br>
term filling, which should ensure the backing string<br>
uses private memory, and therefore term filling should<br>
not affect other strings.</p>
<p>Skipping the term filling was added in<br>
a707ab4bc8a29241440f56696098efa2f7f3ff45.</p>
<p>Fixes [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: test failures when SHARABLE_MIDDLE_SUBSTRING=1 (Closed)" href="https://redmine.ruby-lang.org/issues/12540">#12540</a>]</p>