[#39052] Fwd: [redmine4ruby-lang:253] [Bug #1914] ruby-1.9.1-p243 failed to build from source on aix 5.3 with gcc 4.2.0 — Yugui <yugui@...>

Redmine管理用プロジェクトに報告されてしまったので転送します。

12 messages 2009/08/09
[#39264] Re: Fwd: [redmine4ruby-lang:253] [Bug #1914] ruby-1.9.1-p243 failed to build from source on aix 5.3 with gcc 4.2.0 — Yutaka Kanemoto <kinpoco@...> 2009/09/08

金本と申します。

[#39107] [Bug #1952] cannot stop with Ctrl+C — Usaku NAKAMURA <redmine@...>

Bug #1952: cannot stop with Ctrl+C

14 messages 2009/08/18

[#39167] [Bug #2000] Change the license to "GPLv2+ or Ruby's original". — Mamoru Tasaka <redmine@...>

Bug #2000: Change the license to "GPLv2+ or Ruby's original".

11 messages 2009/08/26

[#39193] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...>

In article <200908281827.n7SIRbaX003476@ci.ruby-lang.org>,

16 messages 2009/08/29
[#39194] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/29

なかだです。

[#39195] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...> 2009/08/29

In article <4a988633.9553f10a.4496.483e@mx.google.com>,

[#39196] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/29

なかだです。

[#39197] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...> 2009/08/29

In article <4a989f76.1602be0a.3de4.1131@mx.google.com>,

[#39198] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Yukihiro Matsumoto <matz@...> 2009/08/29

まつもと ゆきひろです

[#39206] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/31

なかだです。

[ruby-dev:39152] [Bug #1977] test failed in test_isdigit in test/dl/test_func.rb on sparc-solaris-2.10 (64bit)

From: Naohisa Goto <redmine@...>
Date: 2009-08-21 15:21:47 UTC
List: ruby-dev #39152
Bug #1977: test failed in test_isdigit in test/dl/test_func.rb on sparc-solaris-2.10 (64bit)
http://redmine.ruby-lang.org/issues/show/1977

起票者: Naohisa Goto
ステータス: Open, 優先度: Normal
ruby -v: ruby 1.9.2dev (2009-08-19) [sparc-solaris2.10]

sparc-solaris-2.10 にて64ビットコンパイルした場合、Bug #1967
([ruby-dev:39146])のパッチを適用した後では、以下の2つのdl関連
のテストが失敗(Failure)します。

  1) Failure:
test_isdigit(DL::TestFunc) [/XXX/test/dl/test_func.rb:21]:
Failed assertion, no message given.

  2) Failure:
test_isdigit(DL::TestImport) [/XXX/test/dl/test_import.rb:126]:
Failed assertion, no message given.

Solaris付属のシステムコール追跡コマンドtrussを使って、
$ truss -t '!all' -u 'libc:isdigit' /XXX/trunk-24578/bin/testrb test/dl -v
のような感じで、isdigit関数の呼び出しを追跡したところ、

(前略)
DL::TestFunc#test_isdigit: /1@1:        -> libc:isdigit(0x3100000000, 0xc, 0xffffffffffffffff, 0xfffffffffffffff8)
/1@1:   <- libc:isdigit() = 0
/1@1:   -> libc:isdigit(0x3200000000, 0xc, 0xffffffffffffffff, 0xfffffffffffffff8)
/1@1:   <- libc:isdigit() = 0
/1@1:   -> libc:isdigit(0x7200000000, 0xc, 0xffffffffffffffff, 0xfffffffffffffff8)
/1@1:   <- libc:isdigit() = 0
0.01 s: F
(中略)
DL::TestImport#test_isdigit: /1@1:      -> libc:isdigit(0x3100000000, 0xc, 0xffffffffffffffff, 0xfffffffffffffff8)
/1@1:   <- libc:isdigit() = 0
/1@1:   -> libc:isdigit(0x3200000000, 0xc, 0xffffffffffffffff, 0xfffffffffffffff8)
/1@1:   <- libc:isdigit() = 0
/1@1:   -> libc:isdigit(0x7200000000, 0xc, 0xffffffffffffffff, 0xfffffffffffffff8)
/1@1:   <- libc:isdigit() = 0
0.00 s: F
(後略)

1番目の引数は、本来 0x31, 0x32, 0x72 といった数であるべきところが、
0x3100000000, 0x3200000000, 0x7200000000 になってしまっています。

どうやら、sparc 環境では、引数のint は long に符号拡張されるようです。
(参考文献: http://sdc.sun.co.jp/solaris/tools/private/amd64_migration.html )

標準関数 int putchar(char) にて確認したところ、char も同様に long
に拡張されるので、short もおそらく同様だと思います。
float が double に拡張されるかどうかは確認できていません。
また、sparc上のLinuxなど、Solaris以外ではどうなのかは未確認です。

sparcの場合だけ特別な PACK_MAP と SIZE_MAP を持つようにしたパッチを
以下に添付します。このパッチを当てると dl のテストはすべて成功します。
(注:差分を小さくするためインデントが少々おかしくなっています。)

Index: ext/dl/lib/dl/stack.rb
===================================================================
--- ext/dl/lib/dl/stack.rb	(revision 24578)
+++ ext/dl/lib/dl/stack.rb	(working copy)
@@ -61,6 +61,36 @@
       TYPE_DOUBLE => ALIGN_DOUBLE,
     }
 
+    case RUBY_PLATFORM
+
+    when /sparc/i
+      PACK_MAP = {
+        TYPE_VOIDP => ((SIZEOF_VOIDP == SIZEOF_LONG_LONG)? "q" : "l!"),
+        TYPE_CHAR  => "l!",
+        TYPE_SHORT => "l!",
+        TYPE_INT   => "l!",
+        TYPE_LONG  => "l!",
+        TYPE_FLOAT => "f",
+        TYPE_DOUBLE => "d",
+      }
+
+      SIZE_MAP = {
+        TYPE_VOIDP => SIZEOF_VOIDP,
+        TYPE_CHAR  => SIZEOF_LONG,
+        TYPE_SHORT => SIZEOF_LONG,
+        TYPE_INT   => SIZEOF_LONG,
+        TYPE_LONG  => SIZEOF_LONG,
+        TYPE_FLOAT => SIZEOF_FLOAT,
+        TYPE_DOUBLE => SIZEOF_DOUBLE,
+      }
+      if defined?(TYPE_LONG_LONG)
+        ALIGN_MAP[TYPE_LONG_LONG] = ALIGN_LONG_LONG
+        PACK_MAP[TYPE_LONG_LONG] = "q"
+        SIZE_MAP[TYPE_LONG_LONG] = SIZEOF_LONG_LONG
+      end
+
+    else
+
     PACK_MAP = {
       TYPE_VOIDP => ((SIZEOF_VOIDP == SIZEOF_LONG_LONG)? "q" : "l!"),
       TYPE_CHAR  => "c",
@@ -86,6 +116,8 @@
       SIZE_MAP[TYPE_LONG_LONG] = SIZEOF_LONG_LONG
     end
 
+    end
+
     def parse_types(types)
       @types = types
       @template = ""


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next