ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: merch-redmine@jeremyevans.net
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:51093] [Ruby master Bug#12540] test failures when SHARABLE_MIDDLE_SUBSTRING=1
Date: Tue, 10 Aug 2021 23:00:13 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-93226.20210810230012.14@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-12540.20160702062327.14@ruby-lang.org>

Issue #12540 has been updated by jeremyevans0 (Jeremy Evans).


I think this was caused by commit:a707ab4bc8a29241440f56696098efa2f7f3ff45, which removed the term filling if SHARABLE_MIDDLE_SUBSTRING was enabled. I submitted a pull request that basically reverts that commit: https://github.com/ruby/ruby/pull/4731.  I think the term filling can still be done safely, because the places where it was used already call `str_modify_keep_cr`, which should ensure they are dealing with a unique memory buffer.

----------------------------------------
Bug #12540: test failures when SHARABLE_MIDDLE_SUBSTRING=1
https://bugs.ruby-lang.org/issues/12540#change-93226

* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.4.0dev (2016-07-02 trunk 55562) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
SHARABLE_MIDDLE_SUBSTRING=1 でビルドすると Test_StringCStr#test_wchar_lstrip!,Test_StringCStr#test_wchar_rstrip! が失敗します。

~~~
[16604/16757] Test_StringCStr#test_wchar_lstrip! = 0.00 s
  3) Failure:
Test_StringCStr#test_wchar_lstrip! [/home/vagrant/ruby/test/-ext-/string/test_cstr.rb:81]:
Expected {#<Encoding:UTF-16BE>=>"a",
 #<Encoding:UTF-16LE>=>"a",
 #<Encoding:UTF-32BE>=>"a",
 #<Encoding:UTF-32LE>=>"a"} to be empty.

[16606/16757] Test_StringCStr#test_wchar_rstrip! = 0.00 s
  4) Failure:
Test_StringCStr#test_wchar_rstrip! [/home/vagrant/ruby/test/-ext-/string/test_cstr.rb:85]:
Expected {#<Encoding:UTF-16BE>=>" ",
 #<Encoding:UTF-16LE>=>" ",
 #<Encoding:UTF-32BE>=>" ",
 #<Encoding:UTF-32LE>=>" "} to be empty.
~~~

原因を調べてみたところ、lstrip!,rstrip! だけ !SHARABLE_MIDDLE_SUBSTRING で TERM_FILL をくくっているからのようでした。

調べていて思ったのですが、個別に TERM_FILL を呼ぶかどうかを分岐するよりも、 SHARABLE_MIDDLE_SUBSTRING の値によって TERM_FILL 自体の定義を変更するようにした方が良いのではないでしょうか?



-- 
https://bugs.ruby-lang.org/

           reply	other threads:[~2021-08-10 23:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <redmine.issue-12540.20160702062327.14@ruby-lang.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-93226.20210810230012.14@ruby-lang.org \
    --to=merch-redmine@jeremyevans.net \
    --cc=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).