ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: ngotogenome@gmail•com
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50552] [Ruby trunk Bug#14786] PTY duplicated "\r" problem on Solaris
Date: Wed, 23 May 2018 15:30:41 +0000 (UTC)	[thread overview]
Message-ID: <redmine.issue-14786.20180523153039.1b9351312fed10db@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-14786.20180523153039@ruby-lang.org

Issue #14786 has been reported by ngoto (Naohisa Goto).

----------------------------------------
Bug #14786: PTY duplicated "\r" problem on Solaris
https://bugs.ruby-lang.org/issues/14786

* Author: ngoto (Naohisa Goto)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Solaris 10 にて、コンパイル時のオプション、実行時の環境やそれらの組み合わせにより、
make test-all にて以下の Failure や Error が出る場合があります。
(r63444 にて確認)

`TestPTY`や`TestIO_Console`のFailureを見るとわかりやすいですが、
PTYが返す文字列に余計な `"\r"` が付加されています。
`TestRubyOptions` のエラーは、余計な `"\r"` が無いことを仮定して子プロセスをPTY内で走らせているために発生したようです。

PerlモジュールIPC-Runにて、Solaris上のPTYにおける同様の現象の発生が報告されていました。
https://rt.cpan.org/Public/Bug/Display.html?id=20105#txn-1306129
このPerlモジュールでは、`"\r"` を複数許すようなパターンを使うことで回避したようです。

Solaris以外でも `"\r\r"` になる現象の発生があるようです。
Pythonの Lib/test/test_pty.py には、OSF/1 (Tru64) にて発生しているようなコメントが書かれています。
https://github.com/python/cpython/blob/825aab95fde959541859383f8ea7e7854ebfd49f/Lib/test/test_pty.py#L48

~~~
    # OSF/1 (Tru64) apparently turns \n into \r\r\n.
    if data.endswith(b'\r\r\n'):
        return data.replace(b'\r\r\n', b'\n')
~~~

以下が make test-all 時のFailureやErrorの抜粋です。

~~~
  2) Failure:
TestIO_Console#test_cooked [/XXXXXXXX-63444/test/io/console/test_io_console.rb:93]:
<"def\r\n"> expected but was
<"def\r\r\n">.

  3) Failure:
TestIO_Console#test_noecho2 [/XXXXXXXX-63444/test/io/console/test_io_console.rb:130]:
<"a\r\n" + "b\r\n"> expected but was
<"a\r\n" + "a\r\r\n" + "b\r\r">.

  4) Failure:
TestIO_Console#test_raw [/XXXXXXXX-63444/test/io/console/test_io_console.rb:18]:
<"abc\r\n"> expected but was
<"abc\r\r\n">.

  5) Failure:
TestIO_Console#test_setecho2 [/XXXXXXXX-63444/test/io/console/test_io_console.rb:168]:
<"a\r\n" + "b\r\n"> expected but was
<"a\r\n" + "a\r\r\n" + "b\r\r">.

  6) Failure:
TestPTY#test_argv0 [/XXXXXXXX-63444/test/test_pty.rb:58]:
<"bar\r\n"> expected but was
<"bar\r\r\n">.

  7) Failure:
TestPTY#test_commandline [/XXXXXXXX-63444/test/test_pty.rb:44]:
<"foo\r\n"> expected but was
<"foo\r\r\n">.

  8) Failure:
TestPTY#test_open [/XXXXXXXX-63444/test/test_pty.rb:131]:
<"foo"> expected but was
<"foo\r">.

  9) Failure:
TestPTY#test_spawn_with_block [/XXXXXXXX-63444/test/test_pty.rb:29]:
<"b\r\n"> expected but was
<"b\r\r\n">.

 10) Failure:
TestPTY#test_spawn_without_block [/XXXXXXXX-63444/test/test_pty.rb:19]:
<"a\r\n"> expected but was
<"a\r\r\n">.

 11) Failure:
TestRubyOptions#test_script_from_stdin [/XXXXXXXX-63444/test/ruby/test_rubyoptions.rb:775]:
[ruby-dev:37798].
Exception raised:
<#<Timeout::Error: execution expired>>.

 12) Failure:
TestRubyOptions#test_script_from_stdin [/XXXXXXXX-63444/test/lib/zombie_hunter.rb:9]:
Expected [[11281, #<Process::Status: pid 11281 exit 0>]] to be empty.

~~~



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

       reply	other threads:[~2018-05-23 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-14786.20180523153039@ruby-lang.org>
2018-05-23 15:30 ` ngotogenome [this message]
2018-05-23 15:42 ` [ruby-dev:50553] [Ruby trunk Bug#14786] PTY duplicated "\r" problem on Solaris ngotogenome

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-list from there: mbox

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

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

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

  git send-email \
    --in-reply-to=redmine.issue-14786.20180523153039.1b9351312fed10db@ruby-lang.org \
    --to=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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 read-only IMAP folder(s) and NNTP newsgroup(s).