Ruby Issue Tracking System: Issues
https://redmine.ruby-lang.org/
https://redmine.ruby-lang.org/favicon.ico?1711330511
2018-11-19T09:35:26Z
Ruby Issue Tracking System
Redmine
Ruby master - Bug #15319 (Closed): Since r65735, tool/mjit_archflag.sh related error on Solaris 10
https://redmine.ruby-lang.org/issues/15319
2018-11-19T09:35:26Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r65735以降、手元の Solaris 10 上でのコンパイルがエラーになります。<br>
コンパイラは gcc, Oracle Developer Studio のどちらでもダメでした。</p>
<p>r65738においてのgccでの最後の方のコンパイル時の出力を抜粋すると以下の通りです。</p>
<pre><code>gcc -O -m64 -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -std=gnu99 -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o math.o -c math.c
+ echo #ifndef RUBY_MJIT_CONFIG_H
+ echo #define RUBY_MJIT_CONFIG_H 1
+ echo
sep=
+ quote MJIT_MIN_HEADER_NAME /include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
+ printf #define MJIT_MIN_HEADER_NAME
+ shift
+ printf "%s" /include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
+ echo
sep=,
+ quote MJIT_CC_COMMON /usr/local/64/bin/gcc
+ printf #define MJIT_CC_COMMON
+ shift
+ printf "%s", /usr/local/64/bin/gcc
+ echo
+ quote MJIT_CFLAGS MJIT_ARCHFLAG -w
+ printf #define MJIT_CFLAGS MJIT_ARCHFLAG
+ shift
+ printf "%s", -w
+ echo
+ quote MJIT_OPTFLAGS -O3
+ printf #define MJIT_OPTFLAGS
+ shift
+ printf "%s", -O3
+ echo
+ quote MJIT_DEBUGFLAGS -ggdb3
+ printf #define MJIT_DEBUGFLAGS
+ shift
+ printf "%s", -ggdb3
+ echo
+ quote MJIT_LDSHARED /usr/local/64/bin/gcc -shared
+ printf #define MJIT_LDSHARED
+ shift
+ printf "%s", /usr/local/64/bin/gcc -shared
+ echo
+ quote MJIT_DLDFLAGS MJIT_ARCHFLAG -L/usr/local/64/lib -R/usr/local/64/lib
+ printf #define MJIT_DLDFLAGS MJIT_ARCHFLAG
+ shift
+ printf "%s", -L/usr/local/64/lib -R/usr/local/64/lib
+ echo
+ quote MJIT_LIBS -Wl,-rpath,/XXXXXXXXXX/lib -L/XXXXXXXXXX/lib
+ printf #define MJIT_LIBS
+ shift
+ printf "%s", -Wl,-rpath,/XXXXXXXXXX/lib -L/XXXXXXXXXX/lib
+ echo
+ quote PRELOADENV "LD_PRELOAD_64"
+ printf #define PRELOADENV "LD_PRELOAD_64"
+ shift
+ echo
+ } define_arch_flags
/bin/sh: }: not found
+ echo
+ echo #endif /* RUBY_MJIT_CONFIG_H */
gcc -O -m64 -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -std=gnu99 -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o mjit.o -c mjit.c
In file included from mjit.c:18:0:
mjit_worker.c:242:20: error: 'MJIT_ARCHFLAG' undeclared here (not in a function)
mjit_worker.c:242:20: error: expected '}' before string constant
mjit_worker.c:255:5: error: initializer element is not constant
mjit_worker.c:255:5: error: (near initialization for 'CC_DLDFLAGS_ARGS[0]')
mjit_worker.c:255:5: error: expected '}' before string constant
make: *** [mjit.o] Error 1
</code></pre>
<p><code>/bin/sh: }: not found</code> というのがSolarisの/bin/shが出したエラーのようですが、これはMakefile.in (から作成されたMakefile)内の mjit_config.h を作成する部分の <code>@{</code> に対応した <code>}</code> のような気がします。<br>
もしかすると /bin/sh ではなく make 側の問題の可能性もあるでしょうか?</p>
<p>以下のバージョンのGNU Make を使っています。</p>
<pre><code>$ /usr/local/bin/make --version
GNU Make 3.82
Built for sparc-sun-solaris2.10
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
</code></pre>
Ruby master - Bug #15293 (Closed): Since r64852, on Solaris with Oracle Developer Studio 12.4, sy...
https://redmine.ruby-lang.org/issues/15293
2018-11-09T14:55:44Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r64852以降、Solaris 10 上の Oracle Developer Studio 12.4 にてコンパイルすると、以下のエラーで array.c のコンパイルに失敗します。(r65641 にて確認)</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o array.o -c array.c
"array.c", line 2977: warning: implicit function declaration: __extension__ (E_NO_IMPLICIT_DECL_ALLOWED)
"array.c", line 2977: syntax error before or at: {
"array.c", line 2977: undefined symbol: rb_intern_id_cache
"array.c", line 2977: undefined symbol: rb_intern_id_cache
"array.c", line 2977: syntax error before or at: )
"array.c", line 2977: warning: old-style declaration or incorrect type for: rb_intern (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2977: identifier redeclared: rb_intern
current : function() returning int
previous: function(pointer to const char) returning unsigned long : "./include/ruby/ruby.h", line 1792
"array.c", line 2977: warning: old-style declaration or incorrect type for: sort_by_i (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2977: identifier redeclared: sort_by_i
current : int
previous: function(unsigned long, unsigned long, int, pointer to const unsigned long, unsigned long) returning unsigned long : "array.c", line 2949
"array.c", line 2977: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2978: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2978: warning: old-style declaration or incorrect type for: rb_ary_replace (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2978: identifier redeclared: rb_ary_replace
current : function() returning int
previous: function(unsigned long, unsigned long) returning unsigned long : "./include/ruby/intern.h", line 96
"array.c", line 2979: syntax error before or at: return
"array.c", line 2979: warning: old-style declaration or incorrect type for: ary (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 3760: identifier redeclared: rb_ary_replace
current : function(unsigned long, unsigned long) returning unsigned long
previous: function() returning int : "array.c", line 2978
"array.c", line 6363: warning: statement not reached (E_STATEMENT_NOT_REACHED)
"array.c", line 6409: warning: statement not reached (E_STATEMENT_NOT_REACHED)
cc: acomp failed for array.c
make: *** [array.o] Error 2
</code></pre>
<p>理由は、[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Since r54986, syntax error with Oracle Solaris Studio 12.x on Solaris 10 (Closed)" href="https://redmine.ruby-lang.org/issues/12397">#12397</a>] と同じです。<br>
Oracle Solaris Studio 12.4 には、<code>__builtin_constant_p()</code> は存在するため、<code>HAVE_BUILTIN___BUILTIN_CONSTANT_P</code> は 1 になります。しかし、<code>__extension__</code> は存在しません。(GCC拡張?)<br>
このため、<code>__extension__</code> が普通の関数と見なされ、syntax error が発生しています。</p>
<p>つまり、r64582 だけでは条件を網羅できておらず不完全であり、<code>__extension__</code> の有無と(直下のコメント行に書かれているように)statement expression の有無に関する条件も追加する必要があると思います。</p>
<p>[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Since r54986, syntax error with Oracle Solaris Studio 12.x on Solaris 10 (Closed)" href="https://redmine.ruby-lang.org/issues/12397">#12397</a>] にも少し書いたように、configure で <code>__extension__</code> や statement expression の有無をチェックするようにするのがベストとは思います。</p>
Ruby master - Bug #14963 (Closed): Since r64107, on Solaris, spec test of rb_io_wait_readable han...
https://redmine.ruby-lang.org/issues/14963
2018-08-03T14:49:17Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Since r64107 (removal of timer thread), on Solaris (both on Solaris 10 and Solaris 11, both on x86 and sparc),<br>
<code>make test-rubyspec</code> never ends in the test of rb_io_wait_readable in spec/ruby/optional/capi/io_spec.rb.</p>
<pre><code>C-API IO function rb_io_wait_writable
- returns false if there is no error condition (FAILED - 1)
- raises an IOError if the IO is closed
C-API IO function rb_thread_fd_writable
- waits til an fd is ready for writing
C-API IO function rb_io_wait_readable
- returns false if there is no error condition
</code></pre>
<p>On rubyci.org, it stopped by 600s timeout.<br>
(confirmed with r64171 or r64169)</p>
<p>Solaris10 i386: <a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20180803T121806Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20180803T121806Z.fail.html.gz</a><br>
Solaris11 i386: <a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180803T122406Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180803T122406Z.fail.html.gz</a><br>
Solaris10 sparc: <a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-trunk/log/20180803T071912Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-trunk/log/20180803T071912Z.fail.html.gz</a><br>
Solaris11 sparc: <a href="https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180803T112505Z.fail.html.gz" class="external">https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180803T112505Z.fail.html.gz</a></p>
<p>I cannot determine whether the changes of removing timer thread contain some bug on Solaris or the test code is essentially wrong.</p>
Ruby master - Bug #14876 (Closed): /bin/sh: bad substitution since r63679 on Solaris
https://redmine.ruby-lang.org/issues/14876
2018-06-28T03:05:42Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r63679以降、Solaris 上にて 64ビットでコンパイルすると、<br>
mjit_config.h 作成中に以下のように "/bin/sh: bad substitution" エラーになります。</p>
<p>32ビットコンパイルでは発生しません。(rubyci.orgのSolarisは32ビットのみ)</p>
<p>r63679 で変更された部分が原因と思われますが、シェルとmakeの変数が複雑に入り乱れているため切り分けができていません。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o math.o -c math.c
+ echo #ifndef RUBY_MJIT_CONFIG_H
+ echo #define RUBY_MJIT_CONFIG_H 1
+ echo
sep=
+ quote MJIT_MIN_HEADER_NAME /include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
+ printf #define MJIT_MIN_HEADER_NAME
+ shift
+ printf "%s" /include/ruby-2.6.0/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
+ echo
sep=,
+ quote MJIT_CC_COMMON cc
+ printf #define MJIT_CC_COMMON
+ shift
+ printf "%s", cc
+ echo
+ quote MJIT_CFLAGS MJIT_ARCHFLAG -w
+ printf #define MJIT_CFLAGS MJIT_ARCHFLAG
+ shift
+ printf "%s", -w
+ echo
+ quote MJIT_OPTFLAGS
+ printf #define MJIT_OPTFLAGS
+ shift
+ echo
+ quote MJIT_DEBUGFLAGS -g
+ printf #define MJIT_DEBUGFLAGS
+ shift
+ printf "%s", -g
+ echo
+ quote MJIT_LDSHARED cc -G
+ printf #define MJIT_LDSHARED
+ shift
+ printf "%s", cc -G
+ echo
+ quote MJIT_DLDFLAGS MJIT_ARCHFLAG -m64 -L/usr/local/64/lib -R/usr/local/64/lib
+ printf #define MJIT_DLDFLAGS MJIT_ARCHFLAG
+ shift
+ printf "%s", -m64 -L/usr/local/64/lib -R/usr/local/64/lib
+ echo
+ quote MJIT_LIBS -L/XXXXXXXXXX/lib
+ printf #define MJIT_LIBS
+ shift
+ printf "%s", -L/XXXXXXXXXX/lib
+ echo
+ echo #if 0
/bin/sh: bad substitution
make: *** [mjit_config.h] Error 1
</code></pre>
Ruby master - Bug #14875 (Closed): /bin/sh: bad substitution
https://redmine.ruby-lang.org/issues/14875
2018-06-28T02:53:39Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
Ruby master - Bug #14826 (Closed): make: *** [.ext/include/sparc-solaris2.10/rb_mjit_min_header-2...
https://redmine.ruby-lang.org/issues/14826
2018-06-05T14:02:04Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 上にて、Sun(現Oracle)がOSのおまけとして提供しているフリーソフト集に含まれている、とても古いバージョンのgccにてrubyをコンパイルすると、rb_mjit_min_header-2.6.0.h の作成に失敗してエラーになります。<br>
(r63531にて確認)</p>
<pre><code>make[1]: Leaving directory `/var/tmp/tmp.DzLrdENoQV/sparc32-gcc3-trunk-63571'
/usr/sfw/bin/gcc -E -DMJIT_HEADER -P -dD -O -D_FORTIFY_SOURCE=2 -DRUBY_DEVEL=1 -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I/usr/local/include -std=gnu99 -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 ./vm.c -o rb_mjit_header.h.new
./tool/ifchange "--timestamp=.ext/.timestamp/rb_mjit_header.time" rb_mjit_header.h rb_mjit_header.h.new
rb_mjit_header.h updated
./miniruby -I./lib -I. -I.ext/common ./tool/transform_mjit_header.rb "/usr/sfw/bin/gcc " rb_mjit_header.h .ext/include/sparc-solaris2.10/rb_mjit_min_header-2.6.0.h
error in initial header file:
cc1: error: unrecognized command line option "-Werror=implicit-function-declaration"
cc1: error: unrecognized command line option "-Werror=implicit-int"
cc1: error: unrecognized command line option "-Wfatal-errors"
make: *** [.ext/include/sparc-solaris2.10/rb_mjit_min_header-2.6.0.h] Error 1
</code></pre>
<p>gccのバージョンは以下のとおりです。</p>
<pre><code>$ /usr/sfw/bin/gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</code></pre>
<p>今さらgccバージョン3系を使うほうが悪いのは重々承知ですが、念のため記録だけしておきます。</p>
Ruby master - Bug #14786 (Closed): PTY duplicated "\r" problem on Solaris
https://redmine.ruby-lang.org/issues/14786
2018-05-23T15:30:39Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、コンパイル時のオプション、実行時の環境やそれらの組み合わせにより、<br>
make test-all にて以下の Failure や Error が出る場合があります。<br>
(r63444 にて確認)</p>
<p><code>TestPTY</code>や<code>TestIO_Console</code>のFailureを見るとわかりやすいですが、<br>
PTYが返す文字列に余計な <code>"\r"</code> が付加されています。<br>
<code>TestRubyOptions</code> のエラーは、余計な <code>"\r"</code> が無いことを仮定して子プロセスをPTY内で走らせているために発生したようです。</p>
<p>PerlモジュールIPC-Runにて、Solaris上のPTYにおける同様の現象の発生が報告されていました。<br>
<a href="https://rt.cpan.org/Public/Bug/Display.html?id=20105#txn-1306129" class="external">https://rt.cpan.org/Public/Bug/Display.html?id=20105#txn-1306129</a><br>
このPerlモジュールでは、<code>"\r"</code> を複数許すようなパターンを使うことで回避したようです。</p>
<p>Solaris以外でも <code>"\r\r"</code> になる現象の発生があるようです。<br>
Pythonの Lib/test/test_pty.py には、OSF/1 (Tru64) にて発生しているようなコメントが書かれています。<br>
<a href="https://github.com/python/cpython/blob/825aab95fde959541859383f8ea7e7854ebfd49f/Lib/test/test_pty.py#L48" class="external">https://github.com/python/cpython/blob/825aab95fde959541859383f8ea7e7854ebfd49f/Lib/test/test_pty.py#L48</a></p>
<pre><code> # 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')
</code></pre>
<p>以下が make test-all 時のFailureやErrorの抜粋です。</p>
<pre><code> 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]:
<a href="/issues/1029">[ruby-dev:37798]</a>.
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.
</code></pre>
Ruby master - Bug #14761 (Open): TestThread#test_join_limits hangs up on Solaris 10 with gcc
https://redmine.ruby-lang.org/issues/14761
2018-05-15T14:21:08Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris 10, sparc architecture, when compiling ruby (r63417) by GCC (version 4.6.2), TestThread#test_join_limits did not end.</p>
<p>The test ended successfully when compiling ruby by Oracle Developer Studio 12.5 or 12.6.</p>
Ruby master - Bug #14751 (Closed): error during transform_mjit_header.rb on Solaris 10
https://redmine.ruby-lang.org/issues/14751
2018-05-11T16:24:33Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、以下のエラーで transform_mjit_header.rb に失敗します。<br>
(r63361 にて確認)</p>
<pre><code>gcc -E -DMJIT_HEADER -P -dD -m64 -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Werror=implicit-int -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -Werror=deprecated-declarations -Wno-overlength-strings -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wmissing-noreturn -std=gnu99 -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I../github/ruby/include -I../github/ruby -I../github/ruby/enc/unicode/10.0.0 ../github/ruby/vm.c -o rb_mjit_header.h.new
../github/ruby/tool/ifchange "--timestamp=.ext/.timestamp/rb_mjit_header.time" rb_mjit_header.h rb_mjit_header.h.new
rb_mjit_header.h updated
./miniruby -I../github/ruby/lib -I. -I.ext/common ../github/ruby/tool/transform_mjit_header.rb "gcc " rb_mjit_header.h .ext/include/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
error in initial header file:
/tmp/20180511-27294-9cawxv.c:25:54: error: redefinition of parameter 'restrict'
compilation terminated due to -Wfatal-errors.
make: *** [.ext/include/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h] Error 1
</code></pre>
<p>/tmp/20180511-27294-9cawxv.c:25 は以下の行です。</p>
<pre><code>extern FILE *fopen(const char *restrict, const char *restrict);
</code></pre>
<p>C99にて追加されたキーワード restrict に対して、このバージョンのgccのデフォルトはC90なので普通の変数として取り扱った結果、同じ名前の変数をプロトタイプ宣言に使ったことになり、エラーになった模様です。</p>
<p>現象および対策は、r62326 のAIX用のworkaroundと全く同様ですが、おそらくgccのバージョン違いのため、異なるエラーメッセージが出ているのが、r62236 では救えなかった理由のようです。<br>
私の手元では、gcc 4.6.2 という、かなり古いバージョンを使用しています。</p>
<p>以下のパッチにて解消しました。</p>
<pre><code>diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb
index f53f1252cb..f00beb45a9 100644
--- a/tool/transform_mjit_header.rb
+++ b/tool/transform_mjit_header.rb
@@ -166,7 +166,9 @@ def self.conflicting_types?(code, cc, cflags)
with_code(code) do |path|
cmd = "#{cc} #{cflags} #{path}"
out = IO.popen(cmd, err: [:child, :out], &:read)
- !$?.success? && out.match?(/error: conflicting types for '[^']+'/)
+ !$?.success? &&
+ (out.match?(/error: conflicting types for '[^']+'/) ||
+ out.match?(/error: redefinition of parameter '[^']+'/))
end
end
</code></pre>
Ruby master - Bug #14746 (Closed): $cppflags が ext/zlib/Makefile に反映されないため(?) Solaris 10 にて ext/z...
https://redmine.ruby-lang.org/issues/14746
2018-05-09T13:42:52Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、以下のように configure && make すると、ext/zlibのmakeに失敗します。(r63361 にて確認)</p>
<pre><code> $ export PATH=/usr/local/64/bin:/usr/local/bin:/usr/ccs/bin:/usr/xpg4/bin:/usr/bin:/bin:/usr/openwin/bin:/usr/dt/bin:/usr/X11/bin:/usr/sbin
$ export PKG_CONFIG_PATH=/usr/local/64/lib/pkgconfig:/usr/lib/64/pkgconfig
$ mkdir tmp004
$ cd tmp004
$ ../github/ruby/configure \
--prefix="/XXXXXXXX/sparc64-gcc-tmp004-trunk" \
--build=sparc64-sun-solaris2.10 \
--with-tclConfig-dir=/usr/local/64/lib \
--with-tkConfig-dir=/usr/local/64/lib \
cppflags="-I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include" \
cflags="-m64" \
cxxflags="-m64" \
LDFLAGS="-m64 -L/usr/local/64/lib -R/usr/local/64/lib" \
DLDFLAGS="-m64 -L/usr/local/64/lib -R/usr/local/64/lib"
$ make V=1
(中略)
make -C ext/zlib V=1 all
make[2]: Entering directory `/XXXXXXXX/src/tmp004/ext/zlib'
gcc -I. -I../../.ext/include/sparc64-solaris2.10 -I../../../github/ruby/include -I../../../github/ruby/ext/zlib -DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -m64 -O3 -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-overlength-strings -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wmissing-noreturn -o zlib.o -c ../../../github/ruby/ext/zlib/zlib.c
../../../github/ruby/ext/zlib/zlib.c: In function 'rb_zlib_crc_table':
../../../github/ruby/ext/zlib/zlib.c:511:5: error: unknown type name 'z_crc_t'
../../../github/ruby/ext/zlib/zlib.c:515:12: warning: assignment from incompatible pointer type [enabled by default]
../../../github/ruby/ext/zlib/zlib.c: At top level:
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
make[2]: *** [zlib.o] Error 1
make[2]: Leaving directory `/XXXXXXXX/src/tmp004/ext/zlib'
make[1]: *** [ext/zlib/all] Error 2
make[1]: Leaving directory `/XXXXXXXX/src/tmp004'
make: *** [build-ext] Error 2
</code></pre>
<p>ext/zlib/mkmf.log, ext/zlib/Makefile と中略部分を含めたconfigureおよびmake時のログを添付します。</p>
<p>Solaris 10 では、OS標準の /usr/include/zlib.h は存在しますが、バージョンが古いため、<br>
自分で /usr/local/64 にインストールした zlib その他の各種ライブラリを使用するために、<br>
Rubyのconfigure時にオプションとして<br>
<code>cppflags="-I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include"</code><br>
を指定しています。</p>
<p>mkmf.log を見ると、mkmf時(extconf.rb実行時)のgccのコマンドラインにはこのcppflagsが反映されています。</p>
<p>しかし、make時には、与えたはずの cppflags の内容がコマンドラインに入っていません。<br>
ext/zlib/Makefile を見る限り、$cppflags には初期値として何も入っていないようです。<br>
このため、extconf.rb実行時と異なる、バージョンの古い /usr/include/zlib.h を読んだため、上記のエラーが発生した模様です。</p>
<p>zlib以外には、OpenSSLも同様にシステム標準のバージョンが古いため、新しいOpenSSLを自前でインストールしており、<br>
ext/openssl でも同様の問題は発生しておかしくありませんが、ext/openssl/extconf.rb では pkg_config コマンドを呼び出して CFLAGS や LDFLAGS に追加すべき内容を取得しているため、環境変数 PKG_CONFIG_PATH を適切に設定さえしていれば問題なかったようです。</p>
Ruby master - Bug #14446 (Closed): Solaris 10 上の Oracle Developer Studio 12.5 および 12.6 の64ビットコンパイ...
https://redmine.ruby-lang.org/issues/14446
2018-02-05T13:07:28Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 上にて、Oracle Developer Studio 12.5 または 12.6 にて64ビットコンパイル時、以下のエラーでコンパイルに失敗します。</p>
<p>64ビットバイナリの作成には -m64 (もっと古いバージョンのコンパイラでは -xarch=v9)をCFLAGSやLDFLAGSに付ける必要があるのですが、 ./tool/transform_mjit_header.rb がそれに対応していない(CFLAGS相当が決め打ち)なのが原因のように見えます。</p>
<pre><code>$ export CC=cc
$ export CXX=CC
$ export CPPLAGS="-I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include"
$ export CFLAGS="-errtags=yes -xO4 -xtarget=sparc64xplus -m64"
$ export CXXFLAGS=$CFLAGS
$ export LDFLAGS="-m64 -L/usr/local/64/lib -R/usr/local/64/lib"
$ export DLDFLAGS=$LDFLAGS
$ export MAKE=/usr/local/64/bin/make
$ ./configure --prefix=/XXXXX/sparc64-cc126-trunk --build=sparc64-sun-solaris2.10 --with-tclConfig-dir=/usr/local/64/lib --with-tkConfig-dir=/usr/local/64/lib
(中略)
$ /usr/local/64/bin/make V=1
BASERUBY = /usr/local/64/bin/ruby --disable=gems
CC = cc
LD = /usr/ccs/bin/ld
LDSHARED = cc -G
CFLAGS = -errtags=yes -xO4 -xtarget=sparc64xplus -m64
XCFLAGS = -DRUBY_DEVEL=1 -DRUBY_EXPORT
CPPFLAGS = -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -DMJIT_HEADER_BUILD_DIR=".ext/include/sparc64-solaris2.10" -DLIBRUBYARG_SHARED="-L/XXXXX/sparc64-cc126-trunk/lib
" -DLIBRUBY_LIBDIR="/XXXXX/sparc64-cc126-trunk/lib" -DMJIT_HEADER_INSTALL_DIR="/XXXXX/sparc64-cc126-trunk/include/ruby-2.6.0/sparc64-solaris2.10"
DLDFLAGS = -m64 -L/usr/local/64/lib -R/usr/local/64/lib -m64
SOLIBS =
LANG = C
LC_ALL =
LC_CTYPE =
cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30
cc -errtags=yes -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -DMJIT_HEADER_BUILD_DIR=\"".ext/include/sparc64-solaris2.10"\" -DLIBRUBYARG_SHARED=\""-L/XXXXX/sparc64-cc126-trunk/lib "\" -DLIBRUBY_LIBDIR=\""/XXXXX/sparc64-cc126-trunk/lib"\" -DMJIT_HEADER_INSTALL_DIR=\""/XXXXX/sparc64-cc126-trunk/include/ruby-2.6.0/sparc64-solaris2.10"\" -o main.o -c ./main.c
(中略)
cc -E -errtags=yes -xO4 -xtarget=sparc64xplus -DRUBY_DEVEL=1 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=600 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -DMJIT_HEADER_BUILD_DIR=\"".ext/include/sparc64-solaris2.10"\" -DLIBRUBYARG_SHARED=\""-L/user/gen-info/ngoto/testruby/daily/sparc64-cc126-trunk/lib "\" -DLIBRUBY_LIBDIR=\""/XXXXX/sparc64-cc126-trunk/lib"\" -DMJIT_HEADER_INSTALL_DIR=\""/XXXXX/sparc64-cc126-trunk/include/ruby-2.6.0/sparc64-solaris2.10"\" -DMJIT_HEADER ./vm.c -o vm.new
./tool/ifchange rb_mjit_header.h vm.new
rb_mjit_header.h updated
./miniruby -I./lib -I. -I.ext/common ./tool/transform_mjit_header.rb "cc" rb_mjit_header.h .ext/include/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h
error in initial header file:
"include/ruby/ruby.h", line 104: zero or negative subscript
"include/ruby/ruby.h", line 108: zero or negative subscript
"./include/ruby/st.h", line 58: zero or negative subscript
"internal.h", line 252: warning: shift count negative or too big: >> 32
"internal.h", line 408: warning: shift count negative or too big: << 63
"internal.h", line 1501: warning: shift count negative or too big: >> 63
"internal.h", line 1538: warning: shift count negative or too big: >> 60
cc: acomp failed for /var/tmp/20180205-11459-t2wq56.c
make: *** [.ext/include/sparc64-solaris2.10/rb_mjit_min_header-2.6.0.h] Error 1
</code></pre>
Ruby master - Bug #14260 (Closed): test failure related with proc arity on 32-bit environment (e....
https://redmine.ruby-lang.org/issues/14260
2017-12-30T16:23:18Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r59358 以降、sparc の Solaris 10 上の Oracle Developer Studio (Oracle Solaris Studio) 12.x にて 32ビットでコンパイルした際、<br>
make test-all にて以下のような failure が出るようになりました。<br>
(以下は r61515 での結果)</p>
<pre><code> 1) Failure:
TestLazyEnumerator#test_each_cons_limit [/XXXXX/test/ruby/test_lazy_enumerator.rb:548]:
<[[1, 2], [2, 3]]> expected but was
<[[2, 3], [2, 3]]>.
2) Failure:
TestProc#test_bound_parameters [/XXXXX/test/ruby/test_proc.rb:1184]:
<[[:rest]]> expected but was
<[]>.
3) Failure:
TestEnumerator#test_cons [/XXXXX/test/ruby/test_enumerator.rb:118]:
<[[1, 2, 3],
[2, 3, 4],
[3, 4, 5],
[4, 5, 6],
[5, 6, 7],
[6, 7, 8],
[7, 8, 9],
[8, 9, 10]]> expected but was
<[[8, 9, 10],
[8, 9, 10],
[8, 9, 10],
[8, 9, 10],
[8, 9, 10],
[8, 9, 10],
[8, 9, 10],
[8, 9, 10]]>.
4) Failure:
TestEnumerator#test_slice [/XXXXX/test/ruby/test_enumerator.rb:113]:
<[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]> expected but was
<[[10], [10], [10], [10]]>.
(中略)
6) Failure:
TestProc#test_arity2 [/XXXXX/test/ruby/test_proc.rb:439]:
<-1> expected but was
<0>.
7) Failure:
TestLazyEnumerator#test_each_slice_limit [/XXXXX/test/ruby/test_lazy_enumerator.rb:554]:
<[[1, 2], [3, 4]]> expected but was
<[[3, 4], [3, 4]]>.
(後略)
</code></pre>
<p>結論から言うと以下のパッチで治りました。</p>
<p>ビットフィールドのデフォルトは unsigned int というのがCの規格にて定められていますが、<br>
max に -1 (マクロ UNLIMITED_ARGUMENTS の値)が代入される場合があり、<br>
これが unsigned int : 16 では 65535 が代入されたのと同じビット列になり、<br>
それを再度 signed int に戻す際に、そのまま 65535 が戻され、つまり意図しない値に化けてしまい、<br>
(ここらへんの処理は、Cの規格ではおそらく処理系依存とされていると思います)<br>
arityを UNLIMITED_ARGUMENTS や 0 と比較する判定結果が異常になり、<br>
上記のFailureが発生したようです。</p>
<p>なお、64ビットでコンパイルすると <code>#else</code> 以下の <code>int min, max;</code> が使われ、ビットフィールドではなくなるため、このFailreは発生しません。<br>
また、gcc では 16 ビットのまま符号ありの -1 にしてから戻してくれる(場合もある?)ようで、(大部分の?)Failureは発生しないようです(が一部おかしい部分があったっぽい?)。</p>
<pre><code>--- internal.h (revision 61515)
+++ internal.h (working copy)
@@ -912,12 +912,12 @@
/* IFUNC (Internal FUNCtion) */
struct vm_ifunc_argc {
#if SIZEOF_INT * 2 > SIZEOF_VALUE
- int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
- int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
+ signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
+ signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
#else
int min, max;
#endif
};
</code></pre>
<p>今回、Failureが発生したのは Solaris だけですが、全ての32ビット環境にて潜在的に問題が発生する可能性があるコードだったと言えます。</p>
<p>そして、ビットフィールドでメモリを節約している箇所は他にも複数あると思いますが、unsigned int 扱いで確かに正しいか、負の値を意図せず代入していないか、念のため総点検する必要があるかもしれないと思いました。</p>
Ruby master - Bug #14200 (Closed): addr2line.c compile error with C89 compilers on Solaris 10
https://redmine.ruby-lang.org/issues/14200
2017-12-18T15:40:35Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r60841 にて、 addr2line.c では stdbool.h を使用するようになりましたが、<br>
stdbool.h は C99 にて追加された仕様のため、<br>
デフォルトが C89 になっている Solaris 10 上の古めのコンパイラの多くでは、<br>
Solarisの標準ヘッダファイルに含まれるC標準バージョンチェックを通過できず、<br>
以下のようなエラーになり、コンパイルに失敗します。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o addr2line.o -c addr2line.c
"/usr/include/stdbool.h", line 42: #error: "Use of <stdbool.h> is valid only in a c99 compilation environment."
cc: acomp failed for addr2line.c
make: *** [addr2line.o] Error 2
</code></pre>
<p>これは Solaris 10 上の Oracle Solaris Studio 12.4 でのエラーです。<br>
他に、古い gcc や Fujitsu C Compiler などでも同様のエラーとなります。</p>
<p>なお、Solaris10上の多少古めのコンパイラでも、C99は概ねサポートしており、<br>
オプションでC99準拠を指定したり、それ相当の _XOPEN_SOURCE を定義すると、<br>
コンパイルは通るはずではありますが、それに伴う副作用もあるので、<br>
現時点では、容易に可能なら、それを指定しなくても通るようにしたいと思っています。</p>
Ruby master - Bug #14199 (Closed): eval_error.c compile error with Oracle Solaris Studio (Oracle ...
https://redmine.ruby-lang.org/issues/14199
2017-12-18T15:03:28Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r61154 以降、Solaris 10 上の Oracle Solaris Studio 12.4 にて、<br>
下記のエラーにより eval.c のコンパイルに失敗します。</p>
<p>write_warn, write_warn2, write_warn_str の各マクロ定義中にて、<br>
三項演算子「? :」の右側の2項(「AAA ? BBB : CCC」の BBB と CCC)の型が不統一、<br>
具体的には void型を返す関数 と VALUE型を返す関数が混在しているのが原因です。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64xplus -m64 -DRUBY_DEVEL=1 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/10.0.0 -o eval.o -c eval.c
"vm_core.h", line 1021: warning: enumerator value overflows INT_MAX (2147483647) (E_ENUM_VAL_OVERFLOWS_INT_MAX)
"vm_core.h", line 1022: warning: enumerator value overflows INT_MAX (2147483647) (E_ENUM_VAL_OVERFLOWS_INT_MAX)
"vm_core.h", line 1024: warning: enumerator value overflows INT_MAX (2147483647) (E_ENUM_VAL_OVERFLOWS_INT_MAX)
"eval_error.c", line 38: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 104: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 105: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 108: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 117: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 118: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 125: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 126: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 127: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 139: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 141: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 142: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 143: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 144: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 145: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 146: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 149: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 151: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 154: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 179: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 182: operands have incompatible types:
void ":" unsigned long
"eval_error.c", line 209: operands have incompatible types:
void ":" unsigned long
"eval.c", line 716: warning: statement not reached (E_STATEMENT_NOT_REACHED)
cc: acomp failed for eval.c
make: *** [eval.o] Error 2
</code></pre>
Ruby master - Bug #13658 (Closed): Compile error with Oracle Solaris Studio (Oracle Developer Stu...
https://redmine.ruby-lang.org/issues/13658
2017-06-14T04:15:06Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r59074 付近以降、Solaris 10 上の Oracle Solaris Studio 12.4 にて、<br>
以下のエラーにより compile.c のコンパイルに失敗します。</p>
<pre><code>"compile.c", line 1622: operands have incompatible types:
void ":" int
"compile.c", line 1622: operands have incompatible types:
void ":" int
"compile.c", line 1653: operands have incompatible types:
void ":" int
"compile.c", line 1653: operands have incompatible types:
void ":" int
"compile.c", line 1671: operands have incompatible types:
void ":" int
"compile.c", line 1671: operands have incompatible types:
void ":" int
"compile.c", line 1686: operands have incompatible types:
void ":" int
"compile.c", line 1686: operands have incompatible types:
void ":" int
"compile.c", line 1779: operands have incompatible types:
void ":" int
"compile.c", line 1779: operands have incompatible types:
void ":" int
</code></pre>
<p>以下の BADINSN_ERROR の定義にて、演算子「,」の各項、または三項演算子「?」の右側の2項に、void型を返す関数 と int型を返す関数(または定数 0)が混在しているのが原因のようです。</p>
<pre><code>#define BADINSN_ERROR \
(generated_iseq ? xfree(generated_iseq) : 0, \
line_info_table ? xfree(line_info_table) : 0, \
BADINSN_DUMP(anchor, list, NULL), \
COMPILE_ERROR)
</code></pre>
Ruby master - Bug #13522 (Closed): Solaris10上で make update-rubyspec が bad substitution で失敗
https://redmine.ruby-lang.org/issues/13522
2017-04-28T12:13:25Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r58467 以降、またもやSolaris 10上にて make update-rubyspec が bad substitution で失敗します。<br>
現象は [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Solaris10上で make update-rubyspec が bad substitution で失敗 (Closed)" href="https://redmine.ruby-lang.org/issues/13424">#13424</a>] と同一ですが、原因は r58467 の変更にあると思いますので新チケットにしました。</p>
<pre><code>$ make update-rubyspec V=1
./tool/git-refresh -C ./spec \
git://github.com/ruby/mspec.git mspec
retrieving mspec ...
./tool/git-refresh: bad substitution
make: *** [update-mspec] Error 1
</code></pre>
<p>Solaris の /bin/sh では、<code>${branch:+git fetch "$@"}</code> がエラーになっているようです。</p>
<pre><code>$ branch="aaa"
$ export branch
$ ${branch:+/bin/echo abc}
bad substitution
$ /bin/echo xyz ${branch:+checkout} "${branch:-pull}" tuv
xyz checkout aaa tuv
$
$ unset branch
$ ${branch:+/bin/echo abc}
bad substitution
$ /bin/echo xyz ${branch:+checkout} "${branch:-pull}" tuv
xyz pull tuv
</code></pre>
Ruby master - Bug #13433 (Closed): Solaris10上で make update-rubyspec が失敗
https://redmine.ruby-lang.org/issues/13433
2017-04-13T15:04:39Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Solaris10上で make update-rubyspec が bad substitution で失敗 (Closed)" href="https://redmine.ruby-lang.org/issues/13424">#13424</a> と類似ですが原因が異なるので別チケットにします。</p>
<p>Solaris 10 上にて、 make update-rubyspec が以下のように失敗します。</p>
<pre><code>$ make update-rubyspec V=1
./tool/git-refresh -C ./spec \
git://github.com/ruby/mspec.git mspec
make: *** [update-mspec] Error 1
</code></pre>
<p>Solarisの /bin/sh では、if の条件に cd を置いた場合、失敗すると fi の後に到達せずそのまま終了となるようです。<br>
たとえば、以下のように、fi の後のechoが実行されずに終了してしまいます。</p>
<pre><code>$ /bin/sh -c 'if cd -P . 2>/dev/null; then CHDIR="cd -P"; else CHDIR="cd"; fi; echo $CHDIR'
$
</code></pre>
<p>Linux上では、以下のように普通にfiの後に制御が移ります。</p>
<pre><code>$ /bin/sh -c 'if cd -P . 2>/dev/null; then CHDIR="cd -P"; else CHDIR="cd"; fi; echo $CHDIR'
cd -P
$
</code></pre>
Ruby master - Bug #13424 (Closed): Solaris10上で make update-rubyspec が bad substitution で失敗
https://redmine.ruby-lang.org/issues/13424
2017-04-11T14:39:52Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r58217 以降、Solaris 10 上にて、 make update-rubyspec が以下のように失敗します。</p>
<pre><code>$ make update-rubyspec V=1
./tool/git-refresh -C ./spec \
git://github.com/ruby/mspec.git mspec
./tool/git-refresh: bad substitution
make: *** [update-mspec] Error 1
</code></pre>
<p><code>"${dir#*/}"</code> がSolarisの/bin/shでは事実上使いものにならないのが原因のようです。</p>
<pre><code>$ dir=/this/is/example
$ echo ${dir#*/}
bad substitution
</code></pre>
Ruby master - Bug #13059 (Closed): "regcomp.c", line 2236: error: syntax error near `/' with old ...
https://redmine.ruby-lang.org/issues/13059
2016-12-21T15:13:48Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r57045 以降、Solaris 10 上の古いfcc(Fujitsu C Compiler)にて、以下のコンパイルエラーが発生します。</p>
<pre><code>"regcomp.c", line 2236: error: syntax error near `/'
</code></pre>
<p>該当部分は以下のとおりで、古いfccがC99/C++形式のコメントを受け付けてくれないのが原因です。</p>
<pre><code> *min = 0; // recursive
</code></pre>
Ruby master - Bug #12769 (Closed): Since r56098, compile error in ossl_ssl.c line 639, with old v...
https://redmine.ruby-lang.org/issues/12769
2016-09-16T12:49:07Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Since r56098, build of ext/openssl/ossl_ssl.c failed with the following compile error, with old version of fcc (Fujitsu C Compiler) on Solaris 10.</p>
<pre><code>compiling ossl_ssl.c
(snip warnings)
"ossl_ssl.c", line 639: error: initialization: constant expression is expected for variable: `args'
(snip warnings)
make[2]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory `/XXXXX/trunk-56170/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: Leaving directory `/XXXXX/trunk-56170'
make: *** [build-ext] Error 2
</code></pre>
<p>The following patch solved the problem.</p>
<pre><code>Index: ext/openssl/ossl_ssl.c
===================================================================
--- ext/openssl/ossl_ssl.c (revision 56172)
+++ ext/openssl/ossl_ssl.c (working copy)
@@ -636,8 +636,12 @@
{
VALUE selected;
int status;
- struct npn_select_cb_common_args args = { cb, in, inlen };
+ struct npn_select_cb_common_args args;
+ args.cb = cb;
+ args.in = in;
+ args.inlen = inlen;
+
selected = rb_protect(npn_select_cb_common_i, (VALUE)&args, &status);
if (status) {
VALUE ssl_obj = (VALUE)SSL_get_ex_data(ssl, ossl_ssl_ex_ptr_idx);
</code></pre>
Ruby master - Bug #12768 (Closed): Since r56158, compile error in "hash.c", line 1753, with old f...
https://redmine.ruby-lang.org/issues/12768
2016-09-16T12:15:06Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r56158 以降、Solaris 10上の古い Fujitsu C Compiler (fcc) にて、以下のコンパイルエラーが発生します。</p>
<pre><code>fcc -O2 -KV9 -KVIS2 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/9.0.0 -o hash.o -c hash.c
(warningは省略)
"hash.c", line 1753: error: initialization: constant expression is expected for variable: `argv'
(warningは省略)
make: *** [hash.o] Error 1
</code></pre>
<p>以下のように1個ずつ代入するようにしたら、コンパイルが通るようになりました。<br>
今時のコンパイラなら、最適化が効くので、このように書いても速度やコードサイズは元と変わらないと思います、多分。</p>
<pre><code>===================================================================
--- hash.c (revision 56170)
+++ hash.c (working copy)
@@ -1750,7 +1750,9 @@
static int
each_pair_i_fast(VALUE key, VALUE value)
{
- VALUE argv[2] = {key, value};
+ VALUE argv[2];
+ argv[0] = key;
+ argv[1] = value;
rb_yield_values2(2, argv);
return ST_CONTINUE;
}
</code></pre>
Ruby master - Bug #12767 (Closed): Since r56169, compile error of vsnprintf.c with Oracle Solaris...
https://redmine.ruby-lang.org/issues/12767
2016-09-16T11:52:07Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r56169以降、Solaris 10 上の Oracle Solaris Studio 12.3 では、以下のコンパイルエラーでビルドに失敗します。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/9.0.0 -o sprintf.o -c sprintf.c
"vsnprintf.c", line 561: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"vsnprintf.c", line 837: undefined symbol: ulval
"vsnprintf.c", line 862: undefined symbol: ulval
"vsnprintf.c", line 980: undefined symbol: ulval
cc: acomp failed for sprintf.c
make: *** [sprintf.o] Error 2
</code></pre>
<p>561行目は以下のように ulval を定義しているはずの行ですが、Warningのとおり、関数プロトタイプと見なされてしまっています。<br>
そして、ulval が出現する832行目などで、未定義というエラーが出ています。</p>
<pre><code> u_long MAYBE_UNUSED(ulval); /* integer arguments %[diouxX] */
</code></pre>
<p>./configure 時の MAYBE_UNUSEDなどの結果は以下の通りです。</p>
<pre><code>checking for WARN_UNUSED_RESULT function attribute... x
checking for MAYBE_UNUSED function attribute... x
</code></pre>
<p>そして、config.h には WARN_UNUSED_RESULT および MAYBE_UNUSED の定義の行は存在しません。<br>
これは、FUNC_STDCALL など x になっている他の function attribute についても同様で、 configure の仕様の気がします。</p>
<p>このため、internal.h には MAYBE_UNUSED (および WARN_UNUSED_RESULT)の代替実装が必要ですが、r56169 で削除されてしまっています。</p>
Ruby master - Bug #12701 (Closed): compile error about ALWAYS_INLINE
https://redmine.ruby-lang.org/issues/12701
2016-08-24T10:59:56Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>遅くとも r55884 以降、Solaris 10上の古い Fujitsu C Compiler (fcc) にて、以下のコンパイルエラーが発生します。</p>
<pre><code>fcc -O2 -KV9 -KVIS2 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -
I. -I./enc/unicode/8.0.0 -o vm.o -c vm.c
(中略)
"./vm_insnhelper.c", line 864: error: invalid storage class specifier `static' specified for `vm_getivar' at parameter scope
"./vm_insnhelper.c", line 864: warning: external declaration has no declaration specifier
(中略)
make: *** [vm.o] Error 1
</code></pre>
<p>ALWAYS_INLINE 未定義時の代替実装が欠けていたのが原因で、以下のパッチで治りました。</p>
<pre><code>--- include/ruby/defines.h (revision 55996)
+++ include/ruby/defines.h (working copy)
@@ -45,6 +45,9 @@
#ifndef NOINLINE
# define NOINLINE(x) x
#endif
+#ifndef ALWAYS_INLINE
+# define ALWAYS_INLINE(x) x
+#endif
#ifndef ERRORFUNC
# define HAVE_ATTRIBUTE_ERRORFUNC 0
# define ERRORFUNC(mesg, x) x
</code></pre>
<p>逆に、以前どうしてコンパイルが通っていたのか不思議なくらいです。どうやら、偶然にも、文法的にエラーにならない範囲内だったようです。<br>
r55884 では、それ以前に ALWAYS_INLINE を使っていた所と異なり、プロトタイプ宣言が引数の名前を含めず型だけを宣言するスタイルだったため、いよいよ破綻してエラーになったということのようです。</p>
Ruby master - Bug #12575 (Closed): Conditional jump or move depends on uninitialised value(s) at ...
https://redmine.ruby-lang.org/issues/12575
2016-07-08T12:46:37Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>x86_64 の Debian GNU/Linux 8 にて、valgrind上でdrbのテストを実行すると、以下のレポートが出ました。<br>
(r55612 にて確認)</p>
<pre><code>$ valgrind ./ruby test/runner.rb -v test/drb
(中略)
[ 12/115] DRbTests::ACLTest#test_not_1 = 0.01 s
[ 13/115] DRbTests::TestBug4409#test_bug4409==14331== Conditional jump or move depends on uninitialised value(s)
==14331== at 0x250F20: rb_wait_for_single_fd (thread.c:3864)
==14331== by 0x89E9C62: wait_for_single_fd (wait.c:64)
==14331== by 0x89E9E31: io_wait_readable (wait.c:139)
==14331== by 0x27C251: call_cfunc_m1 (vm_insnhelper.c:1462)
==14331== by 0x27CD37: vm_call_cfunc_with_frame (vm_insnhelper.c:1641)
==14331== by 0x27CE9D: vm_call_cfunc (vm_insnhelper.c:1736)
==14331== by 0x27DD37: vm_call_method_each_type (vm_insnhelper.c:2028)
==14331== by 0x27E3DB: vm_call_method (vm_insnhelper.c:2152)
==14331== by 0x27E5B1: vm_call_general (vm_insnhelper.c:2195)
==14331== by 0x2826F8: vm_exec_core (insns.def:1064)
==14331== by 0x293AEA: vm_exec (vm.c:1653)
==14331== by 0x29182C: invoke_block (vm.c:923)
==14331==
==14331== Conditional jump or move depends on uninitialised value(s)
==14331== at 0x250F47: rb_wait_for_single_fd (thread.c:3874)
==14331== by 0x89E9C62: wait_for_single_fd (wait.c:64)
==14331== by 0x89E9E31: io_wait_readable (wait.c:139)
==14331== by 0x27C251: call_cfunc_m1 (vm_insnhelper.c:1462)
==14331== by 0x27CD37: vm_call_cfunc_with_frame (vm_insnhelper.c:1641)
==14331== by 0x27CE9D: vm_call_cfunc (vm_insnhelper.c:1736)
==14331== by 0x27DD37: vm_call_method_each_type (vm_insnhelper.c:2028)
==14331== by 0x27E3DB: vm_call_method (vm_insnhelper.c:2152)
==14331== by 0x27E5B1: vm_call_general (vm_insnhelper.c:2195)
==14331== by 0x2826F8: vm_exec_core (insns.def:1064)
==14331== by 0x293AEA: vm_exec (vm.c:1653)
==14331== by 0x29182C: invoke_block (vm.c:923)
==14331==
==14331== Conditional jump or move depends on uninitialised value(s)
==14331== at 0x250F59: rb_wait_for_single_fd (thread.c:3876)
==14331== by 0x89E9C62: wait_for_single_fd (wait.c:64)
==14331== by 0x89E9E31: io_wait_readable (wait.c:139)
==14331== by 0x27C251: call_cfunc_m1 (vm_insnhelper.c:1462)
==14331== by 0x27CD37: vm_call_cfunc_with_frame (vm_insnhelper.c:1641)
==14331== by 0x27CE9D: vm_call_cfunc (vm_insnhelper.c:1736)
==14331== by 0x27DD37: vm_call_method_each_type (vm_insnhelper.c:2028)
==14331== by 0x27E3DB: vm_call_method (vm_insnhelper.c:2152)
==14331== by 0x27E5B1: vm_call_general (vm_insnhelper.c:2195)
==14331== by 0x2826F8: vm_exec_core (insns.def:1064)
==14331== by 0x293AEA: vm_exec (vm.c:1653)
==14331== by 0x29182C: invoke_block (vm.c:923)
==14331==
==14331== Conditional jump or move depends on uninitialised value(s)
==14331== at 0x250F69: rb_wait_for_single_fd (thread.c:3878)
==14331== by 0x89E9C62: wait_for_single_fd (wait.c:64)
==14331== by 0x89E9E31: io_wait_readable (wait.c:139)
==14331== by 0x27C251: call_cfunc_m1 (vm_insnhelper.c:1462)
==14331== by 0x27CD37: vm_call_cfunc_with_frame (vm_insnhelper.c:1641)
==14331== by 0x27CE9D: vm_call_cfunc (vm_insnhelper.c:1736)
==14331== by 0x27DD37: vm_call_method_each_type (vm_insnhelper.c:2028)
==14331== by 0x27E3DB: vm_call_method (vm_insnhelper.c:2152)
==14331== by 0x27E5B1: vm_call_general (vm_insnhelper.c:2195)
==14331== by 0x2826F8: vm_exec_core (insns.def:1064)
==14331== by 0x293AEA: vm_exec (vm.c:1653)
==14331== by 0x29182C: invoke_block (vm.c:923)
==14331==
= 0.58 s
[ 14/115] DRbTests::TestDRbAry#test_01 = 0.30 s
(以下略)
</code></pre>
<p>当該箇所のコードを見ると、<code>struct pollfd fds</code> の <code>fds.revents</code> が未初期化の場合があるようです。<br>
これは、ppollシステムコールの結果を返す構造体メンバですが、システムコール内で値をセットされず戻ってくる場合があり得るようです。(おそらくタイムアウトの場合など。)</p>
<p><a href="http://docs.oracle.com/cd/E19253-01/816-5177/poll-7d/" class="external">http://docs.oracle.com/cd/E19253-01/816-5177/poll-7d/</a> のExample(ppollではなくpollの例ですが)など、巷に流通しているコードを見る限りは、struct pollfd構造体のreventsメンバーは呼出元で0に初期化してあげる必要があるようです。</p>
Ruby master - Bug #12559 (Closed): ./enc/iso_8859_14.c, line 253: error: syntax error near / with...
https://redmine.ruby-lang.org/issues/12559
2016-07-06T13:08:56Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10上の古い Fujitsu C Compiler (fcc) にて、以下のコンパイルエラーが発生します。</p>
<pre><code>fcc -G -o .ext/sparc64-solaris2.10/enc/iso_8859_13.so enc/iso_8859_13.o -L. -L. -L. -KV9 -KVIS2 -L/usr/local/64/lib -R/usr/local/64/lib -KV9 -KVIS2 -L/usr/local/64/lib -R/usr/local/64/lib -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm
fcc -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -DONIG_ENC_REGISTER=rb_enc_register -KPIC -O2 -KV9 -KVIS2 -o enc/iso_8859_14.o -c ./enc/iso_8859_14.c
"./enc/iso_8859_14.c", line 253: error: syntax error near `/'
make[1]: *** [enc/iso_8859_14.o] Error 1
</code></pre>
<p>"//"によるC++/C99形式のコメント行は、古いfccではサポートされていないのが原因です。</p>
Ruby master - Bug #12537 (Closed): Fiddle::TestPointer#test_to_s and test_to_str destroy literal ...
https://redmine.ruby-lang.org/issues/12537
2016-07-01T09:47:19Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r55547 以降、rubyciの32ビット環境では、以下のFailureが出ています。</p>
<pre><code> 1) Failure:
Fiddle::TestPointer#test_plus [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/fiddle/test_pointer.rb:70]:
<"lo world"> expected but was
<"lo">.
2) Failure:
Psych::Visitors::TestEmitter#test_sequence [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/psych/visitors/test_emitter.rb:110]:
Expected /- hello/ to match "---\n- ! \"hello\\0world\"\n".
3) Failure:
Psych::Visitors::TestYAMLTree#test_yaml_tree_can_take_an_emitter [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/psych/visitors/test_yaml_tree.rb:27]:
Expected /hello\x00world/ to match "--- !binary |-\n aGVsbG8Ad29ybGQ=\n".
(中略)
7) Failure:
TestPsych#test_parse_file [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/psych/test_psych.rb:157]:
Expected: "hello\u0000world"
Actual: "hello world"
8) Failure:
TestPsych#test_load_file [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/psych/test_psych.rb:143]:
Expected: "hello\u0000world"
Actual: "hello world"
9) Failure:
TestRDocMarkupIndentedParagraph#test_text [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/rdoc/test_rdoc_markup_indented_paragraph.rb:42]:
Expected: "hello\u0000world"
Actual: "hello world"
10) Failure:
TestRDocMarkupParagraph#test_text [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/rdoc/test_rdoc_markup_paragraph.rb:21]:
Expected: "hello\u0000world"
Actual: "hello world"
11) Failure:
TestRDocMarkupToJoinedParagraph#test_accept_paragraph [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/rdoc/test_rdoc_markup_to_joined_paragraph.rb:19]:
Expected: [para: "hello\u0000world"]
Actual: [para: "hello world"]
12) Failure:
TestRDocMarkupToJoinedParagraph#test_accept_paragraph_break [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/rdoc/test_rdoc_markup_to_joined_paragraph.rb:29]:
--- expected
+++ actual
@@ -1 +1 @@
-[para: "hello\u0000world", [break], "everyone"]
+[para: "hello world", [break], "everyone"]
13) Failure:
TestSprintf#test_named_default [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/ruby/test_sprintf.rb:428]:
<"hello\u0000world"> expected but was
<"hello world">.
14) Failure:
TestString#test_prepend [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/ruby/test_string.rb:2307]:
<"hello\u0000world"> expected but was
<"hello world">.
15) Failure:
TestString2#test_prepend [/extdisk/chkbuild/chkbuild/tmp/build/20160701T080500Z/ruby/test/ruby/test_string.rb:2307]:
<"hello\u0000world"> expected but was
<"hello world">.
</code></pre>
<p>原因のひとつは、r55547 にて、CのAPIでのencodingを指定しない文字列作成時には、末尾の'\0'用の領域を(UTF-32が来るかもしれないので)4バイトの可能性を考慮するようにしたため、従来よりEMBED可能な文字列長が3バイト短くなる場合が出てきたためですが、(これ自体は後で可能な限りは修正したいと思います)</p>
<p>もうひとつの原因は、下記のように Fiddle::TestPointer#test_to_s および test_to_str 内でメモリを破壊しているせいのようです。</p>
<p>test/fiddle/test_pointer.rb 内の Fiddle::TestPointer#test_to_str および test_to_s には、以下のような記述が存在します。</p>
<pre><code class="ruby syntaxhl" data-language="ruby"> <span class="k">def</span> <span class="nf">test_to_str</span>
<span class="n">str</span> <span class="o">=</span> <span class="s2">"hello world"</span>
<span class="n">ptr</span> <span class="o">=</span> <span class="no">Pointer</span><span class="p">[</span><span class="n">str</span><span class="p">]</span>
<span class="c1">###(snip)</span>
<span class="n">ptr</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">assert_equal</span> <span class="s2">"hello</span><span class="se">\0</span><span class="s2">world"</span><span class="p">,</span> <span class="n">ptr</span><span class="p">.</span><span class="nf">to_str</span>
<span class="k">end</span>
<span class="k">def</span> <span class="nf">test_to_s</span>
<span class="n">str</span> <span class="o">=</span> <span class="s2">"hello world"</span>
<span class="n">ptr</span> <span class="o">=</span> <span class="no">Pointer</span><span class="p">[</span><span class="n">str</span><span class="p">]</span>
<span class="c1">###(snip)</span>
<span class="n">ptr</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">assert_equal</span> <span class="s1">'hello'</span><span class="p">,</span> <span class="n">ptr</span><span class="p">.</span><span class="nf">to_s</span>
<span class="k">end</span>
</code></pre>
<p>両メソッド内にて、<code>ptr[5] = 0</code> のようにメモリを直接書き換えています。</p>
<p>しかし、最近のRubyでは、同一内容の文字列リテラルは1個に集約され、別オブジェクトであっても可能な限り同一メモリ空間を参照するようになっているため、<br>
上記のように <code>Fiddle::Pointer#[]=</code> を使ってメモリの内容を(Rubyインタプリタの正規の手段を踏まずに)直接書き換えてしまうと、同じ文字列リテラル "hello world" を使用する他の全ての箇所に影響が及び、(Fiddle::TestPointerとまったく無関係な)様々な場所で文字列比較が失敗することになります。</p>
<p>r55547より前で大丈夫だったのは、"hello world"がちょうど11バイトと32ビット環境でのEMBED文字列の最大長と同じであり、EMBED文字列としてstruct RStringに埋め込まれたものをFiddle::Pointerで書き換えていたため、大元のリテラル格納場所のメモリには影響が及ばなかったためです。(64ビット環境では、EMBED可能な長さはもっと長いため今でも大丈夫)</p>
<p>Fiddleは、その内容を理解した人のみが使うべき達人専用モジュールであるのは確かですが、<br>
Rubyインタプリタの内部データ構造に過剰に依存するのも面倒ですので、<br>
このテストは、他と完全に独立していることが確実に保証された文字列を使用するように書き換えたいと思います。<br>
(たとえば、Marshal.dumpしてからloadするなど?)</p>
Ruby master - Bug #12536 (Closed): SIGABRT during GC on Debian GNU/Linux 8 (x86_64) due to insuff...
https://redmine.ruby-lang.org/issues/12536
2016-06-30T09:35:59Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>x86_64 の Debian GNU/Linux 8.4 にて、いつの間にか、 make test-all が途中で突然死して失敗するようになりました。</p>
<pre><code>[ 2025/16989] REXMLTests::EncodingTester#test_parse_utf16 = 0.18 s
[ 2026/16989] REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_inte
rnal = 0.18 s
[ 2027/16989] REXMLTests::EncodingTester#test_ticket_89 = 0.00 s
uncommon.mk:607: recipe for target 'yes-test-all' failed
make: *** [yes-test-all] Aborted
</code></pre>
<p>試行錯誤により範囲を絞り込んだ結果、以下のようにすると再現し、SIGABRT を吐くことが明らかとなりました。</p>
<pre><code class="sh syntaxhl" data-language="sh"><span class="nv">$ </span>ruby <span class="nt">-r</span> rexml/document <span class="nt">-e</span> <span class="s1">'File.open("test/rexml/data/utf16.xml") { |f| REXML::Document.new(f) }; GC.start'</span>
</code></pre>
<p>GDB上で実行すると、GC中にglibcのmalloc関連関数がメモリ破壊を検知してSIGABRTで終了していることがわかりました。</p>
<pre><code>$ gdb ./ruby
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
(略)
(gdb) run -r rexml/document -e 'File.open("test/rexml/data/utf16.xml") { |f| REXML::Document.new(f) }; GC.start'
Starting program: /XXXXX/ruby -r rexml/document -e 'File.open("test/rexml/data/utf16.xml") { |f| REXML::Document.new(f) }; GC.start'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x2aaaaaad4700 (LWP 20695)]
Program received signal SIGABRT, Aborted.
0x00002aaaab8df067 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: そのようなファイルやディレクトリはありません.
(gdb) where
#0 0x00002aaaab8df067 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00002aaaab8e0448 in __GI_abort () at abort.c:89
#2 0x00002aaaab9229c0 in malloc_printerr (action=<optimized out>,
str=0x2aaaaba13310 "malloc_check_get_size: memory corruption",
ptr=<optimized out>) at malloc.c:5000
#3 0x00002aaaab926d07 in malloc_check_get_size (p=<optimized out>)
at hooks.c:114
#4 musable (mem=<optimized out>) at malloc.c:4565
#5 __malloc_usable_size (m=<optimized out>) at malloc.c:4581
#6 0x0000555555594a5a in objspace_malloc_size (objspace=0x555555a52a90,
ptr=0x2aaaaac6b010, hint=0) at gc.c:7637
#7 0x0000555555594f7e in objspace_xfree (objspace=0x555555a52a90,
ptr=0x2aaaaac6b010, old_size=0) at gc.c:7857
#8 0x000055555559530e in ruby_sized_xfree (x=0x2aaaaac6b010, size=0)
at gc.c:7952
#9 0x000055555559532d in ruby_xfree (x=0x2aaaaac6b010) at gc.c:7959
#10 0x00005555556739ad in rb_str_free (str=93824997851520) at string.c:1220
#11 0x0000555555589586 in obj_free (objspace=0x555555a52a90,
obj=93824997851520) at gc.c:2165
#12 0x000055555558c350 in gc_page_sweep (objspace=0x555555a52a90,
heap=0x555555a52ab0, sweep_page=0x555555a57aa0) at gc.c:3435
#13 0x000055555558c7d3 in gc_sweep_step (objspace=0x555555a52a90,
heap=0x555555a52ab0) at gc.c:3604
#14 0x000055555558c928 in gc_sweep_rest (objspace=0x555555a52a90) at gc.c:3655
#15 0x000055555558c9e1 in gc_sweep (objspace=0x555555a52a90) at gc.c:3688
#16 0x000055555558fbbc in gc_marks_rest (objspace=0x555555a52a90) at gc.c:5508
#17 0x000055555558fd3e in gc_marks (objspace=0x555555a52a90, full_mark=1)
at gc.c:5563
#18 0x0000555555591baa in gc_start (objspace=0x555555a52a90, full_mark=1,
immediate_mark=1, immediate_sweep=1, reason=9217) at gc.c:6349
#19 0x0000555555591924 in garbage_collect (objspace=0x555555a52a90,
full_mark=1, immediate_mark=1, immediate_sweep=1, reason=1024) at gc.c:6267
#20 0x00005555555921d4 in gc_start_internal (argc=0, argv=0x2aaaaab04038,
self=93824997885720) at gc.c:6582
#21 0x00005555556c7ed8 in call_cfunc_m1 (
func=0x555555592021 <gc_start_internal>, recv=93824997885720, argc=0,
argv=0x2aaaaab04038) at vm_insnhelper.c:1462
#22 0x00005555556c89be in vm_call_cfunc_with_frame (th=0x555555a52690,
reg_cfp=0x2aaaaac03f90, calling=0x7fffffffdd80, ci=0x555555f19660,
cc=0x555555f9a888) at vm_insnhelper.c:1641
#23 0x00005555556c8b24 in vm_call_cfunc (th=0x555555a52690,
reg_cfp=0x2aaaaac03f90, calling=0x7fffffffdd80, ci=0x555555f19660,
cc=0x555555f9a888) at vm_insnhelper.c:1736
#24 0x00005555556c99be in vm_call_method_each_type (th=0x555555a52690,
cfp=0x2aaaaac03f90, calling=0x7fffffffdd80, ci=0x555555f19660,
cc=0x555555f9a888) at vm_insnhelper.c:2028
#25 0x00005555556ca062 in vm_call_method (th=0x555555a52690,
cfp=0x2aaaaac03f90, calling=0x7fffffffdd80, ci=0x555555f19660,
cc=0x555555f9a888) at vm_insnhelper.c:2152
#26 0x00005555556ca238 in vm_call_general (th=0x555555a52690,
reg_cfp=0x2aaaaac03f90, calling=0x7fffffffdd80, ci=0x555555f19660,
cc=0x555555f9a888) at vm_insnhelper.c:2195
#27 0x00005555556ce37f in vm_exec_core (th=0x555555a52690, initial=0)
at insns.def:1064
#28 0x00005555556df832 in vm_exec (th=0x555555a52690) at vm.c:1653
#29 0x00005555556e0505 in rb_iseq_eval_main (iseq=0x555555acb520) at vm.c:1896
#30 0x00005555555793fc in ruby_exec_internal (n=0x555555acb520) at eval.c:244
#31 0x0000555555579525 in ruby_exec_node (n=0x555555acb520) at eval.c:308
#32 0x00005555555794f8 in ruby_run_node (n=0x555555acb520) at eval.c:300
#33 0x00005555555770dd in main (argc=5, argv=0x7fffffffe5e8) at main.c:36
(gdb)
</code></pre>
<p>frame #2 では、libc内から"malloc_check_get_size: memory corruption" というエラーメッセージを出そうとしているのが見えます。(が、表示されないまま強制終了となってしまうようです。)</p>
<p>なお、以前通っていたリビジョンでも今の環境で再コンパイルするとダメだったので、libcなど環境の変化により、以前は検知できていなかったメモリ破壊を検出できたということのようです。</p>
<p>valgrind上で実行するとメモリ破壊発生箇所が特定できました。</p>
<pre><code>$ valgrind ruby -r rexml/document -e 'File.open("test/rexml/data/utf16.xml") { |f| REXML::Document.new(f) }; GC.start'
==1118== Memcheck, a memory error detector
==1118== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1118== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==1118== Command: ruby -r rexml/document -e File.open("test/rexml/data/utf16.xml")\ {\ |f|\ REXML::Document.new(f)\ };\ GC.start
==1118==
==1118== Invalid write of size 1
==1118== at 0x4C2F415: memset (vg_replace_strmem.c:1094)
==1118== by 0x2292BA: rb_str_plus (string.c:1742)
==1118== by 0x2831B7: vm_exec_core (insns.def:1404)
==1118== by 0x293831: vm_exec (vm.c:1653)
==1118== by 0x28B764: vm_call0_body (vm_eval.c:182)
==1118== by 0x28B319: vm_call0 (vm_eval.c:61)
==1118== by 0x28BD87: rb_call0 (vm_eval.c:344)
==1118== by 0x28C8E3: rb_call (vm_eval.c:630)
==1118== by 0x28D1D9: rb_funcallv (vm_eval.c:856)
==1118== by 0x12FD35: rb_obj_call_init (eval.c:1319)
==1118== by 0x19543F: rb_class_new_instance (object.c:1853)
==1118== by 0x27BED7: call_cfunc_m1 (vm_insnhelper.c:1462)
==1118== Address 0x94f94f7 is 0 bytes after a block of size 207,463 alloc'd
==1118== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==1118== by 0x148CB8: objspace_xmalloc0 (gc.c:7782)
==1118== by 0x148E25: objspace_xmalloc2 (gc.c:7810)
==1118== by 0x149077: ruby_xmalloc2 (gc.c:7887)
==1118== by 0x225B49: str_new0 (string.c:699)
==1118== by 0x225D0C: str_new (string.c:716)
==1118== by 0x225D3B: rb_str_new (string.c:722)
==1118== by 0x22920A: rb_str_plus (string.c:1738)
==1118== by 0x2831B7: vm_exec_core (insns.def:1404)
==1118== by 0x293831: vm_exec (vm.c:1653)
==1118== by 0x28B764: vm_call0_body (vm_eval.c:182)
==1118== by 0x28B319: vm_call0 (vm_eval.c:61)
==1118==
==1118==
==1118== HEAP SUMMARY:
==1118== in use at exit: 4,716,758 bytes in 37,139 blocks
==1118== total heap usage: 254,757 allocs, 217,618 frees, 10,809,880,914 bytes allocated
==1118==
==1118== LEAK SUMMARY:
==1118== definitely lost: 863,638 bytes in 6,579 blocks
==1118== indirectly lost: 1,338,400 bytes in 12,858 blocks
==1118== possibly lost: 2,095,303 bytes in 10,822 blocks
==1118== still reachable: 419,417 bytes in 6,880 blocks
==1118== suppressed: 0 bytes in 0 blocks
==1118== Rerun with --leak-check=full to see details of leaked memory
==1118==
==1118== For counts of detected and suppressed errors, rerun with: -v
==1118== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
</code></pre>
<p>以下のパッチで、このエラーは出なくなることを確認しました。</p>
<pre><code>--- string.c (revision 55539)
+++ string.c (working copy)
@@ -1730,16 +1730,18 @@
rb_encoding *enc;
char *ptr1, *ptr2, *ptr3;
long len1, len2;
+ int termlen;
StringValue(str2);
enc = rb_enc_check_str(str1, str2);
RSTRING_GETMEM(str1, ptr1, len1);
RSTRING_GETMEM(str2, ptr2, len2);
- str3 = rb_str_new(0, len1+len2);
+ termlen = rb_enc_mbminlen(enc);
+ str3 = str_new0(rb_cString, 0, len1+len2, termlen);
ptr3 = RSTRING_PTR(str3);
memcpy(ptr3, ptr1, len1);
memcpy(ptr3+len1, ptr2, len2);
- TERM_FILL(&ptr3[len1+len2], rb_enc_mbminlen(enc));
+ TERM_FILL(&ptr3[len1+len2], termlen);
FL_SET_RAW(str3, OBJ_TAINTED_RAW(str1) | OBJ_TAINTED_RAW(str2));
ENCODING_CODERANGE_SET(str3, rb_enc_to_index(enc),
</code></pre>
<p>UTF-16LEやUTF-16BEの文字列では、TERM_FILL()により末端2バイトが0で埋められるため、2バイト余分にメモリを確保する必要がありますが、rb_str_new() はそれを想定しておらず常に+1しか確保していないため、メモリ破壊に至ったようです。</p>
<p>このパッチで解決したと思ったら、次に、以下のように別の場所でも同様の突然死が発生することが判明しました。やはり、UTF-16やUTF-32の文字列・正規表現が関連している場所でした。</p>
<pre><code>[13718/16989] TestRegexp#test_source_unescaped = 0.00 s
[13719/16989] TestRegexp#test_to_suncommon.mk:607: recipe for target 'yes-test-a
ll' failed
make: *** [yes-test-all] Aborted
</code></pre>
<p>調べたところ、以下のようにすると再現しました。(TestRegexp#test_to_s の内容をassertのかわりにpにして抜粋しただけ)</p>
<pre><code>$ ./ruby -e 'str = "abcd\u3042"; [:UTF_16BE, :UTF_16LE, :UTF_32BE, :UTF_32LE].each do |es|; enc = Encoding.const_get(es); rs = Regexp.new(str.encode(enc)).to_s; p("(?-mix:abcd\u3042)".encode(enc) == rs); p(enc == rs.encoding); end'
</code></pre>
<p>仕方ないので、string.c内のTERM_FILLやTERM_LENやtermlenに関係した場所を調べて、全部修正してみたつもりのものが、添付のパッチです。</p>
<p>これで、valgrind経由で実行してもメモリ破壊は検出されなくなりました。</p>
<p>ただし、rb_str_new() と rb_str_buf_new() にて、従来 capa+1 バイトのメモリを確保していた部分を修正するにあたり、後からどんなエンコーディングが関連付けられるかわからないため、現時点での最大と思われる数値 4 を #define TERM_LEN_MAX 4 として定義して、それを常に足すようにしています。つまり、わずかながら、従来より余計にメモリを消費します。将来 '\0' 終端は廃止との方針がChangeLogやNEWSに書いてあるので、それまでの辛抱となります。(あるいは、終端用に何バイト確保したかを struct RString 内に記録するとか?)</p>
<p>また、RSTRING_EMBED_LEN_MAX を使う際は常に term_len を意識する必要がありますが、RSTRING_EMBED_LEN_MAX は (メモリ容量-1) で定義されているため、RSTRING_EMBED_LEN_MAXを使う際は "+1-term_len" などとせざるを得ませんでした。これも、'\0' 終端廃止までの辛抱かと思いますが、+1を忘れそうで、罠の気がします。</p>
Ruby master - Bug #12527 (Closed): warning: macro redefined: REG_PC and REG_SP on Solaris 10
https://redmine.ruby-lang.org/issues/12527
2016-06-28T10:54:46Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 上にて、vm.c のコンパイル中に、以下のマクロ再定義のwarningが出ます。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o vm.o -c vm.c
"vm_insnhelper.h", line 45: warning: macro redefined: REG_PC (E_MACRO_REDEFINED)
"vm_insnhelper.h", line 46: warning: macro redefined: REG_SP (E_MACRO_REDEFINED)
</code></pre>
<p>具体的には、/usr/include/sys/regset.h の以下の定義と衝突しています。</p>
<pre><code>#define REG_PC (1)
</code></pre>
<pre><code>#define REG_SP REG_O6
</code></pre>
<p>(厳密に確認はしていませんがおそらく) _XOPEN_SOURCE=500 以上を定義した場合に、これらのマクロが有効となるようです。</p>
<p>値は異なるようですが、 x86 (amd64) でも定義されているようです。<br>
<a href="http://dtrace.org/blogs/rm/2011/03/14/a-trip-down-into-sysregset-h/" class="external">http://dtrace.org/blogs/rm/2011/03/14/a-trip-down-into-sysregset-h/</a></p>
<p>幸い、今のところは、vm.c や vm.c がincludeしているファイル内では、システム側のマクロは直接・間接関わらず使用されていないように見えます。</p>
Ruby master - Bug #12524 (Closed): Excess semicolons in ext/digest and ext/openssl
https://redmine.ruby-lang.org/issues/12524
2016-06-28T09:30:10Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>ext/digest については r49564 以降、 ext/openssl については r55285 以降、<br>
Solaris 10 上の Oracle Solaris Studio 12.x によるコンパイル時に以下のwarningが出ます。</p>
<pre><code>compiling md5init.c
"md5ossl.h", line 11: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
(略)
compiling sha1init.c
"sha1ossl.h", line 18: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
(略)
compiling sha2init.c
"sha2ossl.h", line 23: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"sha2ossl.h", line 24: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"sha2ossl.h", line 25: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
(略)
compiling ossl_pkey_rsa.c
"ossl_pkey_rsa.c", line 659: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"ossl_pkey_rsa.c", line 660: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"ossl_pkey_rsa.c", line 661: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
</code></pre>
<p>原因は [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Since r54952, TestMkmf::TestConvertible failed on Solaris 10 with Oracle SolarisStudio 12.x cc (Closed)" href="https://redmine.ruby-lang.org/issues/12470">#12470</a>] とほぼ同様です。つまり、マクロ使用時の最後のセミコロンが余計で、何も内容の無い行が発生して、empty declaration の警告が出ています。</p>
Ruby master - Bug #12479 (Closed): mistaken macro GCC_VERSION_SINCE
https://redmine.ruby-lang.org/issues/12479
2016-06-10T16:44:49Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>いつからかは不明ですが、Solaris 10上の古いGCCでコンパイルすると、以下のエラーにて make test-all が失敗します。(r55344にて確認。)</p>
<pre><code> 1) Failure:
TestMkmf::TestConvertible#test_typeof_builtin [/XXXXX-55344/test/mkmf/test_convertible.rb:9]:
convertible_int: checking for convertible type of short... -------------------- short
--------------------
convertible_int: checking for convertible type of int... -------------------- int
--------------------
convertible_int: checking for convertible type of long... -------------------- long
--------------------
convertible_int: checking for convertible type of signed short... -------------------- failed
"/usr/sfw/bin/gcc -o conftest -I. -I/XXXXX-55344/.ext/include/sparc-solaris2.10 -I/XXXXX-55344/include -I./test -I/usr/local/include -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -O conftest.c -L. -L/XXXXX-55344 -Wl,-R/XXXXX-55344 -L. -L/usr/local/lib -R/usr/local/lib -Wl,-R/XXXXX/sparc32-gcc3-trunk/lib -L/XXXXX/sparc32-gcc3-trunk/lib -lruby-static -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm -lc"
In file included from /XXXXX-55344/include/ruby.h:33,
from conftest.c:1:
/XXXXX-55344/include/ruby/ruby.h:567: warning: `error' attribute directive ignored
/XXXXX-55344/include/ruby/ruby.h:592: warning: `error' attribute directive ignored
/XXXXX-55344/include/ruby/ruby.h:593: warning: `warning' attribute directive ignored
/XXXXX-55344/include/ruby/ruby.h:1346: warning: `warning' attribute directive ignored
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
</code></pre>
<p>コンパイルに使用したGCCのバージョンは、以下のように、たいへん古いものです。</p>
<pre><code>$ /usr/sfw/bin/gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</code></pre>
<p>上記にて Warningが出ていた include/ruby/ruby.h の567行め付近は以下の内容です。</p>
<pre><code>566: #if GCC_VERSION_SINCE(4,4,0)
567: void rb_check_safe_str(VALUE) __attribute__((error("rb_check_safe_str() and Check_SafeStr() are obsolete; use SafeStringValue() instead")));
568: # define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
569: #else
</code></pre>
<p><code>#if GCC_VERSION_SINCE(4,4,0)</code> の中なので、GCC 3.4.3 ではコンパイルされないはずの部分なのに、なぜかコンパイルされてしまい、知らないattributeなので無視した旨のwarningが出てしまっています。</p>
<p>このマクロ GCC_VERSION_SINCE は、include/ruby/defines.h にて、以下のように定義されていました。</p>
<pre><code>#define GCC_VERSION_SINCE(major, minor, patchlevel) \
(defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__) && \
((__GNUC__ > (major)) || \
((__GNUC__ == (major) && \
(__GNUC_MINOR__ > (minor)) || \
(__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))))
</code></pre>
<p>上記マクロの下3行を端的に表現すると <code>(X && Y || Z)</code> となり、<br>
X は <code>__GNUC__ == (major)</code><br>
Y は <code>(__GNUC_MINOR__ > (minor))</code><br>
Z は <code>(__GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))</code><br>
ということになりますが、<br>
<code>X && Y || Z</code> は括弧が無いため左結合となり <code>(X && Y) || Z</code> と解釈され、<br>
つまり、Z が正の場合は、X や Y の値と無関係に、この条件式は正になります。</p>
<p>そして、<code>#if GCC_VERSION_SINCE(4,4,0)</code> に対する GCC 3.4.3 は、Z が正となる条件にぴったり当てはまることになります。</p>
<p>今更 GCC 3系列のような古いGCCでコンパイルを試みる人はほとんど居なかったので、気がつかれなかったのだと思います。</p>
<p>なお、<code>X && (Y || Z)</code> が本来希望していた演算内容となりますので、そうなるように括弧を追加します。</p>
Ruby master - Bug #12471 (Closed): make update-mspec always fails on Solaris
https://redmine.ruby-lang.org/issues/12471
2016-06-08T11:40:47Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r55303 以降、Solaris 10 にて make update-rubyspec すると、以下のエラーが常に発生します。</p>
<pre><code>make update-rubyspec V=1
make: *** [update-mspec] Error 1
</code></pre>
<p>r55303 の変更で、以下のように if で直接 cd するように変更されましたが、</p>
<pre><code> update-mspec:
@$(CHDIR) $(srcdir); \
- if [ -d spec/mspec ]; then \
+ if cd spec/mspec 2> $(NULL); then \
echo updating mspec ...; \
</code></pre>
<p>Solaris の /bin/sh では、if で cd を使うと、cd できなかった場合は else 以下は実行されず、それどころか if の後の文さえ実行されず、cd 失敗時に即座に実行終了してしまうことが判明しました。以下は実行例です。</p>
<pre><code>Solaris$ /bin/sh -c "if cd /does_not_exist; then echo YES; else echo NO; fi; echo END"
/bin/sh: /does_not_exist: does not exist
Solaris$
</code></pre>
<p>Linuxでは、想定通りに実行されます。</p>
<pre><code>Linux$ /bin/sh -c "if cd /does_not_exist; then echo YES; else echo NO; fi; echo END"
/bin/sh: 1: cd: can't cd to /does_not_exist
NO
END
Linux$
</code></pre>
<p>存在するディレクトリの場合は、大丈夫なようです。</p>
<pre><code>Solaris$ /bin/sh -c "if cd /tmp; then echo YES; else echo NO; fi; echo END"
YES
END
Solaris$
</code></pre>
<p>このため、r55303 はrevertしたいと思います。</p>
Ruby master - Bug #12470 (Closed): Since r54952, TestMkmf::TestConvertible failed on Solaris 10 w...
https://redmine.ruby-lang.org/issues/12470
2016-06-08T09:50:02Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r54952 から、Solaris 10 上の Oracle Solaris Studio 12.3 または 12.4 にてコンパイルすると、<br>
TestMkmf::TestConvertible#test_typeof_builtin<br>
TestMkmf::TestConvertible#test_typeof_typedef<br>
がfailureになります。</p>
<p>以下のように、include/ruby/intern.h の485行目と787行目にWarningが出ています。(r55322 の場合)</p>
<pre><code>convertible_int: checking for convertible type of signed short... -------------------- failed
"cc -o conftest -I. -I/XXXXX-trunk-55322/.ext/include/sparc64-solaris2.10 -I/XXXXX-trunk-55322/include -I./test -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -errtags=yes -xO4 -xtarget=sparc64viiplus conftest.c -L. -L/XXXXX-trunk-55322 -R/XXXXX-trunk-55322 -L. -L/usr/local/64/lib -R/usr/local/64/lib -m64 -R/XXXXX-trunk/lib -L/XXXXX-trunk/lib -lruby-static -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm -lc"
"/XXXXX-trunk-55322/include/ruby/intern.h", line 485: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"/XXXXX-trunk-55322/include/ruby/intern.h", line 787: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
</code></pre>
<p>これらの行を git blame include/ruby/intern.h して見ると、</p>
<pre><code>28f5e12c include/ruby/intern.h (naruse 2016-05-08 17:44:51 +0000 485) PUREFUNC(int rb_during_gc(void););
(中略)
28f5e12c include/ruby/intern.h (naruse 2016-05-08 17:44:51 +0000 787) PUREFUNC(size_t rb_str_capacity(VALUE););
</code></pre>
<p>PUREFUNC()はその機能が存在しないコンパイラでは <code>#define PUREFNC(x) x</code> されているため、マクロ展開後に <code>int rb_during_gc(void);;</code> などとして解釈され、セミコロンが1個多くなった=何も内容の無い行が出来たので、 "warning: syntax error: empty declaration" となったようです。</p>
<p>他のPUREFUNC使用箇所との整合性を考えると、括弧内のセミコロンを削除し、行末のセミコロンを残すのがよさそうです。</p>
<p>同様の余計なセミコロンは、別ファイルにも見られたので、grepして全部解消したいと思います。</p>
Ruby master - Bug #12406 (Closed): Since r55002, Bus Error on 64-bit SPARC on Solaris 10
https://redmine.ruby-lang.org/issues/12406
2016-05-20T13:29:23Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r55002 以降、SPARC Solaris 10 の 64-bit コンパイル時に、以下の Bus Error が発生します。<br>
コンパイラは、gcc, Oracle Solaris Studio 12.3, 12.4 いずれでも発生します。</p>
<p>(r55075の例)</p>
<pre><code>gcc -g -O0 -m64 -L. -L/usr/local/64/lib -R/usr/local/64/lib -fstack-protector -f
stack-protector -pie main.o dmydln.o miniinit.o dmyext.o miniprelude.o array.o
bignum.o class.o compar.o complex.o dir.o dln_find.o encoding.o enum.o enumerato
r.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.
o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o
re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe
.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o time.o transcod
e.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backt
race.o vm_trace.o thread.o cont.o probes.o enc/ascii.o enc/us_ascii.o enc/unicod
e.o enc/utf_8.o enc/trans/newline.o sparc.o explicit_bzero.o flock.o isinf.o set
proctitle.o addr2line.o -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm -o mi
niruby
./miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./temp
late/encdb.h.tmpl ./enc enc
./tool/generic_erb.rb:2: [BUG] Bus Error at 0x000001006969f4
ruby 2.4.0dev (2016-05-19) [sparc64-solaris2.10]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0025 e:000024 CFUNC :require
c:0002 p:0008 s:0021 E:000bd8 EVAL ./tool/generic_erb.rb:2 [FINISH]
c:0001 p:0000 s:0002 E:001320 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
./tool/generic_erb.rb:2:in `<main>'
./tool/generic_erb.rb:2:in `require'
-- Other runtime information -----------------------------------------------
* Loaded script: ./tool/generic_erb.rb
* Loaded features:
0 enumerator.so
1 thread.rb
2 rational.so
3 complex.so
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
make: *** [encdb.h] Abort
</code></pre>
<p>gdb上で走らせると、以下のように、sizeof(VALUE)は8バイトなのに、8の倍数でない番地のポインタ (values == 0x100696a24) を使ってVALUE型にアクセスしようとして、Bus Errorになっていることがわかりました。</p>
<p>id_table.c が word alignment に無頓着なのが問題で、<br>
capa を調整したり、パディングを導入したりする必要がありそうです。</p>
<pre><code>$ gdb ./miniruby
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc64-sun-solaris2.10".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /XXXXX-trunk-55075/miniruby...done.
(gdb) run -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
Starting program: /XXXXX-trunk-55075/miniruby -I./lib -I. -I.ext/common ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
[New LWP 2 ]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x0000000100205918 in list_id_table_insert (tbl=0x10069e920, id=26803, val=1)
at id_table.c:663
663 values[i] = val;
(gdb) print values
$1 = (VALUE *) 0x100696a24
(gdb) print i
$2 = 0
(gdb) print tbl
$3 = (struct list_id_table *) 0x10069e920
(gdb) print *tbl
$4 = {capa = 1, num = 1, keys = 0x100696a20}
(gdb) print tbl->keys
$5 = (id_key_t *) 0x100696a20
(中略)
(gdb) print sizeof(id_key_t)
$8 = 4
(gdb) print sizeof(VALUE)
$9 = 8
</code></pre>
Ruby master - Bug #12397 (Closed): Since r54986, syntax error with Oracle Solaris Studio 12.x on ...
https://redmine.ruby-lang.org/issues/12397
2016-05-19T10:07:45Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r54986以降、Solaris 10上の Oracle Solaris Studio 12.3 および 12.4 にて、以下のエラーでコンパイルに失敗します。</p>
<p>一部分のみピックアップすると、<strong>extension</strong> が単なる関数扱いされているのが原因のようです。</p>
<pre><code>"array.c", line 2031: warning: implicit function declaration: __extension__ (E_NO_IMPLICIT_DECL_ALLOWED)
"array.c", line 2031: syntax error before or at: {
</code></pre>
<p>Oracle Solaris Studio 12.x には、__builtin_constant_p() は存在するため、HAVE_BUILTIN___BUILTIN_CONSTANT_P は 1 になります。<br>
<a href="https://docs.oracle.com/cd/E19205-01/821-2496/gipib/index.html" class="external">https://docs.oracle.com/cd/E19205-01/821-2496/gipib/index.html</a></p>
<p>しかし、<strong>extension</strong> は存在しません。(GCC拡張?)</p>
<p>configureで __builtin_constant_p をチェックするだけではなく、 <strong>extension</strong> の有無もチェックする必要があるのかもしれません。</p>
<p>以下、詳細なエラーメッセージ。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o array.o -c array.c
"./include/ruby/intern.h", line 485: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"./include/ruby/intern.h", line 787: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"internal.h", line 1455: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2031: warning: implicit function declaration: __extension__ (E_NO_IMPLICIT_DECL_ALLOWED)
"array.c", line 2031: syntax error before or at: {
"array.c", line 2031: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2032: syntax error before or at: (
"array.c", line 2032: warning: old-style declaration or incorrect type for: RUBY_IMMEDIATE_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: identifier redeclared: RUBY_IMMEDIATE_MASK
current : int
previous: enum ruby_special_consts {RUBY_SPECIAL_SHIFT(8), RUBY_SYMBOL_FLAG(12), RUBY_FLONUM_FLAG(2), RUBY_FLONUM_MASK(3), RUBY_FIXNUM_FLAG(1), RUBY_IMMEDIATE_MASK(7), RUBY_Qundef(52), RUBY_Qnil(8), RUBY_Qtrue(20), RUBY_Qfalse(0)} : "include/ruby/ruby.h", line 412
"array.c", line 2032: syntax error before or at: (
"array.c", line 2032: syntax error before or at: RUBY_Qnil
"array.c", line 2032: warning: old-style declaration or incorrect type for: RUBY_Qnil (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: identifier redeclared: RUBY_Qnil
current : int
previous: enum ruby_special_consts {RUBY_SPECIAL_SHIFT(8), RUBY_SYMBOL_FLAG(12), RUBY_FLONUM_FLAG(2), RUBY_FLONUM_MASK(3), RUBY_FIXNUM_FLAG(1), RUBY_IMMEDIATE_MASK(7), RUBY_Qundef(52), RUBY_Qnil(8), RUBY_Qtrue(20), RUBY_Qfalse(0)} : "include/ruby/ruby.h", line 409
"array.c", line 2032: syntax error before or at: struct
"array.c", line 2032: syntax error before or at: )
"array.c", line 2032: warning: old-style declaration or incorrect type for: ary (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: syntax error before or at: )
"array.c", line 2032: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: identifier redeclared: RUBY_T_MASK
current : int
previous: enum ruby_value_type {RUBY_T_MASK(31), RUBY_T_ZOMBIE(29), RUBY_T_ICLASS(28), RUBY_T_NODE(27), RUBY_T_IMEMO(26), RUBY_T_UNDEF(22), RUBY_T_FIXNUM(21), RUBY_T_SYMBOL(20), RUBY_T_FALSE(19), RUBY_T_TRUE(18), RUBY_T_NIL(17), RUBY_T_RATIONAL(15), RUBY_T_COMPLEX(14), RUBY_T_MATCH(13), RUBY_T_DATA(12), RUBY_T_FILE(11), RUBY_T_BIGNUM(10), RUBY_T_STRUCT(9), RUBY_T_HASH(8), RUBY_T_ARRAY(7), RUBY_T_REGEXP(6), RUBY_T_STRING(5), RUBY_T_FLOAT(4), RUBY_T_MODULE(3), RUBY_T_CLASS(2), RUBY_T_OBJECT(1), RUBY_T_NONE(0)} : "include/ruby/ruby.h", line 480
"array.c", line 2032: warning: old-style declaration or incorrect type for: RUBY_T_NODE (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: identifier redeclared: RUBY_T_NODE
current : int
previous: enum ruby_value_type {RUBY_T_MASK(31), RUBY_T_ZOMBIE(29), RUBY_T_ICLASS(28), RUBY_T_NODE(27), RUBY_T_IMEMO(26), RUBY_T_UNDEF(22), RUBY_T_FIXNUM(21), RUBY_T_SYMBOL(20), RUBY_T_FALSE(19), RUBY_T_TRUE(18), RUBY_T_NIL(17), RUBY_T_RATIONAL(15), RUBY_T_COMPLEX(14), RUBY_T_MATCH(13), RUBY_T_DATA(12), RUBY_T_FILE(11), RUBY_T_BIGNUM(10), RUBY_T_STRUCT(9), RUBY_T_HASH(8), RUBY_T_ARRAY(7), RUBY_T_REGEXP(6), RUBY_T_STRING(5), RUBY_T_FLOAT(4), RUBY_T_MODULE(3), RUBY_T_CLASS(2), RUBY_T_OBJECT(1), RUBY_T_NONE(0)} : "include/ruby/ruby.h", line 476
"array.c", line 2032: syntax error before or at: struct
"array.c", line 2032: syntax error before or at: )
"array.c", line 2032: warning: old-style declaration or incorrect type for: ary (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: syntax error before or at: )
"array.c", line 2032: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: warning: old-style declaration or incorrect type for: RUBY_FL_TAINT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2032: identifier redeclared: RUBY_FL_TAINT
current : int
previous: enum ruby_fl_type {RUBY_FL_SINGLETON(4096), RUBY_FL_DUPPED(1311), RUBY_ELTS_SHARED(16384), RUBY_FL_USER18(1073741824), RUBY_FL_USER17(536870912), RUBY_FL_USER16(268435456), RUBY_FL_USER15(134217728), RUBY_FL_USER14(67108864), RUBY_FL_USER13(33554432), RUBY_FL_USER12(16777216), RUBY_FL_USER11(8388608), RUBY_FL_USER10(4194304), RUBY_FL_USER9(2097152), RUBY_FL_USER8(1048576), RUBY_FL_USER7(524288), RUBY_FL_USER6(262144), RUBY_FL_USER5(131072), RUBY_FL_USER4(65536), RUBY_FL_USER3(32768), RUBY_FL_USER2(16384), RUBY_FL_USER1(8192), RUBY_FL_USER0(4096), RUBY_FL_USHIFT(12), RUBY_FL_FREEZE(2048), RUBY_FL_EXIVAR(1024), RUBY_FL_UNTRUSTED(256), RUBY_FL_TAINT(256), RUBY_FL_FINALIZE(128), RUBY_FL_PROMOTED(96), RUBY_FL_PROMOTED1(64), RUBY_FL_PROMOTED0(32), RUBY_FL_WB_PROTECTED(32)} : "include/ruby/ruby.h", line 803
"array.c", line 2032: syntax error before or at: )
"array.c", line 2032: warning: old-style declaration or incorrect type for: taint (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2034: syntax error before or at: if
"array.c", line 2034: syntax error before or at: !=
"array.c", line 2034: syntax error before or at: RUBY_Qnil
"array.c", line 2034: warning: old-style declaration or incorrect type for: RUBY_Qnil (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2038: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2038: warning: old-style declaration or incorrect type for: i (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2038: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2038: warning: old-style declaration or incorrect type for: rb_array_len (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2038: identifier redeclared: rb_array_len
current : function() returning int
previous: function(unsigned long) returning long : "include/ruby/ruby.h", line 2009
"array.c", line 2038: warning: old-style declaration or incorrect type for: i (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2038: syntax error before or at: ++
"array.c", line 2053: warning: old-style declaration or incorrect type for: len (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: syntax error before or at: struct
"array.c", line 2053: syntax error before or at: )
"array.c", line 2053: warning: old-style declaration or incorrect type for: tmp (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: syntax error before or at: )
"array.c", line 2053: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: warning: old-style declaration or incorrect type for: RSTRING_NOEMBED (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: identifier redeclared: RSTRING_NOEMBED
current : int
previous: enum {RSTRING_ENUM_END(536870913), RSTRING_FSTR(536870912), RSTRING_EMBED_LEN_MAX(23), RSTRING_EMBED_LEN_SHIFT(14), RSTRING_EMBED_LEN_MASK(507904), RSTRING_NOEMBED(8192)} : "include/ruby/ruby.h", line 939
"array.c", line 2053: syntax error before or at: struct
"array.c", line 2053: syntax error before or at: )
"array.c", line 2053: warning: old-style declaration or incorrect type for: tmp (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: syntax error before or at: )
"array.c", line 2053: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: warning: old-style declaration or incorrect type for: RSTRING_EMBED_LEN_SHIFT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: identifier redeclared: RSTRING_EMBED_LEN_SHIFT
current : int
previous: enum {RSTRING_ENUM_END(536870913), RSTRING_FSTR(536870912), RSTRING_EMBED_LEN_MAX(23), RSTRING_EMBED_LEN_SHIFT(14), RSTRING_EMBED_LEN_MASK(507904), RSTRING_NOEMBED(8192)} : "include/ruby/ruby.h", line 942
"array.c", line 2053: warning: old-style declaration or incorrect type for: RSTRING_EMBED_LEN_SHIFT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: syntax error before or at: )
"array.c", line 2053: warning: old-style declaration or incorrect type for: tmp (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: syntax error before or at: )
"array.c", line 2053: warning: old-style declaration or incorrect type for: as (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: warning: old-style declaration or incorrect type for: heap (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: warning: old-style declaration or incorrect type for: len (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2053: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2056: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2056: non-constant initializer: op "CALL"
"array.c", line 2057: syntax error before or at: if
"array.c", line 2057: syntax error before or at: (
"array.c", line 2057: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2057: function cannot return function or array
"array.c", line 2057: warning: old-style declaration or incorrect type for: taint (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: identifier redefined: taint
current : function() returning int
previous: int : "array.c", line 2032
"array.c", line 2057: syntax error before or at: &
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_IMMEDIATE_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: &
"array.c", line 2057: syntax error before or at: RUBY_Qnil
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_Qnil (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: struct
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_T_NODE (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: struct
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_T_BIGNUM (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: identifier redeclared: RUBY_T_BIGNUM
current : int
previous: enum ruby_value_type {RUBY_T_MASK(31), RUBY_T_ZOMBIE(29), RUBY_T_ICLASS(28), RUBY_T_NODE(27), RUBY_T_IMEMO(26), RUBY_T_UNDEF(22), RUBY_T_FIXNUM(21), RUBY_T_SYMBOL(20), RUBY_T_FALSE(19), RUBY_T_TRUE(18), RUBY_T_NIL(17), RUBY_T_RATIONAL(15), RUBY_T_COMPLEX(14), RUBY_T_MATCH(13), RUBY_T_DATA(12), RUBY_T_FILE(11), RUBY_T_BIGNUM(10), RUBY_T_STRUCT(9), RUBY_T_HASH(8), RUBY_T_ARRAY(7), RUBY_T_REGEXP(6), RUBY_T_STRING(5), RUBY_T_FLOAT(4), RUBY_T_MODULE(3), RUBY_T_CLASS(2), RUBY_T_OBJECT(1), RUBY_T_NONE(0)} : "include/ruby/ruby.h", line 461
"array.c", line 2057: syntax error before or at: struct
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_T_FLOAT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: identifier redeclared: RUBY_T_FLOAT
current : int
previous: enum ruby_value_type {RUBY_T_MASK(31), RUBY_T_ZOMBIE(29), RUBY_T_ICLASS(28), RUBY_T_NODE(27), RUBY_T_IMEMO(26), RUBY_T_UNDEF(22), RUBY_T_FIXNUM(21), RUBY_T_SYMBOL(20), RUBY_T_FALSE(19), RUBY_T_TRUE(18), RUBY_T_NIL(17), RUBY_T_RATIONAL(15), RUBY_T_COMPLEX(14), RUBY_T_MATCH(13), RUBY_T_DATA(12), RUBY_T_FILE(11), RUBY_T_BIGNUM(10), RUBY_T_STRUCT(9), RUBY_T_HASH(8), RUBY_T_ARRAY(7), RUBY_T_REGEXP(6), RUBY_T_STRING(5), RUBY_T_FLOAT(4), RUBY_T_MODULE(3), RUBY_T_CLASS(2), RUBY_T_OBJECT(1), RUBY_T_NONE(0)} : "include/ruby/ruby.h", line 455
"array.c", line 2057: syntax error before or at: struct
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: warning: old-style declaration or incorrect type for: RUBY_FL_TAINT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2057: syntax error before or at: )
"array.c", line 2057: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2058: syntax error before or at: (
"array.c", line 2058: warning: old-style declaration or incorrect type for: ary_join_0 (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2058: identifier redeclared: ary_join_0
current : function() returning int
previous: function(unsigned long, unsigned long, long, unsigned long) returning void : "array.c", line 1956
"array.c", line 2058: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2058: syntax error before or at: )
"array.c", line 2058: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2060: warning: old-style declaration or incorrect type for: result (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2094: syntax error before or at: {
"array.c", line 2094: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2095: warning: old-style declaration or incorrect type for: str (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2095: syntax error before or at: {
"array.c", line 2095: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2096: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2096: warning: old-style declaration or incorrect type for: i (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2096: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2096: warning: old-style declaration or incorrect type for: rb_array_len (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2096: warning: old-style declaration or incorrect type for: i (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2096: syntax error before or at: ++
"array.c", line 2099: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2100: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2100: warning: old-style declaration or incorrect type for: rb_enc_copy (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2100: identifier redeclared: rb_enc_copy
current : function() returning int
previous: function(unsigned long, unsigned long) returning void : "./include/ruby/encoding.h", line 129
"array.c", line 2101: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2101: warning: old-style declaration or incorrect type for: rb_str_buf_append (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2101: identifier redeclared: rb_str_buf_append
current : function() returning int
previous: function(unsigned long, unsigned long) returning unsigned long : "./include/ruby/intern.h", line 731
"array.c", line 2102: syntax error before or at: }
"array.c", line 2103: warning: old-style declaration or incorrect type for: __extension__ (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2103: warning: old-style declaration or incorrect type for: rb_str_cat (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2103: identifier redeclared: rb_str_cat
current : function() returning int
previous: function(unsigned long, pointer to const char, long) returning unsigned long : "./include/ruby/intern.h", line 755
"array.c", line 2103: syntax error before or at: "]"
"array.c", line 2103: warning: old-style declaration or incorrect type for: strlen (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2103: identifier redeclared: strlen
current : function() returning int
previous: function(pointer to const char) returning unsigned long : "/usr/include/iso/string_iso.h", line 69
"array.c", line 2103: warning: old-style declaration or incorrect type for: rb_str_cat_cstr (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2103: identifier redeclared: rb_str_cat_cstr
current : function() returning int
previous: function(unsigned long, pointer to const char) returning unsigned long : "./include/ruby/intern.h", line 756
"array.c", line 2103: syntax error before or at: "]"
"array.c", line 2103: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2103: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2104: syntax error before or at: (
"array.c", line 2104: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES)
"array.c", line 2104: function cannot return function or array
"array.c", line 2104: warning: old-style declaration or incorrect type for: tainted (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: &
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_IMMEDIATE_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: &
"array.c", line 2104: syntax error before or at: RUBY_Qnil
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_Qnil (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: struct
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: str (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_T_NODE (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: struct
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: str (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_T_BIGNUM (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: struct
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: str (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_T_MASK (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_T_FLOAT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: struct
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: str (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: old-style declaration or incorrect type for: flags (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: warning: old-style declaration or incorrect type for: RUBY_FL_TAINT (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2104: syntax error before or at: )
"array.c", line 2104: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2105: warning: old-style declaration or incorrect type for: str (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2121: syntax error before or at: {
"array.c", line 2121: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"array.c", line 2122: syntax error before or at: 0
"array.c", line 2122: warning: old-style declaration or incorrect type for: rb_exec_recursive (E_OLD_STYLE_DECL_OR_BAD_TYPE)
"array.c", line 2122: identifier redeclared: rb_exec_recursive
current : function() returning int
previous: function(pointer to function(..) returning unsigned long, unsigned long, unsigned long) returning unsigned long : "./include/ruby/intern.h", line 464
"array.c", line 3127: non-constant case expression
"array.c", line 5766: warning: statement not reached (E_STATEMENT_NOT_REACHED)
"array.c", line 5795: warning: statement not reached (E_STATEMENT_NOT_REACHED)
"array.c", line 6166: cannot recover from previous errors
cc: acomp failed for array.c
make: *** [array.o] Error 2
</code></pre>
Ruby master - Bug #11944 (Closed): ruby lib version (2.4.0) doesn't match executable version (RUB...
https://redmine.ruby-lang.org/issues/11944
2016-01-04T01:31:59Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r53314 以降、Solaris にて古い fcc (Fujitsu C Compiler) にて、<br>
以下のエラーによりビルドに失敗します。</p>
<pre><code>./miniruby -I./lib -I. -I.ext/common ./enc/make_encmake.rb --builtin-encs="enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o" --builtin-transes="enc/trans/newline.o" --module enc.mk
/XXXXX/rbconfig.rb:9:in `<module:RbConfig>': ruby lib version (2.4.0) doesn't match executable version (RUBY_PROGRAM_VERSION_MAJOR.RUBY_PROGRAM_VERSION_MINOR.0) (RuntimeError)
from /XXXXX/rbconfig.rb:7:in `<top (required)>'
from /XXXXX/lib/mkmf.rb:6:in `require'
from /XXXXX/lib/mkmf.rb:6:in `<top (required)>'
from ./enc/make_encmake.rb:8:in `load'
from ./enc/make_encmake.rb:8:in `<main>'
make: *** [enc.mk] Error 1
</code></pre>
<p>version.h 内の</p>
<blockquote>
<p>#define RUBY_BUILD_VERSION_STR_2(v) STRINGIZE(v##_MAJOR)"."STRINGIZE(v##_MINOR)<br>
#define RUBY_BUILD_VERSION_STR_3(v) RUBY_BUILD_VERSION_STR_2(v)"."STRINGIZE(v##_TEENY)</p>
</blockquote>
<p>にて文字列を作っていますが、<br>
古いfccでは、トークン結合 ## の後のマクロ展開がおかしいことになっているようです。<br>
RUBY_PROGRAM_VERSION_TEENY は0に展開されているので、マクロ組み合わせ時の問題?<br>
(fccのcppのバグ?)</p>
Ruby master - Bug #11853 (Closed): "variable.c line 43: warning: modification of typedef with int...
https://redmine.ruby-lang.org/issues/11853
2015-12-21T09:38:03Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>おそらく r50678 以降、Solaris 10 上の Oracle Solaris Studio 12.x にて、以下のWarningが出ています。</p>
<pre><code>"variable.c", line 43: warning: modification of typedef with "int" ignored (E_MODIFY_TYPEDEF_IGNORED)
</code></pre>
<p>該当行周辺は以下のとおりです。(先頭コメントは行番号)</p>
<pre><code>/* 37: */ struct ivar_update {
/* 38: */ union {
/* 39: */ st_table *iv_index_tbl;
/* 40: */ struct gen_ivtbl *ivtbl;
/* 41: */ } u;
/* 42: */ st_data_t index;
/* 43: */ int extended;
/* 44: */ };
</code></pre>
<p>cc -E でプリプロセッサ出力を出して調べてみると、<br>
標準ヘッダ /usr/include/floatingpoint.h<br>
(/usr/include/math.h 内から #include されている)<br>
の以下の記述と衝突していることがわかりました。</p>
<pre><code>typedef unsigned extended[3];
</code></pre>
<p>Illumos (旧OpenSolaris)でも同様のようです。<br>
<a href="https://github.com/illumos/illumos-gate/blob/master/usr/src/head/floatingpoint.h#L84" class="external">https://github.com/illumos/illumos-gate/blob/master/usr/src/head/floatingpoint.h#L84</a></p>
<p>幸い、元の構造体は variable.c 内部でしか使われていないので、<br>
メンバ名を変更するだけで良さそうです。</p>
Ruby master - Bug #11843 (Closed): enc/windows_1250.c syntax error with fcc on Solaris -- C++(C99...
https://redmine.ruby-lang.org/issues/11843
2015-12-19T10:25:36Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris上のfccにて、以下のコンパイルエラーが出ています。</p>
<pre><code>fcc -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -DONIG_ENC_REGISTER=rb_enc_register -KPIC -O2 -KV9 -KVIS2 -o enc/windows_1250.o -c ./enc/windows_1250.c
"./enc/windows_1250.c", line 89: error: syntax error near `/'
"./enc/windows_1250.c", line 91: error: syntax error near `/'
"./enc/windows_1250.c", line 93: error: syntax error near `/'
"./enc/windows_1250.c", line 95: error: syntax error near `/'
"./enc/windows_1250.c", line 97: error: syntax error near `/'
"./enc/windows_1250.c", line 99: error: syntax error near `/'
"./enc/windows_1250.c", line 101: error: syntax error near `/'
"./enc/windows_1250.c", line 103: error: syntax error near `/'
make[1]: *** [enc/windows_1250.o] Error 1
</code></pre>
<p>C++(またはC99)形式のコメントが使われているのが原因です。</p>
Ruby master - Bug #11821 (Closed): warning: syntax error: empty declaration in gc.c because of se...
https://redmine.ruby-lang.org/issues/11821
2015-12-15T13:30:11Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Oracle Solaris Studio 12.x にて gc.c のコンパイル時に、以下のwarningが出ます。</p>
<pre><code>cc -errtags=yes -xO4 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -D_XOPEN_SOURCE=500 -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o gc.o -c gc.c
"gc.c", line 1922: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
"gc.c", line 1943: warning: syntax error: empty declaration (E_EMPTY_DECLARATION)
</code></pre>
<p>RUBY_ALIAS_FUNCTION() の行の最後に存在する ; (セミコロン)が余計で、これが原因でこの warning が出ているようです。</p>
<p>なお、原典に当たっていないので不明ですが、C++11 からは許容されるようになったという話をどこかで見ました。</p>
Ruby master - Bug #11780 (Closed): TestIO_Console#test_getpass failed on Solaris
https://redmine.ruby-lang.org/issues/11780
2015-12-07T09:15:36Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、TestIO_Console#test_getpass が以下のエラーで失敗します。</p>
<pre><code> 1) Error:
TestIO_Console#test_getpass:
Errno::EINVAL: Invalid argument
/XXXXX/test/io/console/test_io_console.rb:190:in `getpass'
/XXXXX/test/io/console/test_io_console.rb:190:in `block in test_getpass'
/XXXXX/test/io/console/test_io_console.rb:277:in `helper'
/XXXXX/test/io/console/test_io_console.rb:185:in `test_getpass'
</code></pre>
<p>(r52912 にて確認)</p>
<p>getpass自体は特に問題なく、テストコードのバグだと思います。</p>
<p>まず、m と s の役割が逆の気がします。<br>
たとえば、同ファイル内の test_noecho や test_noecho2 では s.noecho のテストをしていますが、m に対してはecho関係の操作は行なっていません。<br>
getpass は端的に言えば内部で noecho してから gets 相当を行なっているだけと思うので、テストも同様に(test_noecho は簡潔すぎるので)test_noecho2 を元にして書けばよさそうに思いました。</p>
<p>それに加えて、現在のコードでは、Threadとassertのタイミング問題が発生しそうな予感がします。</p>
Ruby master - Bug #11743 (Closed): r52758 以降 config.guess がダウンロードできない
https://redmine.ruby-lang.org/issues/11743
2015-11-26T13:40:34Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r52758 以降、以下のエラーで configu.guess がダウンロードできず、./configure できなくなりました。</p>
<pre><code>./configure --prefix=/XXXXX
downloading config.guess ... downloader.rb:168:in `rescue in download': failed to download config.guess (RuntimeError)
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=config.guess;hb=master
from downloader.rb:115:in `download'
from downloader.rb:43:in `download'
from downloader.rb:204:in `block in <main>'
from downloader.rb:203:in `each'
from downloader.rb:203:in `<main>'
configure: error: cannot run /bin/bash tool/config.sub
</code></pre>
<p>手元の環境のruby(BASERUBY)その他が何だか怪しいのは確かですが、こういう場合もhttpsからhttpにフォールバックしてくれると助かります。</p>
Ruby master - Bug #11742 (Closed): lib/webrick/utils.rb:196:in `register': ERROR RuntimeError: ca...
https://redmine.ruby-lang.org/issues/11742
2015-11-26T06:06:21Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>RubyCI上にて、たまに以下のFailureが発生しています。</p>
<pre><code> 1) Failure:
TestNetHTTP_v1_2_chunked#test_set_form [/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/test/net/http/test_http.rb:679]:
Expected /\A--(?<boundary>\S+)/ to match "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<HTML>\n <HEAD><TITLE>Internal Server Error</TITLE></HEAD>\n <BODY>\n <H1>Internal Server Error</H1>\n can't add a new key into hash during iteration\n <HR>\n <ADDRESS>\n WEBrick/1.3.1 (Ruby/2.3.0/2015-11-26) OpenSSL/1.0.1p at\n 127.0.0.1:46098\n </ADDRESS>\n </BODY>\n</HTML>\n".
2) Failure:
TestNetHTTP_v1_2_chunked#test_set_form [/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/test/net/http/utils.rb:46]:
<[]> expected but was
<["[2015-11-26 03:54:25] ERROR RuntimeError: can't add a new key into hash during iteration\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/utils.rb:196:in `register'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/utils.rb:139:in `block in register'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/utils.rb:138:in `synchronize'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/utils.rb:138:in `register'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/utils.rb:227:in `timeout'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httprequest.rb:519:in `_read_data'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httprequest.rb:530:in `read_line'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httprequest.rb:491:in `read_chunk_size'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httprequest.rb:510:in `read_chunked'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httprequest.rb:470:in `read_body'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httprequest.rb:255:in `body'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/test/net/http/utils.rb:91:in `do_POST'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httpservlet/abstract.rb:106:in `service'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httpserver.rb:139:in `service'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/httpserver.rb:95:in `run'\n\t/home/rubyci/unstable11s/tmp/build/20151126T012513Z/ruby/lib/webrick/server.rb:295:in `block in start_thread'\n"]>.
</code></pre>
<p>上記は Solaris 11 sparc ですが、他のOS・アーキテクチャでも発生しているときがあるようです。</p>
<p>@timeout_info へのアクセスの排他制御が考慮されていないように見えます。<br>
initializeメソッド内で起動されるスレッド <code>@watcher</code> 内で <code>@timeout_info.each {|thread, ary|</code> を回しているのと、registerメソッド内冒頭で <code>@timeout_info[thread] ||= Array.new</code> しているのが、同時に発生したときにエラーが出る?</p>
Ruby master - Bug #11728 (Closed): TestSocket#test_timestamp failure on Solaris 10 with -D_XOPEN_...
https://redmine.ruby-lang.org/issues/11728
2015-11-21T14:49:40Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、CFLAGSに -D_XOPEN_SOURCE=500 を追加して、SUSv2準拠にてコンパイルした場合、make test-all にて以下のエラーが発生します。</p>
<pre><code>Finished tests in 1518.357144s, 10.4659 tests/s, 1475.1002 assertions/s.
1) Error:
TestSocket#test_timestamp:
SocketError: unknown socket level option name: TIMESTAMP
/XXXXX-52685/test/socket/test_socket.rb:461:in `setsockopt'
/XXXXX-52685/test/socket/test_socket.rb:461:in `block (2 levels) in test_timestamp'
/XXXXX-52685/.ext/common/socket.rb:190:in `bind'
/XXXXX-52685/test/socket/test_socket.rb:460:in `block in test_timestamp'
/XXXXX-52685/.ext/common/socket.rb:190:in `bind'
/XXXXX-52685/test/socket/test_socket.rb:459:in `test_timestamp'
15891 tests, 2239729 assertions, 0 failures, 1 errors, 49 skips
ruby -v: ruby 2.3.0dev (2015-11-20) [sparc64-solaris2.10]
make: *** [yes-test-all] Error 1
</code></pre>
<p><code>-D_XOPEN_SOURCE=500</code> つまり <code>#define _XOPEN_SOURCE 500</code> にすると、<br>
Solaris でも Socket::AncillaryData が使えるようになるのですが、<br>
SO_TIMESTAMP は Solaris 10 には存在しないため、エラーになったようです。<br>
(SO_TIMESTAMP は Solaris 11 から追加されたようです。)</p>
<p>(参考: <code>_XOPEN_SOURCE</code> の値と準拠する標準に関しては <a href="https://docs.oracle.com/cd/E36784_01/html/E36883/xpg4-5.html" class="external">https://docs.oracle.com/cd/E36784_01/html/E36883/xpg4-5.html</a> などを参照。<br>
なお、Rubyでは <code>__EXTENSIONS__</code> がconfigureにて自動的に付加され、使用する標準と衝突しない新旧の追加機能は使える設定になっています。)</p>
Ruby master - Bug #11709 (Closed): TestSocket#test_udp_recvmsg_truncation failure on Solaris 10
https://redmine.ruby-lang.org/issues/11709
2015-11-18T16:07:15Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris 10, the following failure occurs.<br>
(observed in r52648)</p>
<pre><code> 1) Failure:
TestSocket#test_udp_recvmsg_truncation [/XXXXX-52648/test/socket/test_socket.rb:709]:
<32> expected but was
<false>.
</code></pre>
<p>The test code ignores platforms that have no HAVE_STRUCT_MSGHDR_MSG_CONTROL and rflag is always nil.</p>
Ruby master - Bug #11697 (Closed): test/dtrace failure on Solaris 10
https://redmine.ruby-lang.org/issues/11697
2015-11-16T12:16:16Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>test/dtrace fails on Solaris 10 as follows.</p>
<p>Ruby (64-bit) compiled by using Oracle Solaris Studio 12.3 cc with "-xO3" optimization:</p>
<pre><code>$ SUDO=sudo ruby test/runner.rb test/dtrace
Run options:
# Running tests:
[26/26] DTrace::TestStringProbes#test_object_create_start_string_lit = 1.5
1) Failure:
DTrace::TestStringProbes#test_object_create_start_string_lit [/XXXXX-52420/test/dtrace/test_string.rb:10]:
<["String"]> expected but was
<[]>.
Finished tests in 33.513504s, 0.7758 tests/s, 6.2960 assertions/s.
26 tests, 211 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 2.3.0dev (2015-11-01) [sparc64-solaris2.10]
</code></pre>
<p>Ruby (64-bit) compiled by using Solaris Studio 12.3 cc without optimization (with "-xO0") :</p>
<pre><code>$ SUDO=sudo ruby test/runner.rb test/dtrace
Run options:
# Running tests:
[ 3/26] DTrace::TestCMethod#test_entry = 1.77 s
1) Failure:
DTrace::TestCMethod#test_entry [/XXXXX-52250/test/dtrace/test_cmethod.rb:18]:
<1> expected but was
<0>.
Finished tests in 40.703063s, 0.6388 tests/s, 5.2330 assertions/s.
26 tests, 213 assertions, 1 failures, 0 errors, 0 skips
ruby -v: ruby 2.3.0dev (2015-10-24) [sparc64-solaris2.10]
</code></pre>
<p>It seems that the failure is due to overflowing of dtrace's trace buffer.<br>
On Solaris, the default buffer size is 4MB.<br>
The failure does not happen when increasing the buffer size to 8MB (calling dtrace with "-b 8m" option)</p>
<pre><code>--- test/dtrace/helper.rb.ORIG~ 2014-11-19 23:15:23.909272000 +0900
+++ test/dtrace/helper.rb 2015-11-16 21:03:35.411936000 +0900
@@ -26,7 +26,7 @@
d_path = d.path
rb_path = rb.path
- cmd = ["dtrace", "-q", "-s", d_path, "-c", "#{EnvUtil.rubybin} -I#{INCLUDE} #{rb_path}"]
+ cmd = ["dtrace", "-b", "8m", "-q", "-s", d_path, "-c", "#{EnvUtil.rubybin} -I#{INCLUDE} #{rb_path}"]
if sudo = @@sudo
[RbConfig::CONFIG["LIBPATHENV"], "RUBY", "RUBYOPT"].each do |name|
if name and val = ENV[name]
</code></pre>
Ruby master - Bug #11684 (Closed): Pack#unpack test failure on Solaris 10 with Oracle Solaris Stu...
https://redmine.ruby-lang.org/issues/11684
2015-11-13T16:48:02Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris 10, when compiling ruby with Oracle Solaris Studio 12.4 with -xO4 optimization option, the following test failure is observed during make test-all. (tested with r52550)</p>
<pre><code> 1) Failure:
TestPack#test_pack_unpack_atmark [XXXXX/test/ruby/test_pack.rb:548]:
<[nil]> expected but was
<[]>.
2) Failure:
TestPack#test_short_string [/XXXXX/test/ruby/test_pack.rb:735]:
<[1, nil]> expected but was
<[1]>.
15885 tests, 2225854 assertions, 2 failures, 0 errors, 50 skips
</code></pre>
<p>It seems that String#unpack is incorrectly compiled with Oracle Solaris Studio 12.4 with -xO4.</p>
<pre><code>$ irb
irb(main):001:0> [1,2].pack('i2')
=> "\x00\x00\x00\x01\x00\x00\x00\x02" ###<== OK
irb(main):002:0> "\x00\x00\x00\x01\x00\x00\x00\x02".unpack('i3')
=> [1, 2] ###<== [1, 2, nil] is expected
</code></pre>
<p>It seems that PACK_ITEM_ADJUST() is wiped out by wrong optimization.<br>
I think this is a bug of Oracle Solaris Studio 12.4.</p>
<p>The failure is not observed with -xO3 or lower optimization option.<br>
It is also not observed by using Oracle Solaris Studio 12.3, even speficying -xO4 optimization option.</p>
Ruby master - Bug #11645 (Closed): Since r52422, failed to compile parse.y on Solaris 10 with Ora...
https://redmine.ruby-lang.org/issues/11645
2015-11-02T16:07:16Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、 Oracle Solaris Studio 12.3 にて、parse.y (から生成された parse.c)のコンパイルに失敗します。</p>
<pre><code>ruby --disable=gems ./tool/id2token.rb --path-separator=.:./ --vpath=.ext/include/sparc64-solaris2.10/ruby:./include/ruby:./missing id.h parse.y > parse.tmp.y
bison -d -o y.tab.c parse.tmp.y
rm -f parse.tmp.y
sed -f ./tool/ytab.sed -e "/^#/s!parse\.tmp\.[iy]!parse.y!" -e "/^#/s!y\.tab\.c!parse.c!" y.tab.c > parse.c.new
mv parse.c.new parse.c
sed -e "/^#line.*y\.tab\.h/d;/^#line.*parse.*\.y/d" y.tab.h > parse.h
rm -f y.tab.c y.tab.h
+ cp ./lex.c.blt lex.c
cc -xO4 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o parse.o -c parse.c
"parse.y", line 1256: operands have incompatible types:
void ":" int
"parse.y", line 1721: operands have incompatible types:
void ":" int
"parse.y", line 1813: operands have incompatible types:
void ":" int
"parse.y", line 2061: operands have incompatible types:
void ":" int
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 174: warning: initializer will be sign-extended: -1
"defs/keywords", line 22: warning: initializer will be sign-extended: -1
"defs/keywords", line 22: warning: initializer will be sign-extended: -1
cc: acomp failed for parse.c
make: *** [parse.o] Error 2
</code></pre>
<p>3項演算子の後ろ2項は同じ型である必要がある、というエラーのようです。<br>
r52422にてparse.yに追加された以下のマクロが原因と思われます。</p>
<pre><code>+#define NO_QCALL(q, here) \
+ ((q) != tDOTQ ? (void)0 : \
+ yyerror(".? in "here" is not supported yet"))
</code></pre>
Ruby master - Bug #11644 (Closed): Since r52055, TestMkmf::TestConvertible failed on Solaris 10 w...
https://redmine.ruby-lang.org/issues/11644
2015-11-02T11:36:20Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r52055以降、Solaris 10 上の古いfcc (Fujitsu C Compiler) にてコンパイルすると、<br>
make test-all にて<br>
TestMkmf::TestConvertible#test_typeof_builtin<br>
TestMkmf::TestConvertible#test_typeof_typedef<br>
がfailureになります。</p>
<p>長いのでFailure部分のログはファイル(r52055-failure.log)にて添付します。</p>
<p>以下のようにポインタの型の不一致のWarningが出ているのが原因でしょうか?</p>
<pre><code>"/XXXXX-52055/include/ruby/ruby.h", line 2003: warning: return incompatible pointer types: expected `const VALUE *' actual `const unsigned long *' in function `rb_array_const_ptr'
"/XXXXX-52055/include/ruby/ruby.h", line 2017: warning: return incompatible pointer types: expected `const VALUE *' actual `const unsigned long *' in function `rb_struct_const_ptr'
</code></pre>
<p>なお、Oracle Solaris Studio 12.3 など他のコンパイラではFailureにならず成功しています。</p>
Ruby master - Bug #11487 (Closed): id_table.c compile error by fcc on Solaris 10
https://redmine.ruby-lang.org/issues/11487
2015-08-25T08:05:55Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 上の古いfccにて、最近、id_table.c のコンパイルに失敗します。</p>
<p>下記は r51677 におけるエラーメッセージです。</p>
<pre><code>fcc -O2 -KV9 -KVIS2 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o symbol.o -c symbol.c
(中略)
"./id_table.c", line 453: error: syntax error near `/'
"./id_table.c", line 1277: error: initialization: constant expression is expected for variable: `tmp_tbl'
make: *** [symbol.o] Error 1
</code></pre>
<p>2箇所にエラーが出ているのがわかります。</p>
<p>id_table.c の453行目は以下のとおりです。</p>
<pre><code> // fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n", old_values, new_values, num, capa);
</code></pre>
<p>CのソースなのにC++形式のコメントを使っているのが原因です。</p>
<p>id_table.c の1277行目は以下のとおりです。</p>
<pre><code> struct hash_id_table tmp_tbl = {new_cap, 0, 0};
</code></pre>
<p>構造体の変数による初期化はできない主旨のエラーが出ています。<br>
宣言後、1要素ずつ代入するように書き換えるとよさそうです。</p>
Ruby master - Bug #11394 (Closed): Error in test/rinda/test_rinda.rb when IPv6 address is only ::...
https://redmine.ruby-lang.org/issues/11394
2015-07-24T11:07:17Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>システム上に存在するIPv6アドレスが、ループバックデバイスに割り当てられた ::1 だけの場合、test/rinda/test_rinda.rb で以下のエラーが発生します。</p>
<p>Linux (Debian wheezy)の場合 。</p>
<pre><code># ifconfig eth0 inet6 del fe80::XXXX:XXXX:XXXX:XXXX/64
% ruby test/runner.rb test/rinda/test_rinda.rb
Run options:
# Running tests:
[ 9/39] Rinda::TestRingServer#test_make_socket_ipv6_multicast = 0.00
1) Error:
Rinda::TestRingServer#test_make_socket_ipv6_multicast:
Errno::ENODEV: No such device - setsockopt(2)
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `setsockopt'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `make_socket'
/XXXXXXXX/test/rinda/test_rinda.rb:642:in `test_make_socket_ipv6_multicast'
[12/39] Rinda::TestRingServer#test_ring_server_ipv6_multicast = 0.00
2) Error:
Rinda::TestRingServer#test_ring_server_ipv6_multicast:
Errno::ENODEV: No such device - setsockopt(2)
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `setsockopt'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:161:in `make_socket'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:107:in `block in initialize'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:105:in `each'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:105:in `initialize'
/XXXXXXXX/test/rinda/test_rinda.rb:678:in `new'
/auto/user3/gen-info/ngoto/testruby/daily/src/github/ruby/test/rinda/test_rinda.rb:678:in `test_ring_server_ipv6_multicast'
Leaked file descriptor: Rinda::TestRingServer#test_ring_server_ipv6_multicast: 10 : #<Socket:fd 10>
Finished tests in 1.545205s, 25.2394 tests/s, 250.4522 assertions/s.
39 tests, 387 assertions, 0 failures, 2 errors, 2 skips
ruby -v: ruby 2.3.0dev (2015-07-16) [x86_64-linux]
</code></pre>
<p>Solaris 10 の場合。</p>
<pre><code>$ ruby test/runner.rb test/rinda/test_rinda.rb
Run options:
# Running tests:
[ 3/39] Rinda::TestRingFinger#test_make_socket_ipv6_multicast = 0.00 s
1) Error:
Rinda::TestRingFinger#test_make_socket_ipv6_multicast:
Errno::ENETUNREACH: Network is unreachable - connect(2) for [ff02::1]:7647
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `connect'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `make_socket'
/XXXXXXXX/test/rinda/test_rinda.rb:773:in `test_make_socket_ipv6_multicast'
[ 4/39] Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops = 0.00 s
2) Error:
Rinda::TestRingFinger#test_make_socket_ipv6_multicast_hops:
Errno::ENETUNREACH: Network is unreachable - connect(2) for [ff02::1]:7647
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `connect'
/PREFIX/lib/ruby/2.3.0/rinda/ring.rb:430:in `make_socket'
/XXXXXXXX/test/rinda/test_rinda.rb:797:in `test_make_socket_ipv6_multicast_hops'
Leaked file descriptor: Rinda::TestRingServer#test_ring_server_ipv6_multicast: 11
Closed file descriptor: Rinda::TestRingServer#test_shutdown: 11
Finished tests in 2.053681s, 18.9903 tests/s, 188.4421 assertions/s.
39 tests, 387 assertions, 0 failures, 2 errors, 0 skips
ruby -v: ruby 2.3.0dev (2015-07-24) [sparc64-solaris2.10]
</code></pre>
<p>当該テストを、IPv6がloopbackだけの場合はskipするように変更したいと思います。</p>
Ruby master - Bug #11353 (Closed): ASYNC BUG after failure of Process.exec when closing FD 3 (or ...
https://redmine.ruby-lang.org/issues/11353
2015-07-15T14:23:18Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>The following shows ASYNC BUG.</p>
<pre><code>ruby -e 'Process.exec("/does_not_exist", "arg", {3=>:close})'
[ASYNC BUG] -e:1:in `exec': No such file or directory - /does_not_exist (Errno::ENOENT)
from -e:1:in `<main>'
consume_communication_pipe: read
EBADF
ruby 2.3.0dev (2015-07-10) [x86_64-linux]
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Aborted
</code></pre>
<p>Closing FD 4 or 5 also causes ASYNC BUG.</p>
Ruby master - Bug #11350 (Closed): When Process.exec failed, redirections were still changed and ...
https://redmine.ruby-lang.org/issues/11350
2015-07-14T04:27:41Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>When Process.exec failed, redirections of file descriptors were changed and not restored.</p>
<p>When redirecting fd 3 or 5, ASYNC BUG occurred as below.</p>
<pre><code>$ ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 3=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end'
[ASYNC BUG] consume_communication_pipe: read
EBADF
ruby 2.3.0dev (2015-07-13) [sparc64-solaris2.10]
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
stdout: #<Errno::ENOENT: No such file or directory - /does_not_exist>
stderr: #<Errno::ENOENT: No such file or directory - /does_not_exist>Abort
</code></pre>
<pre><code>$ ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 5=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end'
[ASYNC BUG] consume_communication_pipe: read
EBADF
ruby 2.3.0dev (2015-07-13) [sparc64-solaris2.10]
stdout: [NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
#<Errno::ENOENT: No such file or directory - /does_not_exist>
stderr: #<Errno::ENOENT: No such file or directory - /does_not_exist>Abort
</code></pre>
<p>When redirecting fd 1 or 2 to /dev/null, stdout or stderr is still redirected to /dev/null and the printed contents are not shown.</p>
<pre><code>% ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 1=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end'
stderr: #<Errno::ENOENT: No such file or directory - /does_not_exist>
</code></pre>
<pre><code>% ruby -e 'begin; Process.exec("/does_not_exist", "arg", { 2=>["/dev/null", "w"]}); rescue Errno::ENOENT => e; $stdout.print "stdout: ", e.inspect, "\n"; $stderr.print "stderr: ", e.inspect, "\n"; end'
stdout: #<Errno::ENOENT: No such file or directory - /does_not_exist>
</code></pre>
<p>All of the above are observed both on x86_64 Linux and sparc Solaris.</p>
<p>Is this spec or bug?</p>
Ruby master - Bug #11336 (Closed): TestProcess#test_exec_fd_3_redirect failed on Solaris 10
https://redmine.ruby-lang.org/issues/11336
2015-07-07T09:36:03Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris 10, TestProcess#test_exec_fd_3_redirect failed since r51146 (where the test was added).</p>
<pre><code> 1) Failure:
TestProcess#test_exec_fd_3_redirect [/XXXXX-51146/test/ruby/test_process.rb:2049]:
<"."> expected but was
<nil>.
</code></pre>
Ruby master - Bug #11288 (Closed): start_watchdog in test/lib/test/unit.rb is meaningless
https://redmine.ruby-lang.org/issues/11288
2015-06-19T18:40:21Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>test/lib/test/unit.rb の 317行目付近の start_watchdog は、<br>
_run_parallel メソッド内の408行目から呼ばれますが、<br>
子プロセスを起動する前に呼んでいるため、<br>
start_watchdog 内で Process.wait2 するスレッドを起動しているものの、<br>
すぐに Errno::ECHILD 例外が発生して当該スレッドは終了してしまいます。<br>
つまり、名前に反して watchdog を行うことはありません。</p>
<p>このように、start_watchdog は、現在、まったく何の働きもしていないはずのため、削除しても問題なさそうです。<br>
または、ちゃんと watchdog するように修正するか、どちらかだと思います。</p>
Ruby master - Bug #11277 (Closed): "code converter not found" error with multi-thread (high occur...
https://redmine.ruby-lang.org/issues/11277
2015-06-18T07:01:52Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>sparc Solaris 10 にて、r50887 以降、make test-all にて以下の3つのFailureが出るようになりました。</p>
<pre><code> 1) Failure:
TestDir_M17N#test_filename_extutf8_inteucjp_unrepresentable [/XXXXX-trunk-50887/test/ruby/test_dir_m17n.rb:152]:
assert_separately failed with error message.
<""> expected but was
<"/XXXXX-trunk-50887/test/lib/envutil.rb:72:in `read': code converter not found (UTF-8 to EUC-JP) (Encoding::ConverterNotFoundError)\n\tfrom /XXXXX-trunk-50887/test/lib/envutil.rb:72:in `block in invoke_ruby'\n">.
2) Failure:
TestDir_M17N#test_filename_extutf8_inteucjp_representable [/XXXXX-trunk-50887/test/ruby/test_dir_m17n.rb:125]:
assert_separately failed with error message.
<""> expected but was
<"/XXXXX-trunk-50887/test/lib/envutil.rb:72:in `read': code converter not found (UTF-8 to EUC-JP) (Encoding::ConverterNotFoundError)\n\tfrom /XXXXX-trunk-50887/test/lib/envutil.rb:72:in `block in invoke_ruby'\n">.
3) Failure:
TestDir_M17N#test_filename_ext_euc_jp_and_int_utf_8 [/XXXXX-trunk-50887/test/ruby/test_dir_m17n.rb:246]:
assert_separately failed with error message.
<""> expected but was
<"/XXXXX-trunk-50887/test/lib/envutil.rb:72:in `read': code converter not found (EUC-JP to UTF-8) (Encoding::ConverterNotFoundError)\n\tfrom /XXXXX-trunk-50887/test/lib/envutil.rb:72:in `block in invoke_ruby'\n">.
</code></pre>
Ruby master - Bug #11265 (Closed): deadlock on Solaris 10 since r50900
https://redmine.ruby-lang.org/issues/11265
2015-06-16T05:35:31Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris10にて、r50900 以降、<br>
TestParallel::TestParallel#test_jobs_status<br>
TestParallel::TestParallel#test_separate<br>
のいずれか、または両方で、テストが停止状態となり次に進まなくなります。<br>
スレッドのデッドロックが発生しているような感じです。</p>
<p>ところで、こういう場合の上手いデバッグ方法って何があるでしょうか?</p>
Ruby master - Bug #11245 (Closed): Build failure on Solaris 10 with gcc since r50804
https://redmine.ruby-lang.org/issues/11245
2015-06-10T13:21:30Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 + gcc 4.6.2 にて、r50804以降、以下のように ext/bigdecimal のビルドに失敗します。</p>
<pre><code>make -C ext/bigdecimal -w V=1 all
make[2]: Entering directory `/XXXXX-gcc-trunk-50804/ext/bigdecimal'
gcc -I. -I../../.ext/include/sparc64-solaris2.10 -I../.././include -I../.././ext/bigdecimal -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -fPIC -O -m64 -m64 -o bigdecimal.o -c bigdecimal.c
bigdecimal.c:107:1: error: static declaration of 'rb_rational_num' follows non-static declaration
../.././include/ruby/intern.h:171:7: note: previous declaration of 'rb_rational_num' was here
bigdecimal.c: In function 'rb_rational_num':
bigdecimal.c:112:5: error: too few arguments to function 'rb_funcall'
../.././include/ruby/ruby.h:1535:7: note: declared here
bigdecimal.c: At top level:
bigdecimal.c:119:1: error: static declaration of 'rb_rational_den' follows non-static declaration
../.././include/ruby/intern.h:172:7: note: previous declaration of 'rb_rational_den' was here
bigdecimal.c: In function 'rb_rational_den':
bigdecimal.c:124:5: error: too few arguments to function 'rb_funcall'
../.././include/ruby/ruby.h:1535:7: note: declared here
make[2]: *** [bigdecimal.o] Error 1
make[2]: Leaving directory `/XXXXX-gcc-trunk-50804/ext/bigdecimal'
make[1]: *** [ext/bigdecimal/all] Error 2
make[1]: Leaving directory `/XXXXX-gcc-trunk-50804'
make: *** [build-ext] Error 2
</code></pre>
<p>ext/bigdecimal/extconf.rb の r50803 と r50804 の差分は以下のとおりです。</p>
<pre><code>--- XXXXX-gcc-trunk-50803/ext/bigdecimal/extconf.h 2015-06-10 20:43:34.880118000 +0900
+++ XXXXX-gcc-trunk-50804/ext/bigdecimal/extconf.h 2015-06-10 20:55:45.316991000 +0900
@@ -2,6 +2,4 @@
#define EXTCONF_H
#define HAVE_LABS 1
#define HAVE_LLABS 1
-#define HAVE_RB_RATIONAL_NUM 1
-#define HAVE_RB_RATIONAL_DEN 1
#endif
</code></pre>
<p>r50804 では rb_rational_num() と rb_rational_den() が無いことにされています。</p>
<p>mkmf.log の差分(の抜粋)を見ると、r50803 ではgcc実行時に付いていたオプション -fstack-protector が r50804 では無くなっていて、このためにリンクエラーになって実行に失敗しているのがわかります。</p>
<pre><code>--- XXXXX-trunk-50803/ext/bigdecimal/mkmf.log 2015-06-10 20:43:34.894944000 +0900
+++ XXXXX-trunk-50804/ext/bigdecimal/mkmf.log 2015-06-10 20:55:45.331985000 +0900
@@ -66,10 +66,16 @@
--------------------
-have_func: checking for rb_rational_num() in ruby.h... -------------------- yes
+have_func: checking for rb_rational_num() in ruby.h... -------------------- no
-"gcc -o conftest -I../../.ext/include/sparc64-solaris2.10 -I../.././include -I../.././ext/bigdecimal -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -O conftest.c -L. -L../.. -L. -L/usr/local/64/lib -R/usr/local/64/lib -fstack-protector -m64 -Wl,-R/XXXXX-gcc-trunk/lib -L/XXXXX-gcc-trunk/lib -lruby-static -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm -lc"
-\{\"LD_LIBRARY_PATH_64\"\=\>\".:../..\"\} gcc\ -o\ conftest\ -I../../.ext/include/sparc64-solaris2.10\ -I../.././include\ -I../.././ext/bigdecimal\ \ -I/usr/local/64/lib/libffi-3.0.10/include\ -I/usr/local/64/include\ \ \ \ -O\ conftest.c\ \ -L.\ -L../..\ -L.\ -L/usr/local/64/lib\ -R/usr/local/64/lib\ -fstack-protector\ \ -m64\ \ \ -Wl,-R/XXXXX-gcc-trunk/lib\ -L/XXXXX-gcc-trunk/lib\ -lruby-static\ \ -lpthread\ -lrt\ -lgmp\ -lsocket\ -ldl\ -lcrypt\ -lm\ \ \ -lc
+"gcc -o conftest -I../../.ext/include/sparc64-solaris2.10 -I../.././include -I../.././ext/bigdecimal -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -O -m64 conftest.c -L. -L../.. -L/usr/local/64/lib -R/usr/local/64/lib -m64 -Wl,-R/XXXXX-gcc-trunk/lib -L/XXXXX-gcc-trunk/lib -lruby-static -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm -lc"
+\{\"LD_LIBRARY_PATH_64\"\=\>\".:../..\"\} gcc\ -o\ conftest\ -I../../.ext/include/sparc64-solaris2.10\ -I../.././include\ -I../.././ext/bigdecimal\ \ -I/usr/local/64/lib/libffi-3.0.10/include\ -I/usr/local/64/include\ \ -O\ -m64\ conftest.c\ \ -L.\ -L../..\ -L/usr/local/64/lib\ -R/usr/local/64/lib\ \ -m64\ \ \ -Wl,-R/XXXXX-gcc-trunk/lib\ -L/XXXXX-gcc-trunk/lib\ -lruby-static\ \ -lpthread\ -lrt\ -lgmp\ -lsocket\ -ldl\ -lcrypt\ -lm\ \ \ -lc
+Undefined first referenced
+ symbol in file
+__stack_chk_fail ../../libruby-static.a(ruby-glommed.o)
+__stack_chk_guard ../../libruby-static.a(ruby-glommed.o)
+ld: fatal: symbol referencing errors. No output written to conftest
+collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
</code></pre>
<p>この -fstack-protector が消えてしまうのは、以下の理由によると考えられます。</p>
<ol>
<li>ruby本体の ./configure 時に以下のように LDFLAGS その他を X=Y 形式で指定している</li>
<li>-fstack-protector は ruby本体の ./configure スクリプト中で、利用可能な場合は、自動的に付与される</li>
<li>r50804 の変更で RbConfig::MAKEFILE_CONFIG["configure_args"] の X=Y 形式の指定をパースするようになったので、最初のruby本体のconfigure時に渡したオプションのLDFLAGS その他をそのまま拡張モジュールのビルドに使うようになった。</li>
<li>このため、ruby本体のconfigureが後から自動的に追加した -fstack-protector は無視されてしまうことになった。</li>
</ol>
<pre><code>CC=gcc
CXX=g++
CPPLAGS=" -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include"
CFLAGS=" -O -m64"
CXXFLAGS=" -O -m64"
LDFLAGS="-L/usr/local/64/lib -R/usr/local/64/lib"
DLDFLAGS=" -L/usr/local/64/lib -R/usr/local/64/lib"
./configure --prefix=/XXXXX-gcc-trunk --build=sparc64-sun-solaris2.10 --with-tclConfig-dir=/usr/local/64/lib --with-tkConfig-dir=/usr/local/64/lib
</code></pre>
<p>このように r50804 の変更は不具合があるため、いったんはリバートを提案します。</p>
<p>この変更の主旨を汲むとすれば、以下のいずれかが必要と思います。<br>
A. CFLAGS, LDFLAGS など、ruby本体の ./configure 内で触った可能性のあるものは渡さないようにする<br>
B. ruby本体の ./configure 内でいじくり回した後の CFLAGS や LDFLAGS その他を渡すようにする<br>
C. RUBY本体の ./configure と同じ -fstack-protector などのオプションの自動付与処理を mkmf.rb 内で行う</p>
Ruby master - Bug #11243 (Closed): make install failed on Solaris10
https://redmine.ruby-lang.org/issues/11243
2015-06-10T09:45:47Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて make install に失敗します。<br>
r50813 にて症状を確認しています。</p>
<pre><code>preprocessing version.c
generating sparc64-solaris2.10-fake.rb
sparc64-solaris2.10-fake.rb updated
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems -r./sparc64-solaris2.10-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="man" --install=all --rdoc-output=".ext/rdoc"
/XXXXX-50813/tool/fake.rb:2
:in `<class:File>': uninitialized constant File::RUBY_PLATFORM (NameError)
from /XXXXX-50813/tool/fake.rb:1:in `<top (required)>'
from /XXXXX-50813/sparc64-solaris2.10-fake.rb:19:in `eval'
from /XXXXX-50813/sparc64-solaris2.10-fake.rb:19:in `<top (required)>'
from ./tool/rbinstall.rb:1:in `require'
make: *** [do-install-all] Error 1
</code></pre>
<p>sparc64-solaris2.10-fake.rb を添付します。</p>
Ruby master - Bug #11225 (Closed): r50776 + r50780 + r50781 changes behavior on systems without H...
https://redmine.ruby-lang.org/issues/11225
2015-06-05T15:54:02Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On systems without HAVE_STRUCT_MSGHDR_MSG_CONTROL such as Solaris 10,<br>
when passing 3 or more arguments to rsock_bsock_sendmsg and rsock_bsock_sendmsg_nonblock that internally call bsock_sendmsg_internal,</p>
<p>r50775 or before: NotImplementedError is raised as follows.</p>
<pre><code> rb_raise(rb_eNotImpError, "control message for sendmsg is unimplemented");
</code></pre>
<p>after r50776: ArgumentError is raised in rb_scan_args(argc, argv, "12", ...)</p>
<p>I think the behavior change is not intended.</p>
Ruby master - Bug #11224 (Closed): test/socket/test_nonblock.rb:266: [BUG] Segmentation fault at ...
https://redmine.ruby-lang.org/issues/11224
2015-06-05T15:41:20Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On sparc Solaris10, during make test-all, the following SEGV occurs.</p>
<pre><code>TestSocketNonblock#test_recvmsg_nonblock_error = 0.00 s = .
/XXXXXXXXXX-trunk-50782/test/socket/test_nonblock.rb:266: [BUG] Segmentation fault at 0x00000000000008
ruby 2.3.0dev (2015-06-05) [sparc64-solaris2.10]
-- Control frame information -----------------------------------------------
c:0029 p:---- s:0139 e:000138 CFUNC :sendmsg_nonblock
c:0028 p:0014 s:0135 e:000134 BLOCK /XXXXXXXXXX-trunk-50782/test/socket/test_nonblock.rb:266 [FINISH]
c:0027 p:---- s:0133 e:000132 CFUNC :loop
c:0026 p:0009 s:0130 e:000129 BLOCK /XXXXXXXXXX-trunk-50782/test/socket/test_nonblock.rb:265
c:0025 p:0121 s:0126 e:000125 METHOD /XXXXXXXXXX-trunk-50782/test/socket/test_nonblock.rb:186
c:0024 p:0007 s:0115 e:000114 METHOD /XXXXXXXXXX-trunk-50782/test/socket/test_nonblock.rb:263
c:0023 p:0034 s:0112 e:000111 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:1008
c:0022 p:0069 s:0107 e:000106 METHOD /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:1268
c:0021 p:0019 s:0099 e:000098 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit/testcase.rb:17
c:0020 p:0068 s:0095 e:000094 BLOCK /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:940 [FINISH]
c:0019 p:---- s:0089 e:000088 CFUNC :map
c:0018 p:0116 s:0086 e:000085 METHOD /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:933
c:0017 p:0048 s:0075 e:000074 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:902
c:0016 p:0015 s:0069 e:000067 BLOCK /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:480 [FINISH]
c:0015 p:---- s:0064 e:000063 CFUNC :each
c:0014 p:0067 s:0061 E:001dd8 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:478
c:0013 p:0012 s:0055 E:000a28 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:511
c:0012 p:0131 s:0049 E:000ac8 METHOD /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:884
c:0011 p:0009 s:0039 E:000b30 METHOD /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:1095
c:0010 p:0009 s:0036 E:000c08 BLOCK /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:1082 [FINISH]
c:0009 p:---- s:0033 e:000032 CFUNC :each
c:0008 p:0048 s:0030 E:000b98 METHOD /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:1081
c:0007 p:0017 s:0026 E:000c78 METHOD /XXXXXXXXXX-trunk-50782/test/lib/minitest/unit.rb:1069
c:0006 p:0010 s:0022 E:000cf0 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:671
c:0005 p:0019 s:0017 E:000d58 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:32
c:0004 p:0040 s:0013 E:000dc0 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:979
c:0003 p:0013 s:0010 E:000e28 METHOD /XXXXXXXXXX-trunk-50782/test/lib/test/unit.rb:983
c:0002 p:0278 s:0006 E:000a18 EVAL ./test/runner.rb:45 [FINISH]
c:0001 p:0000 s:0002 E:000e80 (none) [FINISH]
</code></pre>
Ruby master - Bug #11219 (Closed): bootstrap test failed on sparc Solaris since r50743
https://redmine.ruby-lang.org/issues/11219
2015-06-04T09:15:46Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r50743以降、sparc Solaris 10 にて bootstrap test が失敗します。<br>
(64ビット、32ビット共)</p>
<pre><code>test_syntax.rb ..............................Fstderr output is not empty
bootstraptest.tmp.rb:4: [BUG] unreachable
ruby 2.3.0dev (2015-06-03) [sparc64-solaris2.10]
-- Control frame information -----------------------------------------------
c:0003 p:0022 s:0010 e:000007 METHOD bootstraptest.tmp.rb:4
c:0002 p:0026 s:0005 E:000b20 EVAL bootstraptest.tmp.rb:17 [FINISH]
c:0001 p:0000 s:0002 E:001020 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
bootstraptest.tmp.rb:17:in `<main>'
bootstraptest.tmp.rb:4:in `test'
-- Other runtime information -----------------------------------------------
* Loaded script: bootstraptest.tmp.rb
* Loaded features:
0 enumerator.so
1 rational.so
2 complex.so
3 /XXXXX-50743/.ext/sparc64-solaris2.10/enc/encdb.so
4 /XXXXX-50743/.ext/sparc64-solaris2.10/enc/trans/transdb.so
5 /XXXXX-50743/lib/unicode_normalize.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
.............................................................................................................................
test_thread.rb ..................................................
#142 test_eval.rb:212:in `<top (required)>':
class Module
def my_module_eval(&block)
module_eval(&block)
end
end
class String
Integer.my_module_eval do
def hoge; end
end
end
if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) &&
!String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge)
:ok
else
:ng
end
#=> "ng" (expected "ok") <a href="https://blade.ruby-lang.org/ruby-dev/34236">[ruby-dev:34236]</a>
#837 test_syntax.rb:233:in `<top (required)>':
class C
def test
[defined?(m1()), defined?(self.m1), defined?(C.new.m1),
defined?(m2()), defined?(self.m2), defined?(C.new.m2),
defined?(m3()), defined?(self.m3), defined?(C.new.m3)]
end
def m1
end
private
def m2
end
protected
def m3
end
end
C.new.test + [defined?(C.new.m3)]
#=> "" (expected "[\"method\", \"method\", \"method\", \"method\", nil, nil, \"method\", \"method\", \"method\", nil]")
FAIL 2/1012 tests failed
make: *** [yes-btest-ruby] Error 1
</code></pre>
<p>r50743 は rb_method_definition_t のビットフィールド分割などの変更ですので、<br>
おそらく、big endian と little endian の違いにより顕在化した問題で、<br>
何かの値をVALUEなどと暗黙のうちに兼用している部分があるのだと思いますが、<br>
探しだせませんでした。</p>
Ruby master - Bug #11217 (Closed): vm_method.c compile error by fcc on Solaris 10
https://redmine.ruby-lang.org/issues/11217
2015-06-03T15:20:01Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 上の古いfccにて、r50728以降、vm_method.c (vm.c から読み込まれる)のコンパイルに失敗します。</p>
<p>下記はr50750でのエラーメッセージです。</p>
<pre><code>fcc -O2 -KV9 -KVIS2 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o vm.o -c vm.c
(中略)
"./vm_method.c", line 567: error: initialization: constant expression is expected for variable: `iseq_body'
(中略)
make: *** [vm.o] Error 1
</code></pre>
<p>該当行付近は以下のような感じです。「この行でエラー」の部分でエラーになります。</p>
<pre><code>void
rb_add_method_iseq(VALUE klass, ID mid, VALUE iseqval, rb_cref_t *cref, rb_method_visibility_t visi)
{
rb_iseq_t *iseq;
GetISeqPtr(iseqval, iseq);
{
rb_method_iseq_t iseq_body = {iseq, cref}; /* ←この行でエラーになる */
rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, &iseq_body, visi);
}
}
</code></pre>
<p>このコンパイラは、構造体の初期化を変数で行うのには対応していないようです。<br>
バージョンは以下のとおりです。<br>
(古過ぎる?しかし売り物なので、そう簡単にバージョンアップできない。)</p>
<pre><code>% fcc -v
fcc: Fujitsu C Compiler Driver Version 5.6 (Nov 24 2006 14:03:59)
usage: fcc [options] files
</code></pre>
<p>通常、ひとつずつ代入するように修正すれば問題ないのですが、この構造体のメンバは以下のように全部constになっているため、一筋縄ではいかなさそうでした。</p>
<pre><code>typedef struct rb_method_iseq_struct {
rb_iseq_t * const iseqptr; /* should be separated from iseqval */
rb_cref_t * const cref; /* shoudl be marked */
} rb_method_iseq_t;
</code></pre>
Ruby master - Bug #11095 (Closed): severe performance regression since r50336
https://redmine.ruby-lang.org/issues/11095
2015-04-24T11:18:23Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>sparc64-solaris2.10 にて、r50336 以降、<br>
Rubyビルド時の</p>
<pre><code>Generating RI format into /XXXXX/.ext/rdoc...
</code></pre>
<p>および、bootstraptest/test_eval.rb の306行目付近の</p>
<pre><code>assert_normal_exit %q{
hash = {}
("aaaa".."matz").each_with_index do |s, i|
hash[s] = i
end
begin
eval "class C; @@h = #{hash.inspect}; end"
end
}, '<a href="/issues/2133">[ruby-core:25714]</a>'
</code></pre>
<p>の2か所が、それぞれ極端に長時間かかるようになりました。<br>
合計10時間以上かかる場合も見られました。</p>
<p>r50336をrevertすると、それぞれ、せいぜい分単位程度のごく短時間で終了します。</p>
<p>r50336の変更により、str_buf_cat の際に以前行なっていた4096バイト単位でのメモリ確保を行わなくなり、<br>
常にぴったりのサイズでの realloc を毎回行うようになったため、<br>
後から文字列に別の文字列を複数回追加するような処理を行う際のパフォーマンスが、<br>
malloc(3C)の性能に完全に依存するようになり、環境によっては、<br>
パフォーマンスが極端に落ちたのだと思います。</p>
<p>取り急ぎは、r50336のrevertを希望します。<br>
どこまでをmallocに依存してどこまでをRuby独自でやるのがよいかは後で考えるとして。</p>
Ruby master - Bug #11000 (Closed): r50071以降、Solarisにてext/-test-/file/fs.cのコンパイルができない
https://redmine.ruby-lang.org/issues/11000
2015-03-25T05:37:15Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r50071 以降、Solaris10にて、<br>
ext/-test-/file/fs.c のコンパイルにエラーが発生してビルドが失敗します。</p>
<pre><code>cc -I. -I../../../.ext/include/sparc64-solaris2.10 -I../../.././include -I../../.././ext/-test-/file -I../../.. -I../../../. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -KPIC -xO4 -xtarget=sparc64viiplus -m64 -o fs.o -c fs.c
"fs.c", line 48: undefined struct/union member: f_type
cc: acomp failed for fs.c
make[2]: *** [fs.o] Error 2
make[2]: Leaving directory `/XXXXXXXXXX/ext/-test-/file'
make[1]: *** [ext/-test-/file/all] Error 2
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [build-ext] Error 2
</code></pre>
Ruby master - Bug #10926 (Closed): r49760以降Solarisで--enable-sharedのビルドでsample/test.rb失敗
https://redmine.ruby-lang.org/issues/10926
2015-03-02T15:55:30Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、./configure --enable-shared (他オプション多数略) にて共有ライブラリ版をビルドしようとすると、r49760以降、下記のエラーが出てsample/test.rbの実行に失敗して次のステップに進めなくなります。</p>
<pre><code>sample/test.rb:assignment ......................................................................................................................................................
................................................................................................................................................................................
..............................................OK 372
(中略)
sample/test.rb:eval .............................OK 29
sample/test.rb:system .ld.so.1: sh: fatal: /XXXXX-49760/libruby.so.2: wrong ELF class: ELFCLASS64
F.....ld.so.1: sh: fatal: /XXXXX-49760/libruby.so.2: wrong ELF class: ELFCLASS64
F/XXXXX-49760/sample/test.rb:2018:in `unlink': No such file or directory @ unlink_internal - script_tmp.23560.bak (Errno::ENOENT)
from /XXXXX-49760/sample/test.rb:2018:in `<main>'
not ok system 2 -- /XXXXX-49760/sample/test.rb:1971:in `<main>'
not ok system 8 -- /XXXXX-49760/sample/test.rb:2015:in `<main>'
test failed
make: *** [yes-test-sample] Error 1
</code></pre>
Ruby master - Bug #10915 (Closed): Error in FTPTest#test_abort and test_status on Solaris
https://redmine.ruby-lang.org/issues/10915
2015-02-27T15:39:47Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、make test-all で以下のエラーが出ます。<br>
(r49732にて確認)</p>
<pre><code> 1) Error:
FTPTest#test_abort:
Net::ReadTimeout: Net::ReadTimeout
/XXXXXXXXXX/lib/net/protocol.rb:158:in `rescue in rbuf_fill'
/XXXXXXXXXX/lib/net/protocol.rb:152:in `rbuf_fill'
/XXXXXXXXXX/lib/net/protocol.rb:134:in `readuntil'
/XXXXXXXXXX/lib/net/ftp.rb:1108:in `gets'
/XXXXXXXXXX/lib/net/ftp.rb:1113:in `readline'
/XXXXXXXXXX/lib/net/ftp.rb:290:in `getline'
/XXXXXXXXXX/lib/net/ftp.rb:301:in `getmultiline'
/XXXXXXXXXX/lib/net/ftp.rb:886:in `abort'
/XXXXXXXXXX/test/net/ftp/test_ftp.rb:726:in `test_abort'
2) Error:
FTPTest#test_status:
Net::ReadTimeout: Net::ReadTimeout
/XXXXXXXXXX/lib/net/protocol.rb:158:in `rescue in rbuf_fill'
/XXXXXXXXXX/lib/net/protocol.rb:152:in `rbuf_fill'
/XXXXXXXXXX/lib/net/protocol.rb:134:in `readuntil'
/XXXXXXXXXX/lib/net/ftp.rb:1108:in `gets'
/XXXXXXXXXX/lib/net/ftp.rb:1113:in `readline'
/XXXXXXXXXX/lib/net/ftp.rb:290:in `getline'
/XXXXXXXXXX/lib/net/ftp.rb:301:in `getmultiline'
/XXXXXXXXXX/lib/net/ftp.rb:319:in `getresp'
/XXXXXXXXXX/lib/net/ftp.rb:900:in `status'
/XXXXXXXXXX/test/net/ftp/test_ftp.rb:759:in `test_status'
</code></pre>
<p>net/ftp の abort と status は、以下のように MSG_OOB オプションを付けて、<br>
帯域外データとして送信しています。</p>
<pre><code> @sock.send(line, Socket::MSG_OOB)
</code></pre>
<p>これを test_ftp.rb 内の sock.recv(1024) にて受けています。<br>
Linux などでは、これで受信できているようですが、<br>
Solaris では、ioctl() SIOCATMARK 要求をする必要があるような感じです。<br>
しかし、この ioctl は Rubyレベルでは、少なくともポータブルには、出す方法がありません。</p>
<p>かわりに、OOBデータも通常データとみなして受信するソケット・オプション<br>
SO_OOBINLINE を受信側のソケット・オプションに指定すると、<br>
タイムアウトすることはなくなりましたが、以下のFailureが出ました。</p>
<pre><code> 2) Failure:
FTPTest#test_abort [/user3/gen-info/ngoto/testruby/daily/src/sparc64-cc12-trunk-49756/test/net/ftp/test_ftp.rb:727]:
<"ABOR\r"> expected but was
<"ABOR\r\n">.
3) Failure:
FTPTest#test_status [/user3/gen-info/ngoto/testruby/daily/src/sparc64-cc12-trunk-49756/test/net/ftp/test_ftp.rb:760]:
<"STAT\r"> expected but was
<"STAT\r\n">.
</code></pre>
<p>これは、受信側で BasicSocket#recv システムコールをそのまま使っているが、<br>
バッファリングはOSや環境に依存するのが原因と思われます。<br>
Linuxでは最後の"\n"だけ別の塊として受信しますが、Solarisでは全部を同時に受信するようです。</p>
<p>SO_OOBINLINE を指定したのだから、recv システムコールを直接使わなくても、gets を使えば十分と考えられます。</p>
<p>まとめると、以下のパッチにより、ErrorおよびFailureは出なくなりました。</p>
<pre><code>Index: test/net/ftp/test_ftp.rb
===================================================================
--- test/net/ftp/test_ftp.rb (revision 49774)
+++ test/net/ftp/test_ftp.rb (working copy)
@@ -711,7 +711,7 @@
sock.print("230 Login successful.\r\n")
commands.push(sock.gets)
sock.print("200 Switching to Binary mode.\r\n")
- commands.push(sock.recv(1024))
+ commands.push(sock.gets)
sock.print("225 No transfer to ABOR.\r\n")
}
begin
@@ -724,7 +724,7 @@
assert_match(/\APASS /, commands.shift)
assert_equal("TYPE I\r\n", commands.shift)
ftp.abort
- assert_equal("ABOR\r", commands.shift)
+ assert_equal("ABOR\r\n", commands.shift)
assert_equal(nil, commands.shift)
ensure
ftp.close if ftp
@@ -744,7 +744,7 @@
sock.print("230 Login successful.\r\n")
commands.push(sock.gets)
sock.print("200 Switching to Binary mode.\r\n")
- commands.push(sock.recv(1024))
+ commands.push(sock.gets)
sock.print("211 End of status\r\n")
}
begin
@@ -757,7 +757,7 @@
assert_match(/\APASS /, commands.shift)
assert_equal("TYPE I\r\n", commands.shift)
ftp.status
- assert_equal("STAT\r", commands.shift)
+ assert_equal("STAT\r\n", commands.shift)
assert_equal(nil, commands.shift)
ensure
ftp.close if ftp
@@ -856,6 +856,7 @@
end
sock = server.accept
begin
+ sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_OOBINLINE, 1)
yield(sock)
sock.shutdown(Socket::SHUT_WR)
sock.read unless sock.eof?
</code></pre>
<p>Solaris, Linux にて動作を確認しました。<br>
Windowsなどその他のOSでは未確認です。</p>
Ruby master - Bug #10808 (Closed): r49451以降 Solarisにてruby-glommed.oの作成に失敗
https://redmine.ruby-lang.org/issues/10808
2015-01-31T16:06:48Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r49451以降、以下のエラーが発生してビルドできません。<br>
dln.o がビルドされないため、ruby-glommed.o のビルドに失敗しています。</p>
<pre><code>cc -xO4 -xtarget=sparc64viiplus -m64 -L. -L/usr/local/64/lib -R/usr/local/64/lib main.o dmydln.o miniinit.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o encoding.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backtrace.o vm_trace.o thread.o cont.o probes.o enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o enc/trans/newline.o sparc.o flock.o isinf.o setproctitle.o addr2line.o dmyext.o dmyenc.o -lpthread -lrt -lgmp -lsocket -ldl -lcrypt -lm -o miniruby
./miniruby -I./lib -I. -I.ext/common ./tool/mkconfig.rb -timestamp=.rbconfig.time \
-install_name=ruby \
-so_name=ruby rbconfig.rb
rbconfig.rb updated
./miniruby -I./lib -I. -I.ext/common ./enc/make_encmake.rb --builtin-encs="enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o" --builtin-transes="enc/trans/newline.o" --module enc.mk
/usr/ccs/bin/ld -r -o ruby-glommed.o dln.o localeinit.o loadpath.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o encoding.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backtrace.o vm_trace.o thread.o cont.o probes.o enc/ascii.o enc/us_ascii.o enc/unicode.o enc/utf_8.o enc/trans/newline.o sparc.o flock.o isinf.o setproctitle.o addr2line.o prelude.o probes.o
ld: fatal: file dln.o: open failed: No such file or directory
make: *** [ruby-glommed.o] Error 1
</code></pre>
Ruby master - Bug #10646 (Closed): wmap_final_func の xrealloc で確保するメモリのサイズが1足りないためSEGV
https://redmine.ruby-lang.org/issues/10646
2014-12-25T08:27:59Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris にて、以下のようにメモリリークを発見するデバッグ用のmallocを使用すると、WeakRefのfinalize中にSEGVが発生します。<br>
(r48972 にて確認)</p>
<pre><code>$ LD_PRELOAD=libumem.so UMEM_OPTIONS="backend=mmap" /usr/bin/time /XXXXX/bin/ruby -r weakref -e 'a = Object.new; 150_000.times { WeakRef.new(a) }'
/XXXXX/lib/ruby/2.2.0/weakref.rb:87: [BUG] Segmentation fault at 0x7fffffff7806a000
ruby 2.2.0dev (2014-12-24) [sparc64-solaris2.10]
-- Control frame information -----------------------------------------------
c:0008 p:---- s:0022 e:000021 CFUNC :finalize
c:0007 p:---- s:0020 e:000019 CFUNC :call
c:0006 p:0039 s:0018 e:000017 METHOD /XXXXX/lib/ruby/2.2.0/weakref.rb:87 [FINISH]
c:0005 p:---- s:0014 e:000013 CFUNC :new
c:0004 p:0015 s:0010 e:000009 BLOCK -e:1 [FINISH]
c:0003 p:---- s:0008 e:000007 CFUNC :times
c:0002 p:0017 s:0005 E:001398 EVAL -e:1 [FINISH]
c:0001 p:0000 s:0002 E:000e50 TOP [FINISH]
-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `times'
-e:1:in `block in <main>'
-e:1:in `new'
/XXXXX/lib/ruby/2.2.0/weakref.rb:87:in `initialize'
/XXXXX/lib/ruby/2.2.0/weakref.rb:87:in `call'
/XXXXX/lib/ruby/2.2.0/weakref.rb:87:in `finalize'
-- Other runtime information -----------------------------------------------
* Loaded script: -e
* Loaded features:
0 enumerator.so
1 rational.so
2 complex.so
3 /XXXXX/lib/ruby/2.2.0/sparc64-solaris2.10/enc/encdb.so
4 /XXXXX/lib/ruby/2.2.0/sparc64-solaris2.10/enc/trans/transdb.so
5 /XXXXX/lib/ruby/2.2.0/unicode_normalize.rb
6 /XXXXX/lib/ruby/2.2.0/sparc64-solaris2.10/rbconfig.rb
7 thread.rb
8 /XXXXX/lib/ruby/2.2.0/sparc64-solaris2.10/thread.so
9 /XXXXX/lib/ruby/2.2.0/rubygems/compatibility.rb
10 /XXXXX/lib/ruby/2.2.0/rubygems/defaults.rb
11 /XXXXX/lib/ruby/2.2.0/rubygems/deprecate.rb
12 /XXXXX/lib/ruby/2.2.0/rubygems/errors.rb
13 /XXXXX/lib/ruby/2.2.0/rubygems/version.rb
14 /XXXXX/lib/ruby/2.2.0/rubygems/requirement.rb
15 /XXXXX/lib/ruby/2.2.0/rubygems/platform.rb
16 /XXXXX/lib/ruby/2.2.0/rubygems/basic_specification.rb
17 /XXXXX/lib/ruby/2.2.0/rubygems/stub_specification.rb
18 /XXXXX/lib/ruby/2.2.0/rubygems/util/stringio.rb
19 /XXXXX/lib/ruby/2.2.0/rubygems/specification.rb
20 /XXXXX/lib/ruby/2.2.0/rubygems/exceptions.rb
21 /XXXXX/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
22 /XXXXX/lib/ruby/2.2.0/monitor.rb
23 /XXXXX/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb
24 /XXXXX/lib/ruby/2.2.0/rubygems.rb
25 /XXXXX/lib/ruby/2.2.0/delegate.rb
26 /XXXXX/lib/ruby/2.2.0/weakref.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
time: command terminated abnormally.
real 33.2
user 21.3
sys 11.5
$
</code></pre>
<p>デバッガ上にて起動すると発生位置を特定できました。<br>
配列の範囲外にアクセスしていました。</p>
<pre><code>$ dbx /XXXXX/bin/ruby
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc
Reading ruby
Reading ld.so.1
Reading libumem.so.1
Reading libpthread.so.1
Reading librt.so.1
Reading libgmp.so.10.1.3
Reading libsocket.so.1
Reading libdl.so.1
Reading libcrypt_d.so.1
Reading libm.so.2
Reading libc.so.1
Reading libaio.so.1
Reading libmd.so.1
Reading libnsl.so.1
Reading libgen.so.1
(dbx) run -r weakref -e 'a = Object.new; 150_000.times { WeakRef.new(a) }'
Running: ruby -r weakref -e "a = Object.new; 150_000.times { WeakRef.new(a) }"
(process id 6241)
Reading libc_psr.so.1
Reading encdb.so
Reading transdb.so
Reading thread.so
t@1 (l@1) signal SEGV (access to address exceeded protections) in wmap_final_func at line 7666 in file "gc.c"
7666 if (ptr[i] != wmap) {
(dbx) print i
i = 103422U
(dbx) print j
j = 103421U
(dbx) print wmap
wmap = 9223372034650698920U
(dbx) print ptr
ptr = 0x7fffffff77200010
(dbx) print ptr[0]
ptr[0] = 103422U
(dbx) print ptr[i]
dbx: cannot access address 0x7fffffff772ca000
(dbx) print ptr[j]
ptr[j] = 9223372034650719480U
(dbx) print ptr[103422]
dbx: cannot access address 0x7fffffff772ca000
(dbx) print ptr[103421]
ptr[103421] = 9223372034650719480U
</code></pre>
<p>ptr[0]がその配列ptrの要素数を格納する場所ですが、この数字はptr[0]の場所を考慮しない要素数、つまりptr[1]からptr[ptr[0]]までアクセスされる可能性があります。<br>
このため、ptr[0]の数+1のメモリを確保する必要がありますが、wmap_final_func() 内の ruby_sized_xrealloc2() での確保時に +1 が忘れ去られていました。</p>
<p>以下のパッチでSEGVは出なくなりました。</p>
<pre><code>Index: gc.c
===================================================================
--- gc.c (revision 48988)
+++ gc.c (working copy)
@@ -7672,7 +7672,7 @@
return ST_DELETE;
}
if (j < i) {
- ptr = ruby_sized_xrealloc2(ptr, j, sizeof(VALUE), i);
+ ptr = ruby_sized_xrealloc2(ptr, j + 1, sizeof(VALUE), i);
ptr[0] = j;
*value = (st_data_t)ptr;
}
</code></pre>
<p>今回、たまたまSolarisにて露見しましたが、本来はOSやCPUとは無関係のバグです。</p>
Ruby master - Bug #10384 (Closed): Fiddle::DLError: unknown symbol "Init_objspace" during Fiddle:...
https://redmine.ruby-lang.org/issues/10384
2014-10-14T13:14:55Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solarisにて、make test-all中に以下のエラーが発生することが多くなっています。<br>
(出ないこともたまにあります。)</p>
<pre><code> 2) Error:
DL::TestHandle#test_static_sym:
DL::DLError: unknown symbol "Init_objspace"
/XXXXX/test/dl/test_handle.rb:34:in `sym'
/XXXXX/test/dl/test_handle.rb:34:in `rescue in test_static_sym'
/XXXXX/test/dl/test_handle.rb:27:in `test_static_sym'
4) Error:
Fiddle::TestHandle#test_NEXT:
Fiddle::DLError: unknown symbol "Init_objspace"
/XXXXX/test/fiddle/test_handle.rb:171:in `[]'
/XXXXX/test/fiddle/test_handle.rb:171:in `rescue in test_NEXT'
/XXXXX/test/fiddle/test_handle.rb:144:in `test_NEXT'
5) Error:
Fiddle::TestHandle#test_static_sym:
Fiddle::DLError: unknown symbol "Init_objspace"
/XXXXX/test/fiddle/test_handle.rb:41:in `sym'
/XXXXX/test/fiddle/test_handle.rb:41:in `rescue in test_static_sym'
/XXXXX/test/fiddle/test_handle.rb:34:in `test_static_sym'
</code></pre>
<p>Fiddle::Handle.sym および Fiddle::Handle.[] (DL::Handle.sym なども同様)は内部で RTLD_NEXT を使用しています。<br>
Solarisのman dlsym(3C) より引用します。</p>
<p><a href="http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html" class="external">http://docs.oracle.com/cd/E23823_01/html/816-5168/dlsym-3c.html</a></p>
<pre><code> RTLD_NEXT Instructs dlsym() to search for the named
symbol in the objects that were loaded fol-
lowing the object from which the dlsym()
call is being made.
</code></pre>
<p>Solarisのdlsymでは、handleに RTLD_NEXT を指定した場合は、そのコードが読み込まれた後に読み込んだシンボルしか検索しません。<br>
このため、require "objspace" による objspace.so の読み込みが require "fiddle" より前に発生していた場合はエラーになります。</p>
<p>(requireの順番によりエラーが出る・出ないの再現コード)</p>
<pre><code> % ruby -e 'require "objspace"; require "fiddle"; p Fiddle::Handle.sym("Init_objspace")'
-e:1:in `sym': unknown symbol "Init_objspace" (Fiddle::DLError)
from -e:1:in `<main>'
% ruby -e 'require "fiddle"; require "objspace"; p Fiddle::Handle.sym("Init_objspace")'
9223372034655938496
</code></pre>
<p>単純にgrepすると、require "objspace" は以下で行われています。</p>
<p>test/dl/test_handle.rb: require 'objspace'<br>
test/fiddle/test_closure.rb: require 'objspace'<br>
test/fiddle/test_handle.rb: require 'objspace'<br>
test/lib/profile_test_all.rb:require 'objspace'<br>
test/objspace/test_objspace.rb:require "objspace"<br>
test/ruby/test_file_exhaustive.rb: require "objspace"</p>
<p>これらのテストの実行順番に依存して(ファイルシステムのディレクトリエントリの順番の偶然などのタイミングによって?)、エラーが出たり出なかったりするようです。</p>
Ruby master - Bug #10350 (Closed): compile error in bignum.c line 3297 with old fcc on Solaris
https://redmine.ruby-lang.org/issues/10350
2014-10-09T14:28:08Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris上の古い fcc (Fujitsu C compiler) 5.6 にて、以下のコンパイルエラーが発生します。</p>
<pre><code>"bignum.c", line 3297: error: initialization: constant expression is expected for variable: `nlz_bits_in_msbyte_bary'
</code></pre>
<p>以下のように変数の宣言と初期化を別々にしたらエラーなくビルドできました。</p>
<pre><code>Index: bignum.c
===================================================================
--- bignum.c (revision 47859)
+++ bignum.c (working copy)
@@ -3294,7 +3294,7 @@
static const BDIGIT char_bit[1] = { CHAR_BIT };
BDIGIT numbytes_bary[bdigit_roomof(sizeof(numbytes))];
BDIGIT val_numbits_bary[bdigit_roomof(sizeof(numbytes) + 1)];
- BDIGIT nlz_bits_in_msbyte_bary[1] = { nlz_bits_in_msbyte };
+ BDIGIT nlz_bits_in_msbyte_bary[1];
BDIGIT word_numbits_bary[bdigit_roomof(sizeof(word_numbits))];
BDIGIT div_bary[numberof(val_numbits_bary) + BIGDIVREM_EXTRA_WORDS];
BDIGIT mod_bary[numberof(word_numbits_bary)];
@@ -3304,6 +3304,8 @@
int sign;
size_t numwords;
+ nlz_bits_in_msbyte_bary[0] = nlz_bits_in_msbyte;
+
/*
* val_numbits = numbytes * CHAR_BIT - nlz_bits_in_msbyte
* div, mod = val_numbits.divmod(word_numbits)
</code></pre>
Ruby master - Bug #10089 (Closed): build failure since r46924
https://redmine.ruby-lang.org/issues/10089
2014-07-24T11:48:20Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r46924 以降、ビルドに失敗しています。</p>
<p><a href="http://chkbuild002.hsbt.org/chkbuild/ruby-trunk/log/20140724T020014Z.fail.html.gz" class="external">http://chkbuild002.hsbt.org/chkbuild/ruby-trunk/log/20140724T020014Z.fail.html.gz</a></p>
<p>Travis-CI のログ: <a href="http://travis-ci.org/ruby/ruby/builds/30708589" class="external">http://travis-ci.org/ruby/ruby/builds/30708589</a></p>
Ruby master - Bug #10088 (Closed): Bus Error on Sparc Solaris since r46884
https://redmine.ruby-lang.org/issues/10088
2014-07-24T06:58:12Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Since r46884, bus error occurred on Sparc64.</p>
<p>PACKED_STRUCT_UNALIGNED generally should always be used, and PACKED_STRUCT generally should never be used unless it is really needed.</p>
<p>I think existence of both PACKED_STRUCT and PACKED_STRUCT_UNALIGNED is confusable and can always be a potential source of bugs.</p>
<pre><code>dtrace -G -C -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -s ./probes.d -o probes.o array.o eval.o gc.o hash.o load.o object.o parse.o string.o symbol.o vm.o
cc -g3 -xO1 -xtarget=sparc64viiplus -m64 -L. -L/usr/local/64/lib -R/usr/local/64/lib main.o dmydln.o miniinit.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o encoding.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o symbol.o time.o transcode.o util.o variable.o version.o compile.o debug.o iseq.o vm.o vm_dump.o vm_backtrace.o vm_trace.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o sparc.o flock.o isinf.o setproctitle.o addr2line.o dmyext.o probes.o -lpthread -lrt -lgmp -lsocket -l
dl -lcrypt -lm -o miniruby
./miniruby -I./lib -I. -I.ext/common ./tool/mkconfig.rb -timestamp=.rbconfig.time \
-install_name=ruby \
-so_name=ruby rbconfig.rb
make: *** [.rbconfig.time] Bus Error
</code></pre>
Ruby master - Bug #10037 (Closed): Since r46798 on Solaris, "[BUG] rb_vm_get_cref: unreachable" d...
https://redmine.ruby-lang.org/issues/10037
2014-07-15T05:30:07Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Since r46798, failed to build on Solaris 10 running on SPARC64.</p>
<pre><code>(snip)
converter from WINDOWS-874 to UTF-8
converter from UTF-8 to WINDOWS-874
enc/trans/single_byte.trans:22: [BUG] rb_vm_get_cref: unreachable
ruby 2.2.0dev (2014-07-13) [sparc64-solaris2.10]
-- Control frame information -----------------------------------------------
c:0008 p:---- s:0056 e:000053 TOP [FINISH]
c:0007 p:---- s:0052 e:000051 CFUNC :require
c:0006 p:0015 s:0048 e:000047 METHOD enc/trans/single_byte.trans:22
c:0005 p:0244 s:0041 E:0011d8 EVAL enc/trans/single_byte.trans:48 [FINISH]
c:0004 p:---- s:0037 e:000036 CFUNC :eval
c:0003 p:0045 s:0030 e:000029 METHOD /XXXXXXXXXX/lib/erb.rb:850
c:0002 p:1228 s:0026 E:000cf8 EVAL ./tool/transcode-tblgen.rb:1043 [FINISH]
c:0001 p:0000 s:0002 E:001d68 TOP [FINISH]
-- Ruby level backtrace information ----------------------------------------
./tool/transcode-tblgen.rb:1043:in `<main>'
/XXXXXXXXXX/lib/erb.rb:850:in `result'
/XXXXXXXXXX/lib/erb.rb:850:in `eval'
enc/trans/single_byte.trans:48:in `<main>'
enc/trans/single_byte.trans:22:in `transcode_tblgen_singlebyte'
enc/trans/single_byte.trans:22:in `require'
/XXXXXXXXXX/enc/trans/windows-1250-tbl.rb:1:in `<top (required)>'
-- Other runtime information -----------------------------------------------
* Loaded script: ./tool/transcode-tblgen.rb
* Loaded features:
0 enumerator.so
1 /XXXXXXXXXX/lib/optparse.rb
2 /XXXXXXXXXX/lib/cgi/util.rb
3 /XXXXXXXXXX/lib/erb.rb
4 /XXXXXXXXXX/lib/fileutils.rb
5 /XXXXXXXXXX/lib/prettyprint.rb
6 /XXXXXXXXXX/lib/pp.rb
7 /XXXXXXXXXX/enc/trans/iso-8859-1-tbl.rb
8 /XXXXXXXXXX/enc/trans/iso-8859-2-tbl.rb
9 /XXXXXXXXXX/enc/trans/iso-8859-3-tbl.rb
10 /XXXXXXXXXX/enc/trans/iso-8859-4-tbl.rb
11 /XXXXXXXXXX/enc/trans/iso-8859-5-tbl.rb
12 /XXXXXXXXXX/enc/trans/iso-8859-6-tbl.rb
13 /XXXXXXXXXX/enc/trans/iso-8859-7-tbl.rb
14 /XXXXXXXXXX/enc/trans/iso-8859-8-tbl.rb
15 /XXXXXXXXXX/enc/trans/iso-8859-9-tbl.rb
16 /XXXXXXXXXX/enc/trans/iso-8859-10-tbl.rb
17 /XXXXXXXXXX/enc/trans/iso-8859-11-tbl.rb
18 /XXXXXXXXXX/enc/trans/iso-8859-13-tbl.rb
19 /XXXXXXXXXX/enc/trans/iso-8859-14-tbl.rb
20 /XXXXXXXXXX/enc/trans/iso-8859-15-tbl.rb
21 /XXXXXXXXXX/enc/trans/iso-8859-16-tbl.rb
22 /XXXXXXXXXX/enc/trans/windows-874-tbl.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Abort
make[1]: *** [enc/trans/single_byte.c] Error 134
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [srcs-enc] Error 2
</code></pre>
<p>The following patch fixed the problem (tested with r46821), but this completely breaks the benefit of r46798.</p>
<pre><code>Index: vm_core.h
===================================================================
--- vm_core.h (revision 46821)
+++ vm_core.h (working copy)
@@ -205,6 +205,7 @@
ISEQ_TYPE_MAIN,
ISEQ_TYPE_DEFINED_GUARD
} type; /* instruction sequence type */
+ uint32_t dummy;
uint32_t stack_max; /* for stack overflow check */
rb_iseq_location_t location;
</code></pre>
<p>I think it is possbile that the first 8 byte (in 64-bit architecture) of "struct rb_iseq_struct" is sometimes used for some other purposes (maybe VALUE ?), and on big-endian 64-bit architecture (including SPARC64), it is frequently misunderstood as the other type.</p>
<p>By the way, I think "int stack_max" is better than "uint32_t stack_max" because it seems that all calculations of stack_max in compile.c(iseq_set_sequence) and vm_insnhelper.c(vm_push_frame) are conducted using int.</p>
Ruby master - Bug #10020 (Closed): TestEnv#test_memory_leak_*, Fiddle::TestPointer#test_no_memory...
https://redmine.ruby-lang.org/issues/10020
2014-07-09T15:16:29Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、以下のように memory leak 検出テストの Failure が出ます。(r46762 で確認)</p>
<p>Solarisデフォルトのlibcのmallocでは、freeしてもOSにメモリを返さないのが原因と考えています。</p>
<p>メモリ関係デバッグ用のライブラリ libumem を使い、UMEM_OPTIONS=backend=mmap を指定すると、freeしたら直ちにOSにメモリを返すようになるようです。<br>
dynamic link な実行プログラムなら、LD_PRELOAD=libumem.so UMEM_OPTIONS=backend=mmap をセットしてコマンドを実行ということになります。</p>
<p>test/ruby/envutil.rb の assert_no_memory_leak 内で invoke_ruby する際にこれらの環境変数をセットできればいいのですが、以下4点が課題と思います。</p>
<ul>
<li>特定のOSに特異的な変更をどう入れるか?</li>
<li>これらの環境変数が元からセットされていた時の挙動</li>
<li>static link のrubyの場合</li>
<li>tcmalloc など、別の malloc をリンク指定されていた場合にどうなる?</li>
</ul>
<p>References:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/346352/meaning-of-size-and-rss-values-in-prstat-output" class="external">http://stackoverflow.com/questions/346352/meaning-of-size-and-rss-values-in-prstat-output</a></li>
<li><a href="http://docs.oracle.com/cd/E23824_01/html/821-1465/umem-free-3malloc.html" class="external">http://docs.oracle.com/cd/E23824_01/html/821-1465/umem-free-3malloc.html</a></li>
</ul>
<pre><code> 51) Failure:
TestEnv#test_memory_leak_shift [/XXXXX/test/ruby/test_env.rb:543]:
<a href="/issues/9983">[ruby-dev:48332]</a> [Bug #9983].
size: 38502400 => 155942912.
Expected 4.050212765957447 to be < 2.0.
52) Failure:
TestEnv#test_memory_leak_aset [/XXXXX/test/ruby/test_env.rb:514]:
<a href="/issues/9977">[ruby-dev:48323]</a> [Bug #9977].
size: 21725184 => 97222656.
Expected 4.475113122171946 to be < 2.0.
53) Failure:
Fiddle::TestPointer#test_no_memory_leak [/XXXXX/test/fiddle/test_pointer.rb:235]:
rss: 8568832 => 12984320.
Expected 1.5152963671128108 to be < 1.5.
55) Failure:
Test_StringModifyExpand#test_modify_expand_memory_leak [/XXXXX/test/-ext-/string/test_modify_expand.rb:7]:
rb_str_modify_expand().
size: 13303808 => 30179328.
Expected 2.268472906403941 to be < 1.5.
</code></pre>
Ruby master - Bug #10010 (Closed): Error in TestEnv#test_memory_leak_* on Solaris
https://redmine.ruby-lang.org/issues/10010
2014-07-06T10:55:22Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r46550 くらい以降、Solaris 10 にて make test-all 中、以下のエラーが発生します。<br>
(r44686 にて確認)</p>
<p>test/envutil.rb の 438行目にて、:size や :rss 用の情報が、OS側の何らかの理由で示されず、その結果ハッシュにも格納されず、 a または b が nil になることがあるのに、それに対応していないのが原因と思います。</p>
<p>なお、Solaris では、/proc/self/status は struct pstatus_t の内容のバイナリを返しますが、それには全く対応していないので、nil になるか、偶然バイナリ値が何かに一致した場合にでたらめな値が返されるかのいずれかになります。</p>
<pre><code> 53) Error:
TestEnv#test_memory_leak_shift:
NoMethodError: undefined method `>' for nil:NilClass
/XXXXX/test/ruby/envutil.rb:438:in `block in assert_no_memory_leak'
/XXXXX/test/ruby/envutil.rb:435:in `each'
/XXXXX/test/ruby/envutil.rb:435:in `assert_no_memory_leak'
/XXXXX/test/ruby/test_env.rb:543:in `test_memory_leak_shift'
54) Error:
TestEnv#test_memory_leak_select:
NoMethodError: undefined method `>' for nil:NilClass
/XXXXX/test/ruby/envutil.rb:438:in `block in assert_no_memory_leak'
/XXXXX/test/ruby/envutil.rb:435:in `each'
/XXXXX/test/ruby/envutil.rb:435:in `assert_no_memory_leak'
/XXXXX/test/ruby/test_env.rb:525:in `test_memory_leak_select'
55) Error:
TestEnv#test_memory_leak_aset:
NoMethodError: undefined method `>' for nil:NilClass
/XXXXX/test/ruby/envutil.rb:438:in `block in assert_no_memory_leak'
/XXXXX/test/ruby/envutil.rb:435:in `each'
/XXXXX/test/ruby/envutil.rb:435:in `assert_no_memory_leak'
/XXXXX/test/ruby/test_env.rb:514:in `test_memory_leak_aset'
</code></pre>
Ruby master - Bug #10004 (Closed): lack of "http 80/tcp" in /etc/inet/services in Solaris 10 caus...
https://redmine.ruby-lang.org/issues/10004
2014-07-02T13:20:37Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris 10, because of the lack of "http" in the default /etc/inet/services, the following error occurs during make test-all.</p>
<pre><code> 52) Error:
TestGemCommandsServerCommand#test_handle_options_port:
OptionParser::InvalidArgument: invalid argument: -p http: no such named service
/XXXXX/lib/rubygems/commands/server_command.rb:21:in `rescue in block in initialize'
/XXXXX/lib/rubygems/commands/server_command.rb:18:in `block in initialize'
/XXXXX/lib/rubygems/command.rb:375:in `handle_options'
/XXXXX/test/rubygems/test_gem_commands_server_command.rb:40:in `test_handle_options_port'
</code></pre>
<p>The file /etc/inet/services in Illumos (OpenIndiana) was already updated in 2011. (<a href="https://www.illumos.org/issues/2690" class="external">https://www.illumos.org/issues/2690</a> )<br>
I don't know in Solaris 11 because I don't have Solaris 11.</p>
Ruby master - Bug #9789 (Closed): Error in TestIO#test_seek_symwhence and TestIO#test_seek on sys...
https://redmine.ruby-lang.org/issues/9789
2014-04-30T16:26:16Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>File::Statfs#type が無い(NotImplementedErrorになる)環境にて、<br>
TestIO#test_seek_symwhence と TestIO#test_seek がエラーになります。<br>
Solaris 10 (64ビット)、r45760 (+ Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: TestFile#test_statfs = Bad System Call on Solaris (Closed)" href="https://redmine.ruby-lang.org/issues/9788">#9788</a> のパッチ)にて確認しました。</p>
<pre><code> 52) Error:
TestIO#test_seek_symwhence:
NotImplementedError: type() function is unimplemented on this machine
/XXXXXXXXXX/test/ruby/test_io.rb:1768:in `type'
/XXXXXXXXXX/test/ruby/test_io.rb:1768:in `block (2 levels) in test_seek_symwhence'
/XXXXXXXXXX/lib/open-uri.rb:36:in `open'
/XXXXXXXXXX/lib/open-uri.rb:36:in `open'
/XXXXXXXXXX/test/ruby/test_io.rb:1765:in `block in test_seek_symwhence'
/XXXXXXXXXX/test/ruby/test_io.rb:1432:in `make_tempfile'
/XXXXXXXXXX/test/ruby/test_io.rb:1747:in `test_seek_symwhence'
53) Error:
TestIO#test_seek:
NotImplementedError: type() function is unimplemented on this machine
/XXXXXXXXXX/test/ruby/test_io.rb:1718:in `type'
/XXXXXXXXXX/test/ruby/test_io.rb:1718:in `block (2 levels) in test_seek'
/XXXXXXXXXX/lib/open-uri.rb:36:in `open'
/XXXXXXXXXX/lib/open-uri.rb:36:in `open'
/XXXXXXXXXX/test/ruby/test_io.rb:1715:in `block in test_seek'
/XXXXXXXXXX/test/ruby/test_io.rb:1432:in `make_tempfile'
/XXXXXXXXXX/test/ruby/test_io.rb:1692:in `test_seek'
</code></pre>
Ruby master - Bug #9788 (Closed): TestFile#test_statfs = Bad System Call on Solaris
https://redmine.ruby-lang.org/issues/9788
2014-04-30T14:02:22Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solaris 10 にて、make test-all が以下のエラーで中断します。(r45759 で確認。)</p>
<pre><code> TestFile#test_statfs = Bad System Call
make: *** [yes-test-all] Error 140
</code></pre>
<p>以下のように、statfsメソッド内にて呼んでいるfstatfsシステムコールがSIGSYSを発生させているようです。</p>
<pre><code> % truss ruby -e 'f = open("/bin/ls"); p f.statfs'
(前略)
/1: open("/bin/ls", O_RDONLY) = 7
/1: fcntl(7, F_GETFD, 0x000001B6) = 0
/1: fcntl(7, F_SETFD, 0x00000001) = 0
/1: ioctl(7, TCGETA, 0xFFFFFFFF7FFFC91C) Err#25 ENOTTY
/1: fstatfs() Err#89 ENOSYS
/1: Received signal #12, SIGSYS [default]
</code></pre>
<p>configureの関連する出力を抜き出すと以下になります。</p>
<pre><code> checking for struct statfs... no
checking for struct statvfs... yes
checking for struct statvfs.f_fstypename... no
(略)
checking for fstatfs... yes
checking for fstatvfs... yes
</code></pre>
<p>関連するコンパイル時のwarningを以下に示します。</p>
<pre><code> cc -xO1 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o file.o -c file.c
"file.c", line 1157: warning: implicit function declaration: fstatfs
</code></pre>
<p>Solaris 10 では、fstatfs(2) は存在しますが、/usr/include/sys/statfs.h をincludeしないと定義が読み込まれません。また、/usr/include/sys/statfs.h 内には</p>
<blockquote>
<p>/*</p>
<ul>
<li>Structure returned by statfs(2) and fstatfs(2).</li>
<li>This structure and associated system calls have been replaced</li>
<li>by statvfs(2) and fstatvfs(2) and will be removed from the system</li>
<li>in a near-future release.<br>
*/</li>
</ul>
</blockquote>
<p>という記述があり、現在のSolaris10では、削除はされていないものの、呼んでもSIGSYSかENOSYSを返してまともに動作しないようです。(または、未確認ですが、UFSなど昔からあるファイルシステムでのみ有効なのかもしれない?)</p>
<p>そして、現在の file.c では #if defined(HAVE_FSTATFS) の場合には必ず fstatfs() を呼ぶため、上記のエラーが発生したようです。</p>
<p>幸い、struct statfs は(sys/statfs.h を明示的にincludeしない限り)定義されないため、以下のように、fstatfs と同時に struct statfs の有無をチェックするようにしたら、エラーで make test-all が中断されることはなくなりました。ついでに、struct statvfs の有無もチェックするようにしています。</p>
<pre><code> --- file.c (revision 45760)
+++ file.c (working copy)
@@ -92,9 +92,9 @@
#endif
#ifndef WITHOUT_STATFS
static VALUE rb_statfs_new(const statfs_t *st);
-#if defined(HAVE_FSTATFS)
+#if defined(HAVE_FSTATFS) && defined(HAVE_STRUCT_STATFS)
#define FSTATFS(f, s) fstatfs((f), (s))
-#elif defined(HAVE_FSTATVFS)
+#elif defined(HAVE_FSTATVFS) && defined(HAVE_STRUCT_STATVFS)
#define FSTATFS(f, s) fstatvfs((f), (s))
#endif
#endif
</code></pre>
Ruby master - Bug #9752 (Closed): r45598 causes Errno::EINVAL on Solaris
https://redmine.ruby-lang.org/issues/9752
2014-04-17T09:16:32Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris, after r45598, the following error occurs.</p>
<pre>
./miniruby: Invalid argument - getcwd (Errno::EINVAL)
</pre>
<p>It seems that getcwd(NULL, 0) is not supported in Solaris.<br>
The Solaris man page of getcwd(3c) says:</p>
<pre>
If buf is a null pointer, getcwd() obtains size bytes of
space using malloc(3C). The pointer returned by getcwd() can
be used as the argument in a subsequent call to free().
</pre>
<p>But no description when the size is zero.</p>
Ruby master - Bug #9702 (Closed): r45488以降、SolarisStudioで ext/readline がコンパイルエラー(readline 6.2使用)
https://redmine.ruby-lang.org/issues/9702
2014-04-04T14:21:36Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r45488以降、Solarisにて、<code>ext/readline</code> が下記のようにコンパイルエラーになります。コンパイラは SolarisStudio 12.3 です。<br>
readline 6.2 との組み合わせになります。</p>
<pre><code>(前略)
cd ext/readline && exec make -w V=1 all
make[2]: Entering directory `/XXXXXXXXXX/ext/readline'
cc -I. -I../../.ext/include/sparc64-solaris2.10 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -KPIC -xO1 -xtarget=sparc64viiplus -m64 -o readline.o -c readline.c
"/usr/local/64/include/readline/rltypedefs.h", line 61: identifier redeclared: Function
current : function(void) returning int
previous: function() returning int : "/usr/local/64/include/readline/rltypedefs.h", line 34
cc: acomp failed for readline.c
make[2]: *** [readline.o] Error 2
make[2]: Leaving directory `/XXXXXXXXXX/ext/readline'
make[1]: *** [ext/readline/all] Error 2
make[1]: Leaving directory `/XXXXXXXXXX'
make: *** [build-ext] Error 2
</code></pre>
<p><code>ext/readline/extconf.rb</code> の <code>readline.have_type("rl_hook_func_t")</code> に、 <code>rl_hook_func_t</code> は存在するはずにもかかわらず、失敗しているのが原因のようです。</p>
<p><code>extconf.h</code> と <code>mkmf.log</code> を添付します。</p>
Ruby master - Bug #9698 (Closed): r45509以降、Solarisにて configureが thread model is missing でエラー
https://redmine.ruby-lang.org/issues/9698
2014-04-03T16:04:12Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r45509以降、Solarisにて configureが thread model is missing でエラーになります。</p>
<p>$ autoconf --version<br>
autoconf (GNU Autoconf) 2.68<br>
$ autoconf<br>
$ ./configure --prefix=/XXXXXXXXXX --build=sparc64-sun-solaris2.10 --with-tclConfig-dir=/usr/local/64/lib --with-tkConfig-dir=/usr/local/64/lib<br>
(中略)<br>
checking whether dtrace needs post processing... yes<br>
checking for prefix of external symbols... NONE<br>
configure: error: thread model is missing</p>
<p>r45509で追加されたbreakにより、シェルスクリプト内の制御が予期せぬ所に飛んでしまい、一部の処理がスキップされたか余計な処理を行なってしまったのかもしれません。</p>
<p>以下のファイルを添付します。<br>
45508.log : r45508でのconfigureの画面出力<br>
45509.log : r45509でのconfigureの画面出力<br>
config.log.r45508: r45508におけるconfig.log<br>
config.log.r45509: r45509におけるconfig.log<br>
configure.r45508 : r45508にて作成されたconfigure<br>
configure.r45509 : r45509にて作成されたconfigure</p>
Ruby master - Bug #9571 (Closed): "Error: TestFileUtils#test_rmdir: Errno::EEXIST: File exists @ ...
https://redmine.ruby-lang.org/issues/9571
2014-02-26T11:33:40Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solarisにて、いつからかは忘れましたが、make test-all にて以下のErrorが生じています。</p>
<pre><code>52) Error:
TestFileUtils#test_rmdir:
Errno::EEXIST: File exists @ dir_s_rmdir - data
/XXXXX/lib/fileutils.rb:277:in `rmdir'
/XXXXX/lib/fileutils.rb:277:in `block in rmdir'
/XXXXX/lib/fileutils.rb:271:in `each'
/XXXXX/lib/fileutils.rb:271:in `rmdir'
/XXXXX/test/fileutils/test_fileutils.rb:1380:in `block in test_rmdir'
/XXXXX/lib/test/unit/assertions.rb:166:in `assert_nothing_raised'
/XXXXX/test/fileutils/test_fileutils.rb:1379:in `test_rmdir'
</code></pre>
<p>Solaris では、中身が残っているディレクトリをrmdirしようとしたとき、errno に EEXIST をセットします。<br>
<a href="http://docs.oracle.com/cd/E23824_01/html/821-1463/rmdir-2.html" class="external">http://docs.oracle.com/cd/E23824_01/html/821-1463/rmdir-2.html</a></p>
<pre><code>$ irb
irb(main):001:0> Dir.mkdir('aaa')
=> 0
irb(main):002:0> Dir.mkdir('aaa/bbb')
=> 0
irb(main):003:0> Dir.rmdir('aaa')
Errno::EEXIST: File exists - aaa
from (irb):3:in `rmdir'
from (irb):3
from /usr/local/64/bin/irb:12:in `<main>'
irb(main):004:0>
</code></pre>
<p>SunOS 4 では ENOTEMPTY を使用していたが Solaris では EEXIST に変更になったとの記述も見つけました。<br>
<a href="http://docs.oracle.com/cd/E19455-01/806-2724/6jbu1b2ck/index.html" class="external">http://docs.oracle.com/cd/E19455-01/806-2724/6jbu1b2ck/index.html</a></p>
<p>しかし、fileutils.rbのrmdirは、これに対応していないため、エラーになるようです。</p>
Ruby master - Bug #9558 (Closed): Bus Error on Sparc in r45155 due to __attribute__((packed))
https://redmine.ruby-lang.org/issues/9558
2014-02-24T10:26:16Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Since r45155, the following error occurs on Sparc Solaris.</p>
<p>$ ./ruby --disable-gems -e 'p Time.now.utc'<br>
-e:1: [BUG] Bus Error at 0xffffffff7fffe775<br>
ruby 2.2.0dev (2014-02-23) [sparc64-solaris2.10]</p>
<p>-- Control frame information -----------------------------------------------<br>
c:0003 p:---- s:0008 e:000007 CFUNC :utc<br>
c:0002 p:0014 s:0005 E:001fb8 EVAL -e:1 [FINISH]<br>
c:0001 p:0000 s:0002 E:0006e8 TOP [FINISH]</p>
<p>-- Ruby level backtrace information ----------------------------------------<br>
-e:1:in <code><main>' -e:1:in </code>utc'</p>
<p>-- Other runtime information -----------------------------------------------</p>
<ul>
<li>
<p>Loaded script: -e</p>
</li>
<li>
<p>Loaded features:</p>
<p>0 enumerator.so</p>
</li>
</ul>
<p>[NOTE]<br>
You may have encountered a bug in the Ruby interpreter or extension libraries.<br>
Bug reports are welcome.<br>
For details: <a href="http://www.ruby-lang.org/bugreport.html" class="external">http://www.ruby-lang.org/bugreport.html</a></p>
<p>Abort</p>
<p>This is due to <strong>attribute</strong>((packed)) added in r45155.<br>
SPARC (and many other CPUs) can not access to unaligned memory address.</p>
<p>Please revert r45155.</p>
Backport193 - Backport #9531 (Closed): please backport r34605
https://redmine.ruby-lang.org/issues/9531
2014-02-18T16:46:16Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r44938 以後、Solarisにて、以下の Failureが増えました。<br>
r34605 をバックポートすれば消えると思います。</p>
<ol start="34">
<li>Failure:<br>
test_exception_in_rehash(TestHash) [/user3/gen-info/ngoto/testruby/daily/src/spa<br>
rc64-cc12-svn193-45036/test/ruby/test_hash.rb:950]:<br>
<a href="/issues/9187">[ruby-core:58728]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: st_table leaks when exception is raised in Hash#rehash (Closed)" href="https://redmine.ruby-lang.org/issues/9187">#9187</a>].<br>
<[true, ""]> expected but was<br>
<[false,<br>
"/XXXX/test/ruby/memory_status.rb:11:in <code>=~': invalid byte sequence in US-ASCII (ArgumentError)\n\tfrom /XXXX/test/ruby/memory_status.rb:11:in </code>block in read_status'\n\tfrom /XXXX/test/ruby/memory_status.rb:10:in <code>foreach'\n\tfrom /XXXX/test/ruby/memory_status.rb:10:in </code>read_status'\n\tfrom /XXXX/test/ruby/memory_status.rb:15:in <code><module:Memory>'\n\tfrom /XXXX/test/ruby/memory_status.rb:1:in </code><top (required)>'\n\tfrom -:in `require'\n"]>.</li>
</ol>
Backport193 - Backport #9530 (Closed): r44946 introduces compile error in Solaris
https://redmine.ruby-lang.org/issues/9530
2014-02-18T13:46:26Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r44946 にて、ruby_atomic.h の122行目に編集ミスによると思われる異常な行が出現しており、その結果、Solarisにてコンパイルエラーが発生します。</p>
<p>以下の部分です。</p>
<p>@@ -80,7 +81,7 @@</p>
<a name="define-ATOMIC_SIZE_INCvar-atomic_inc_ulongampvar"></a>
<h1 >define ATOMIC_SIZE_INC(var) atomic_inc_ulong(&(var))<a href="#define-ATOMIC_SIZE_INCvar-atomic_inc_ulongampvar" class="wiki-anchor">¶</a></h1>
<a name="define-ATOMIC_SIZE_DECvar-atomic_dec_ulongampvar"></a>
<h1 >define ATOMIC_SIZE_DEC(var) atomic_dec_ulong(&(var))<a href="#define-ATOMIC_SIZE_DECvar-atomic_dec_ulongampvar" class="wiki-anchor">¶</a></h1>
<a name="define-ATOMIC_SIZE_EXCHANGEvar-val-atomic_swap_ulongampvar-val"></a>
<h1 >define ATOMIC_SIZE_EXCHANGE(var, val) atomic_swap_ulong(&(var), (val))<a href="#define-ATOMIC_SIZE_EXCHANGEvar-val-atomic_swap_ulongampvar-val" class="wiki-anchor">¶</a></h1>
<p>-# else<br>
+# define ATOMIC_SIZE_CAS(var, oldval, val) atomic_cas_ulong(&(var), (oldval), (# else</p>
<a name="define-ATOMIC_SIZE_ADDvar-val-atomic_add_intampvar-val"></a>
<h1 >define ATOMIC_SIZE_ADD(var, val) atomic_add_int(&(var), (val))<a href="#define-ATOMIC_SIZE_ADDvar-val-atomic_add_intampvar-val" class="wiki-anchor">¶</a></h1>
<a name="define-ATOMIC_SIZE_SUBvar-val-atomic_add_intampvar-val"></a>
<h1 >define ATOMIC_SIZE_SUB(var, val) atomic_add_int(&(var), -(val))<a href="#define-ATOMIC_SIZE_SUBvar-val-atomic_add_intampvar-val" class="wiki-anchor">¶</a></h1>
<a name="define-ATOMIC_SIZE_INCvar-atomic_inc_uintampvar"></a>
<h1 >define ATOMIC_SIZE_INC(var) atomic_inc_uint(&(var))<a href="#define-ATOMIC_SIZE_INCvar-atomic_inc_uintampvar" class="wiki-anchor">¶</a></h1>
<p>明らかに #else の前後が何か変です。行末が欠けて、かつ、次の行がくっついているように見えます。</p>
Ruby master - Bug #9436 (Closed): r44670以降Solaris10でthread_pthread.cがコンパイルエラー
https://redmine.ruby-lang.org/issues/9436
2014-01-21T08:53:50Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r44670以降、Solaris10のccでは以下のエラーが出て失敗します。(以下はr44673にて確認)</p>
<p>cc -xO1 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o thread.o -c thread.c<br>
"thread_pthread.c", line 1488: missing operator<br>
cc: acomp failed for thread.c<br>
make: *** [thread.o] Error 2</p>
<p>thread_pthread.cの1488行め付近は以下のようになっています。</p>
<a name="if-TIMER_THREAD_STACK_MIN_SIZE-lt-PTHREAD_STACK_MIN"></a>
<h1 >if TIMER_THREAD_STACK_MIN_SIZE < PTHREAD_STACK_MIN<a href="#if-TIMER_THREAD_STACK_MIN_SIZE-lt-PTHREAD_STACK_MIN" class="wiki-anchor">¶</a></h1>
<a name="undef-TIMER_THREAD_STACK_MIN_SIZE"></a>
<h1 >undef TIMER_THREAD_STACK_MIN_SIZE<a href="#undef-TIMER_THREAD_STACK_MIN_SIZE" class="wiki-anchor">¶</a></h1>
<a name="define-TIMER_THREAD_STACK_MIN_SIZE-PTHREAD_STACK_MIN"></a>
<h1 >define TIMER_THREAD_STACK_MIN_SIZE PTHREAD_STACK_MIN<a href="#define-TIMER_THREAD_STACK_MIN_SIZE-PTHREAD_STACK_MIN" class="wiki-anchor">¶</a></h1>
<a name="endif"></a>
<h1 >endif<a href="#endif" class="wiki-anchor">¶</a></h1>
<p>Solaris10では、PTHREAD_STACK_MIN は /usr/include/limits.h にて以下のように定義されています。<br>
#define PTHREAD_STACK_MIN ((size_t)_sysconf(_SC_THREAD_STACK_MIN))</p>
<p>つまり、PTHREAD_STACK_MINの実体は関数であり、定数ではありません。<br>
このため、#if では使うことができずコンパイルエラーになります。</p>
Ruby master - Bug #9257 (Closed): flock OS dependency problem in RubyGems
https://redmine.ruby-lang.org/issues/9257
2013-12-18T16:58:29Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>On Solaris, after r44157, many tests of RubyGems failed or raise error during make test-all.</p>
<p>For example,</p>
<ol start="44">
<li>Failure:<br>
TestGemDependencyInstaller#test_install_security_policy [/XXX/test/rubygems/test_gem_dependency_installer.rb:846]:<br>
[Gem::Security::Exception] exception expected, not<br>
Class: <a href="Errno::EBADF" class="external">Errno::EBADF</a><br>
Message: <"Bad file number @ rb_file_flock - /var/tmp/test_rubygems_21075/spec_c<br>
ache/gems.example.com%80/quick/Marshal.4.8/b-1.gemspec"><br>
---Backtrace---<br>
/XXX/lib/rubygems.rb:768:in <code>flock' /XXX/lib/rubygems.rb:768:in </code>block in read_binary'<br>
/XXX/lib/rubygems.rb:767:in <code>open' /XXX/lib/rubygems.rb:767:in </code>read_binary'<br>
/XXX/lib/rubygems/source.rb:133:in <code>fetch_spec' /XXX/lib/rubygems/resolver/index_specification.rb:64:in </code>spec'<br>
/XXX/lib/rubygems/resolver/specification.rb:85:in <code>installable_platform?' /XXX/lib/rubygems/platform.rb:34:in </code>installable?'<br>
/XXX/lib/rubygems/resolver.rb:426:in <code>block in select_local_platforms' /XXX/lib/rubygems/resolver.rb:425:in </code>select'<br>
/XXX/lib/rubygems/resolver.rb:425:in <code>select_local_platforms' /XXX/lib/rubygems/resolver.rb:200:in </code>find_possible'<br>
/XXX/lib/rubygems/resolver.rb:327:in <code>resolve_for' /XXX/lib/rubygems/resolver.rb:165:in </code>resolve'<br>
/XXX/lib/rubygems/request_set.rb:238:in <code>resolve' /XXX/lib/rubygems/dependency_installer.rb:434:in </code>resolve_dependencies'<br>
/XXX/lib/rubygems/dependency_installer.rb:371:in <code>install' /XXX/test/rubygems/test_gem_dependency_installer.rb:847:in </code>block in test_install_security_policy'</li>
</ol>
<hr>
<ol start="46">
<li>Error:<br>
TestGemResolverLockSpecification#test_install:<br>
Errno::EBADF: Bad file number @ rb_file_flock - /var/tmp/test_rubygems_21075/gems/a-2.gem<br>
/XXX/lib/rubygems.rb:768:in <code>flock' /XXX/lib/rubygems.rb:768:in </code>block in read_binary'<br>
/XXX/lib/rubygems.rb:767:in <code>open' /XXX/lib/rubygems.rb:767:in </code>read_binary'<br>
/XXX/lib/rubygems/test_utilities.rb:328:in <code>block in setup_fetcher' /XXX/lib/rubygems/test_utilities.rb:324:in </code>each'<br>
/XXX/lib/rubygems/test_utilities.rb:324:in <code>setup_fetcher' /XXX/lib/rubygems/test_utilities.rb:247:in </code>execute'<br>
/XXX/lib/rubygems/test_utilities.rb:207:in <code>declare' /XXX/lib/rubygems/test_case.rb:1207:in </code>spec_fetcher'<br>
/XXX/test/rubygems/test_gem_resolver_lock_specification.rb:36:in `test_install'</li>
</ol>
<p>The failures/errors is caused in line 768 in lib/rubygems.rb,<br>
in the self.read_binary method.</p>
<p>def self.read_binary(path)<br>
File.open path, binary_mode do |f|<br>
f.flock(File::LOCK_EX)<br>
f.read<br>
end<br>
end</p>
<p>On Solaris (and probably on JRuby), files opened with read-only mode can not be exclusively locked by using flock.</p>
<p>FYI, when similar problem was found in Rails, the solution was to open the file with read-write mode.<br>
<a href="https://rails.lighthouseapp.com/projects/8994/tickets/6662-fileflock-cant-lock-read-only-file-for-exclusive-access" class="external">https://rails.lighthouseapp.com/projects/8994/tickets/6662-fileflock-cant-lock-read-only-file-for-exclusive-access</a></p>
Ruby master - Bug #8901 (Closed): "-lgmp: not found" でlibruby-static.a 作成に失敗する
https://redmine.ruby-lang.org/issues/8901
2013-09-12T17:37:45Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>BignumにGMPを使うようになって以降、Solarisで以下のようにlibruby-static.a の作成に失敗するようになりました。<br>
Solaris以外にも、LDFLAGSでライブラリの場所を指定する必要のある環境では同様に失敗すると思います。</p>
<p>% CC=cc<br>
% CXX=CC<br>
% CPPLAGS="-I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include"<br>
% CFLAGS="-xO1 -xtarget=sparc64viiplus -m64"<br>
% CXXFLAGS="-xO1 -xtarget=sparc64viiplus -m64"<br>
% LDFLAGS="-m64 -L/usr/local/64/lib -R/usr/local/64/lib"<br>
% DLDFLAGS="-m64 -L/usr/local/64/lib -R/usr/local/64/lib"<br>
% export CC CXX CPPFLAGS CFLAGS CXXFLAGS LDFLAGS DLDFLAGS<br>
% ./configure --prefix=/XXX --build=sparc64-sun-solaris2.10 --with-tclConfig-dir=/usr/local/64/lib --with-tkConfig-dir=/usr/local/64/lib --enable-shared<br>
(中略)<br>
checking gmp.h usability... yes<br>
checking gmp.h presence... yes<br>
checking for gmp.h... yes<br>
checking for __gmpz_init in -lgmp... yes<br>
(中略)<br>
configure: creating ./config.status<br>
config.status: creating GNUmakefile<br>
config.status: creating Makefile<br>
config.status: creating ruby-2.1.pc<br>
% make V=1<br>
(中略)<br>
ar rcu libruby-static.a ruby-glommed.o dmyext.o<br>
ld: fatal: library -lgmp: not found<br>
ld: fatal: file processing errors. No output written to conftest<br>
make: *** [libruby-static.a] Error 2</p>
<p>以下のように verifying static-library $@ のところで $(LDFLAGS) の順番を ruby 本体を作成するときと同じように $(XLDFLAGS) の直前に変更すると治りました。</p>
<a name="Index-Makefilein"></a>
<h1 >Index: Makefile.in<a href="#Index-Makefilein" class="wiki-anchor">¶</a></h1>
<p>--- Makefile.in (revision 42917)<br>
+++ Makefile.in (working copy)<br>
@@ -215,7 +215,7 @@<br>
$(Q) $(AR) $(ARFLAGS) $@ $(LIBRUBY_A_OBJS) $(DMYEXT)<br>
@-$(RANLIB) $@ 2> /dev/null || true<br>
$(ECHO) verifying static-library $@</p>
<ul>
<li>
<pre><code> @$(PURIFY) $(CC) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT) $(LDFLAGS)
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> @$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT)
@$(RM) conftest$(EXEEXT) conftest.c
</code></pre>
</li>
</ul>
<p>$(LIBRUBY_SO):</p>
Ruby master - Bug #8810 (Closed): GDBM.open内で処理がブロックしたらTimeout.timeout が効かない
https://redmine.ruby-lang.org/issues/8810
2013-08-23T00:27:55Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>GDBM.open内で処理がブロックした場合にTimeout.timeoutが効きません。</p>
<p>再現方法は、Solarisにて、以下のようにGDBMをオープンしたままにして、</p>
<p>$ ruby -r gdbm -e 'db = GDBM.open("/var/tmp/tmpdb"); gets'</p>
<p>同一マシンで別のシェルで</p>
<p>$ ruby -r gdbm -r timeout -e 'Timeout.timeout(5) { db = GDBM.open("/var/tmp/tmpdb") }'</p>
<p>を実行しても、タイムアウトすることなく後者のGDBM.openがブロックし続けて終わりません。</p>
<p>Solarisだけでなく、Linux上にて、以下のように無理やりflockを使わないようconfigureしてmakeしたlibgdbm.soを使用した場合でも同様に再現しました。</p>
<p>$ wget <a href="ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz" class="external">ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz</a><br>
$ tar xvf gdbm-1.10.tar.gz<br>
$ cd gdbm-1.10<br>
$ ./configure --prefix=/home/xxxxx/gdbm ac_cv_func_flock=no<br>
$ make<br>
$ make install<br>
$ LD_PRELOAD=/home/xxxxx/gdbm/lib/libgdbm.so ruby -r gdbm -e 'db = GDBM.open("/var/tmp/tmpdb"); gets'<br>
(別のシェルにて)<br>
$ LD_PRELOAD=/home/xxxxx/gdbm/lib/libgdbm.so ruby -r gdbm -r timeout -e 'Timeout.timeout(5) { db = GDBM.open("/var/tmp/tmpdb") }'</p>
Ruby master - Bug #8790 (Closed): r41424 以降、Solaris と gdbm 1.1.10 にて TestGDBM#test_s_open_lock が終...
https://redmine.ruby-lang.org/issues/8790
2013-08-16T15:22:08Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r41424以降、Solarisにて make test-all すると、 TestGDBM#test_s_open_lock がブロックして、いつまで待っても make test-all が終わらなくなっています。この現象は、下記のように、Solaris以外でも、flockは無いがlockfは存在する環境では同様に発生すると思われます。</p>
<p>Solarisにて gdbm 1.1.10 を ./configure したときのログの一部を抜粋します。</p>
<p>checking for flock... no<br>
checking for lockf... yes</p>
<p>このようにflockは無いがlockfはある場合、gdbm 1.1.10 のソース( <a href="ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz" class="external">ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz</a> )の gdbm-1.10/src/lock.c の124行目のコードがファイルのロックに使用されるようです。その周辺のコードを引用します。</p>
<p>#if HAVE_LOCKF<br>
/* Mask doesn't matter for lockf. */<br>
lock_val = lockf (dbf->desc, F_LOCK, (off_t)0L);</p>
<p>このように、lockfでロックを取得する際に F_LOCK つまり前のロックが解除されるまでブロックして待ち続けるオプションを付けています。このため、現在の TestGDBM#test_s_open_lock の実装では、ブロックし続けて永遠に終わりません。</p>
Ruby master - Bug #8655 (Closed): シンボル名 Init_pack が複数ファイルで定義されている
https://redmine.ruby-lang.org/issues/8655
2013-07-18T18:25:28Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Solarisにて、make test-all すると、以下のエラーが出てテストが実行できません。<br>
% make test-all<br>
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" -v<br>
/XXXXXXXXXXXXXXXXXXXXXXX/lib/rake/ext/module.rb:36:in `const_missing': uninitialized constant Integer::INTEGER_PACK_MSWORD_FIRST (NameError)</p>
<p>Init_pack という名前の関数が pack.c と ext/-test-/bignum/pack.c の2か所に存在し、<br>
後からrequireした "-test/bignum.so" の Init_pack() が呼ばれないのが原因と思います。</p>
<p>% git grep -n Init_pack<br>
ext/-test-/bignum/pack.c:49:Init_pack(VALUE klass)<br>
pack.c:2003:Init_pack(void)</p>
<p>ext/-test-/bignum/pack.c のファイル名とInit_の関数名を変更すれば解決すると思います。<br>
(もちろん pack.c 側を変えても構いませんが、テスト側を変更するほうが自然と思います)</p>
Ruby master - Bug #8524 (Closed): r40755以降 No rule to make target `.ext/include/sparc64-solaris2....
https://redmine.ruby-lang.org/issues/8524
2013-06-13T14:57:45Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r40755以降、Solarisでは、以下のように .ext/include/アーキテクチャ/ruby/config.h が作成されません。</p>
<p>原因は、r40755にて以下の行が./tool/ifchange に追加されたためです。</p>
<p>@@ -30,6 +37,7 @@<br>
rm -f "$temp"<br>
else<br>
echo "$target updated"</p>
<ul>
<li>${keepsuffix:+ mv -f "$target" "${target}${keepsuffix}" }<br>
mv -f "$temp" "$target"<br>
fi</li>
</ul>
<p>この tool/ifchangeは #!/bin/sh なのに、基本的な/bin/shでは解釈できない(bash依存?)記述が追加されたため、Solarisのようにピュアな/bin/shを持つOSでは、そこで処理がストップし、しかしconfigureではエラーを検知できないらしく、そのままconfig.hが作成されないままconfigureが正常終了してしまうのが原因のようです。</p>
<p>$ ./configure --prefix=/hoge/hoge/hoge<br>
(中略)<br>
checking for nroff... /usr/bin/nroff<br>
.ext/include/sparc64-solaris2.10/ruby/config.h updated<br>
./tool/ifchange: bad substitution<br>
verconf.h updated<br>
./tool/ifchange: bad substitution<br>
ruby library version = 2.1.0<br>
configure: creating ./config.status<br>
config.status: creating GNUmakefile<br>
config.status: creating Makefile<br>
config.status: creating ruby-2.1.pc<br>
$ make V=1<br>
CC = cc<br>
LD = /usr/ccs/bin/ld<br>
LDSHARED = cc -G<br>
CFLAGS = -xO1 -xtarget=sparc64viiplus -m64<br>
XCFLAGS = -DRUBY_EXPORT<br>
CPPFLAGS = -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I.<br>
DLDFLAGS = -m64 -L/usr/local/64/lib -R/usr/local/64/lib -m64<br>
SOLIBS =<br>
cc: Sun C 5.12 SunOS_sparc 2011/11/16<br>
make: *** No rule to make target <code>.ext/include/sparc64-solaris2.10/ruby/config.h', needed by </code>main.o'. Stop.</p>
Backport193 - Backport #8228 (Closed): atomic_ops unavailable on Solaris 9 or earlier
https://redmine.ruby-lang.org/issues/8228
2013-04-06T23:18:35Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>アトミックな演算(man atomic_ops 参照)はSolaris 9以前には存在しないが使おうとするため、Solaris8でSunのコンパイラでは1.9.3以降がコンパイルできない、との指摘があったとtwitterで知らせてもらいました。</p>
<p>kosakiさん作成のパッチ <a href="https://gist.github.com/kosaki/5260762" class="external">https://gist.github.com/kosaki/5260762</a> にて、Solaris10では #define HAVE_ATOMIC_H 1 となりSolaris用atomic関数が使われることは確認しました。</p>
Backport200 - Backport #8227 (Closed): addr2line.c compile error on Solaris since r39887
https://redmine.ruby-lang.org/issues/8227
2013-04-06T22:30:54Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>r39887以降、Solarisで以下のようなコンパイルエラーが発生します。<br>
Solaris では、quad_t は別の意味の構造体が割り当てられており、u_quad_t は定義されおらず、<br>
また、__inline は、GCC か Sun Studio 12 Update 1 以降でないと使えないためです。<br>
(GCCは未確認)</p>
<p>fcc -O -KV9 -KVIS2 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/u<br>
sr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o<br>
addr2line.o -c addr2line.c<br>
"addr2line.c", line 691: error: syntax error near <code>int' "addr2line.c", line 691: error: function type is required for </code>__inline'<br>
"addr2line.c", line 915: error: assignment from <code>int' to </code>quad_t': operator <code>=' "addr2line.c", line 988: error: undeclared identifier </code>u_quad_t'<br>
"addr2line.c", line 988: error: syntax error near <code>)' "addr2line.c", line 988: error: syntax error near </code>)'<br>
"addr2line.c", line 1006: error: assignment from <code>quad_t' to </code>uintmax_t': operator `='</p>
<p>以下のようなパッチでコンパイルは通るようになります。</p>
<p>===================================================================<br>
--- addr2line.c (revision 40156)<br>
+++ addr2line.c (working copy)<br>
@@ -646,6 +646,19 @@<br>
free(lines);<br>
}</p>
<p>+#if defined(__sun)<br>
+/* Solaris has different quad_t and does not have u_quad_t <em>/<br>
+# include "ruby/defines.h"<br>
+# define quad_t LONG_LONG<br>
+# define u_quad_t unsigned LONG_LONG<br>
+/</em> __inline can only be used with GCC or Sun Studio 12 Update 1 or later <em>/<br>
+# if defined(<strong>GNUC</strong>)<br>
+# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)<br>
+# else<br>
+# define __inline inline<br>
+# endif<br>
+#endif /</em> defined(__sun) <em>/<br>
+<br>
/</em> From FreeBSD's lib/libstand/printf.c <em>/<br>
/</em>-</p>
<ul>
<li>Copyright (c) 1986, 1988, 1991, 1993<br>
===================================================================</li>
</ul>
Backport200 - Backport #8150 (Closed): Backport r39860
https://redmine.ruby-lang.org/issues/8150
2013-03-23T01:59:10Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Please backport r39860 to avoid SEGV on Intel Solaris in Marshal.dump and load.</p>
Ruby master - Bug #7591 (Closed): SEGV on sparc Solaris10 when Marshal.dump
https://redmine.ruby-lang.org/issues/7591
2012-12-19T23:26:52Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>sparc Solaris10 上にて、Oracle Solaris Studio 12.3 にてデフォルトの最適化オプションである -O (-xO4 相当)を付けて make すると、rdoc作成時に Marshal.dump 内にて SEGV が発生します。make test-all すると、 TestMarshal が Failure になります。</p>
<p>marshal.c の marshal_dump および marshal_load 関数にて、変数 wrapper が最適化のためスタックに乗らないようで、w_object などの呼び出した先の関数の中で走ったGCによって消されてしまい、SEGVに至るようです。関数の最後のほうにある RB_GC_GUARD(wrapper) は効果が無いようです。</p>
<p>添付のパッチのように修正すると治りました。<br>
添付のパッチ適用後は、関数末尾の RB_GC_GUARD(wrapper) は無くても動くようですが、念のため残しています。</p>
Backport193 - Backport #7552 (Closed): please backport Fiddle and DL bug fixes
https://redmine.ruby-lang.org/issues/7552
2012-12-13T12:17:11Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>以下のFiddleおよびDL関連のバグ修正のバックポートを希望します。</p>
<p>Fiddle bug fixes:</p>
<ul>
<li>r38073</li>
<li>r38251 (documentation only)</li>
<li>r38252 (documentation only)<br>
DL bug fixes:</li>
<li>r38202</li>
<li>r38211 (SEGV発生のため <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: DL::Function#bind causes SEGV when Fiddle is available (Closed)" href="https://redmine.ruby-lang.org/issues/7516">#7516</a> にて独立してバックポート希望出していますが念の為)</li>
<li>r38238 (r38202で追加した部分のrdocの修正)</li>
<li>r38324</li>
<li>r38326 (only tests)</li>
</ul>
Ruby master - Bug #7543 (Closed): DL::Function#bound? and unbind raise error when Fiddle is avail...
https://redmine.ruby-lang.org/issues/7543
2012-12-11T22:22:12Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>When Fiddle is available, DL::Function#unbind raises error.</p>
<p>require 'dl'<br>
require 'dl/func'<br>
include DL<br>
f = Function.new(CFunc.new(0, TYPE_INT, 'test'), [TYPE_INT, TYPE_INT])<br>
f.bind { |x,y| x + y }<br>
f.unbind</p>
<p>The above code raises the following error in "f.unbind".<br>
/XXXX/lib/ruby/2.0.0/dl/func.rb:160:in <code>unbind': undefined method </code>ptr' for #<#<a href="Class:0x007f8e8f29ae08" class="external">Class:0x007f8e8f29ae08</a>:0x007f8e8f29ad40> (NoMethodError)<br>
from -:6:in `'</p>
<p>When Fiddle is available, DL::Function#bound? also raises error.</p>
<p>require 'dl'<br>
require 'dl/func'<br>
include DL<br>
f = Function.new(CFunc.new(0, TYPE_INT, 'test'), [TYPE_INT, TYPE_INT])<br>
f.bind { |x,y| x + y }<br>
f.bound?</p>
<p>The above code raises the following error in "f.bound?".<br>
/XXXX/lib/ruby/2.0.0/dl/func.rb:174:in <code>bound?': undefined method </code>ptr' for #<#<a href="Class:0x007f6708842d78" class="external">Class:0x007f6708842d78</a>:0x007f6708842cb0> (NoMethodError)<br>
from -:6:in `'</p>
Ruby master - Feature #7518 (Assigned): Fiddle::Pointer#to_str and Fiddle::Pointer#to_int should ...
https://redmine.ruby-lang.org/issues/7518
2012-12-05T23:38:35Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>There are Fiddle::Pointer#to_str and to_int, to be used for implicit conversion to String and Integer, respectively. I think those implicit conversion methods should be removed.<br>
(Note that there are to_s and to_i, explicit conversion to String and Integer, respectively.)</p>
<p>About to_str: Because Fiddle::Pointer is not always a pointer of char *, and careless conversion of invalid pointer to a string would frequently cause SEGV. So, I think implicit conversion to string is very danger and it should be removed.</p>
<p>About to_int: Unlike to_str, pointer arithmetic methods are available in Fiddle::Pointer, but it lacks many methods for treating it as integer, and I think Fiddle::Pointer is not suitable for implicit conversion to integer.</p>
Backport193 - Backport #7516 (Closed): DL::Function#bind causes SEGV when Fiddle is available
https://redmine.ruby-lang.org/issues/7516
2012-12-05T22:12:44Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>The following script causes SEGV in "f.call(123, 456)" when fiddle is available.<br>
Without Fiddle, it shows correct result.</p>
<p>require 'dl'<br>
require 'dl/func'<br>
include DL<br>
f = Function.new(CFunc.new(0, TYPE_INT, 'test'), [TYPE_INT, TYPE_INT])<br>
f.bind { |x,y| x + y }<br>
p f.call(123, 456)</p>
Ruby master - Bug #7514 (Closed): DL::Function and DL::Importer#bind_function ignores abi and nam...
https://redmine.ruby-lang.org/issues/7514
2012-12-05T11:59:08Z
ngoto (Naohisa Goto)
ngotogenome@gmail.com
<p>Like Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Fiddle::Importer incompatibility with DL::Importer (Closed)" href="https://redmine.ruby-lang.org/issues/7484">#7484</a>, when Fiddle is available, Fiddle's DL wrapper for DL::Function ignores :stdcall ABI. In addition, when creating callback closure, DL::Function wrapped by Fiddle does not set name, and DL::Function#name raises NoMethodError.</p>