[#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:39146] [Bug #1967] Segmentation fault at test_qsort1 and test_qsort2 in test/dl/test_func.rb running on sparc-solaris-2.10

From: Naohisa Goto <redmine@...>
Date: 2009-08-20 13:35:12 UTC
List: ruby-dev #39146
Bug #1967: Segmentation fault at test_qsort1 and test_qsort2 in test/dl/test_func.rb running on sparc-solaris-2.10
http://redmine.ruby-lang.org/issues/show/1967

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

sparc-solaris-2.10 で 64ビットコンパイルした場合、
make check が test/dl/test_func.rb の test_qsort1 にて
Segmentation fault になります。

原因は、引数の型でした。
       void qsort(void *base, size_t nmemb, size_t size,
                  int(*compar)(const void *, const void *));
の size_t 型の引数 nmenb および size に対して TYPE_INT が指定されていますが、
size_t は 64ビット環境では unsigned long になるため、特にsparc v9 のような
ビッグエンディアンの環境では異常な数値が qsort の引数に渡るのが原因でした。

TYPE_INT を TYPE_LONG に変更した以下のパッチで直りました。
(TYPE_SIZE_T は存在しない?)

Index: test/dl/test_func.rb
===================================================================
--- test/dl/test_func.rb	(revision 24582)
+++ test/dl/test_func.rb	(working copy)
@@ -43,7 +43,7 @@
       cb = Function.new(CFunc.new(0, TYPE_INT, '<callback>qsort'),
                         [TYPE_VOIDP, TYPE_VOIDP]){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]}
       qsort = Function.new(CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort'),
-                           [TYPE_VOIDP, TYPE_INT, TYPE_INT, TYPE_VOIDP])
+                           [TYPE_VOIDP, TYPE_LONG, TYPE_LONG, TYPE_VOIDP])
       buff = "9341"
       qsort.call(buff, buff.size, 1, cb)
       assert_equal("1349", buff)
@@ -53,7 +53,7 @@
       cb = TempFunction.new(CFunc.new(0, TYPE_INT, '<callback>qsort'),
                                [TYPE_VOIDP, TYPE_VOIDP])
       qsort = Function.new(CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort'),
-                           [TYPE_VOIDP, TYPE_INT, TYPE_INT, TYPE_VOIDP])
+                           [TYPE_VOIDP, TYPE_LONG, TYPE_LONG, TYPE_VOIDP])
       buff = "9341"
       qsort.call(buff, buff.size, 1, cb){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]}
       assert_equal("1349", buff)


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

In This Thread

Prev Next