[#27919] 1.8.4 Preview2 検証 — "URABE Shyouhei aka. mput" <root@...>

卜部です。

33 messages 2005/12/01

[#27997] 1.8.4 documents? — "URABE Shyouhei aka. mput" <root@...>

卜部です。

22 messages 2005/12/12
[#28017] Re: 1.8.4 documents? — Koji Arai <jca02266@...> 2005/12/13

新井です。

[#28082] ruby_1_8 Segmentation fault on Cygwin — yanagi@...

柳田です。

13 messages 2005/12/21
[#28083] Re: ruby_1_8 Segmentation fault on Cygwin — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/21

山本です。

[#28140] ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — Tanaka Akira <akr@...17n.org>

HP-UX で HP aC++/ANSI C を使って作った ruby で、openssl や drb のテストをすると、

34 messages 2005/12/27
[#28141] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — WATANABE Tetsuya <Tetsuya.WATANABE@...> 2005/12/28

渡辺哲也です。

[#28142] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — Tanaka Akira <akr@...17n.org> 2005/12/28

In article <200512280307.jBS37nnj005909@pbsg500.nifty.com>,

[#28147] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/28

山本です。

[#28149] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — Tanaka Akira <akr@...17n.org> 2005/12/28

In article <20051228210640.13C71A10.ocean@m2.ccsnet.ne.jp>,

[#28151] Re: ia64-hpux11.23/socket.sl: this executable file can't load extension libraries (LoadError) — WATANABE Tetsuya <Tetsuya.WATANABE@...> 2005/12/29

渡辺哲也です。

[#28152] Re: ia64-hpux11.23/socket.sl: this executable file can't load extensionlibraries (LoadError) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/29

山本です。

[#28153] Re: ia64-hpux11.23/socket.sl: this executable file can't load extensionlibraries (LoadError) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/12/29

山本です。

[#28154] thread based generator.rb — Tanaka Akira <akr@...17n.org> 2005/12/29

In article <20051229114438.44D19F00.ocean@m2.ccsnet.ne.jp>,

[ruby-dev:28110] Re: ruby_1_8 Segmentation fault on Cygwin

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2005-12-24 06:36:34 UTC
List: ruby-dev #28110
山本です。

>>● 例
>>test_parse_headers(TestWEBrickHTTPRequest): /var/tmp/ruby_1_8-src/lib/timeout.rb:52: [BUG] Segmentation fault
>>ruby 1.8.4 (2005-12-21) [i386-cygwin]
>>
>>*** starting debugger for pid 648, tid 1636
>>*** continuing pid 648 from debugger call (1)
>>make: *** [test-all] Aborted (core dumped)
>>% gdb -c test/ruby.exe.core
>>GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
>>Copyright 2004 Free Software Foundation, Inc.
>>GDB is free software, covered by the GNU General Public License, and you are
>>welcome to change it and/or distribute copies of it under certain conditions.
>>Type "show copying" to see the conditions.
>>There is absolutely no warranty for GDB.  Type "show warranty" for details.
>>This GDB was configured as "i686-pc-cygwin".
>>
>>#0  0x77f88f13 in ntdll!ZwWaitForSingleObject ()
>>(gdb) bt
>>#0  0x77f88f13 in ntdll!ZwWaitForSingleObject ()
>>#1  0x77e7a030 in WaitForSingleObjectEx ()
>>#2  0x77e5b3db in WaitForSingleObject ()
>>#3  0x0000000c in ?? ()
>
>webrick は yaml の前に来るはずなので、yaml の問題ではないようですね。すみません、だとすると
>私にはわかりません。cygwin 特有の問題でしょうか。

[ruby-dev:28003] が関連しそうだったので、cygwin をインストールして試して
みたところ、[ruby-dev:26187] IO.select dumps core と同じ原因のようでした。

cygwin の FD_SEtSIZE は 64 と小さく、私の手元では fd == 128 のときに SEGV しました。

# gdb を使う関係で configure --disable-shared --static-linked-ext した
#
#  Breakpoint 1, ruby_connect (fd=128, sockaddr=0x1008a1d8, len=16, socks=0)
#      at ../../../ruby_1_8/ext/socket/socket.c:997
#  997                     status = wait_connectable(fd);
#
# の wait_connectable から返ったあとに SEGV

[ruby-dev:26369] のとみたさんのアイデアに倣って、とりあえずこうすると
落ちなくなりました。

Index: ext/socket/socket.c
===================================================================
RCS file: /src/ruby/ext/socket/socket.c,v
retrieving revision 1.108.2.37
diff -u -p -r1.108.2.37 socket.c
--- ext/socket/socket.c	28 Nov 2005 09:56:45 -0000	1.108.2.37
+++ ext/socket/socket.c	24 Dec 2005 04:12:27 -0000
@@ -872,6 +872,16 @@ ruby_socket(domain, type, proto)
 	    fd = socket(domain, type, proto);
 	}
     }
+    if (fd > FD_SETSIZE) {
+	close(fd);
+	rb_gc();
+	fd = socket(domain, type, proto);
+	if (fd > FD_SETSIZE) {
+	    close(fd);
+	    errno = EMFILE;
+	    return -1;
+	}
+    }
     return fd;
 }
 

これで test-all も通るでしょうか?(自分で試そうとしたのですが、なぜか dbm などの
make に失敗するので。。。どうも私は cygwin との相性が悪いようです)



In This Thread