Ruby1.9 segmentation fault

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

e$B0J2<$N$h$&$J%a%C%;!<%8$r=P$7$F=*N;$7$F$7$^$&$s$G$9$,e(B…


[BUG] Segmentation fault
ruby 1.9.0 (2008-11-07 revision 20129) [i686-linux]

– control frame ----------
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP

– backtrace of native function call (Use addr2line) –
0x811caa4
0x8148128
0x814818b
0x80d00f1
0xffffe440
0x8062071
0x80621bc
0x80623be
0x811fee5
0x8119bd8
0x810ee5f
0x812009b
0x8121081
0x81210f1
0xb7f4e4af
0xb7e66d5e

e$B$3$N>pJs$GJ,$+$k$b$N$G$7$g$&$+e(B?
e$BB>$K2?$+M_$7$$>pJs$H$+$"$j$^$9e(B?

e$B$3$N;~$N%W%m%;%9$Oe(B, e$B%9%l%C%I$,e(B3000e$B$0$i$$e(B,
e$B%W%m%;%9%5%$%:$,e(B3GBe$B$0$i$$$Ke(B
e$B$J$C$F$$$^$9e(B. e$B%a%b%j$Oe(B3GBe$B$G$9$,e(B,
e$B%9%o%C%W$O$^$@B-$j$F$$$k>u67$G$9e(B.

e$B$?$@e(B, e$BK\Ev$O$b$C$H%9%l%C%I$r:n$k$O$:$J$N$Ge(B,
e$BESCf$G;_$C$F$$$k46$8$,$J$/e(B
e$B$b$J$$$G$9e(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :37095 ] the message: "[ruby-dev:37095] ruby1.9
segmentation fault ", on Nov/14 18:20(JST) Keiju ISHITSUKA writes:

0x8119bd8
0x810ee5f
0x812009b
0x8121081
0x81210f1
0xb7f4e4af
0xb7e66d5e

addr2linee$B;H$($C$F$3$H$J$s$G$9$Me(B?

e$B$3$s$J46$8$G$9e(B:

/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_dump.c:594
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/error.c:213
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/error.c:226
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/signal.c:545
??:0
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/gc.c:2259
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/gc.c:1576
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/gc.c:2291
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/thread.c:1104
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_eval.c:105
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_eval.c:401
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/thread.c:1159
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/thread.c:421
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/thread_pthread.c:291
??:0
??:0

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37095] ruby1.9 segmentation fault”
on Fri, 14 Nov 2008 18:20:15 +0900, [email protected] (Keiju
ISHITSUKA) writes:

e$B0J2<$N$h$&$J%a%C%;!<%8$r=P$7$F=*N;$7$F$7$^$&$s$G$9$,e(B…
[BUG] Segmentation fault
ruby 1.9.0 (2008-11-07 revision 20129) [i686-linux]
e$B$3$N>pJs$GJ,$+$k$b$N$G$7$g$&$+e(B? e$BB>$K2?$+M_$7$$>pJs$H$+$"$j$^$9e(B?

addr2linee$B$N>pJs$K$h$k$He(BT_DATAe$B$J%%V%8%’%/%H$r%U%!%$%J%i%$%6$Ge(B
e$B2rJ|=hM}$9$k;~$Ke(BSEGVe$B$7$F$$$k$h$&$G$9$,!#e(Bdfreee$B$r8F$VA0$KMn$Ae(B
e$B$F$^$9$M$(!#e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100]e$B$Ne(Bc-yane$B$5$s$N8@$&DL$j$+$bCN$l$J$$$H$*$b$C$Fe(B,
e$B%9%l%C%Ie(B
e$B@8@.;~$Ke(BNoMemoryError
e$B$re(Brescuee$B$9$k$H$I$&$J$k$+$H;W$C$F$d$C$F$_$^$7$?e(B.

e$B$d$O$je(B Segve$B$7$F0J2<$N46$8$N%a%C%;!<%8$,=P$^$7$?e(B:

/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_dump.c:594
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/error.c:213
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/error.c:226
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/signal.c:545
??:0
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/gc.c:2259
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/gc.c:1576
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/gc.c:2291
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/thread.c:1104

/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_insnhelper.c:598
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/insns.def:999
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm.c:1042
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm.c:492
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_eval.c:490
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/numeric.c:2948
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm_insnhelper.c:378
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/insns.def:999
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm.c:1042
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/vm.c:1247
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/eval.c:205
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/eval.c:233
/home/keiju/var/src/var.lib/ruby/RubyBase/ruby-trunk/main.c:37
??:0

e$BESCf$^$GF1$8$J$N$Ge(B, e$B$+$J$j2x$7$$46$8$,$7$^$9e(B.

1.9e$B$Ge(B3000e$B%9%l%C%I!"%W%m%;%9%5%$%:e(B3Ge$B$C$F7P83$J$$$s$G$9$,!"<B:]e(B
e$B$N$H$3$m$I$&$J$s$G$7$g$&!#e(B

e$B$H$$$&$He(B? e$B<B:]$K$=$l$@$1@8@.$5$l$F$$$k$+$C$F$3$H$G$9e(B?
e$B%9%l%C%I?t$Oe(Bqps
e$B$Ne(BNLWPe$B$G8+$F$$$k$N$G$"$C$F$$$k$H;W$$$^$9e(B.
e$B%W%m%;%9%5%$%:$bBgBN$=$NJU$je(B
e$B$G$9$Me(B.

1e$B%W%m%;%9e(B1Me$B$/$i$$%9%?%C%/$r3d$jEv$F$k$O$:$J$s$G7W;;$O$"$C$F$^$9$,!#e(B

e$B$"!<e(B. e$B$=$&$J$C$F$$$k$s$G$9$+e(B…
e$BL/$K%9%l%C%I$N6u4V%3%9%H$,9b$$$J$H;W$Ce(B
e$B$F$$$^$7$?e(B. e$B%9%?%C%/$N%5%$%:$C$Fe(B,
e$B;XDj$G$-$?$j$G$-$^$9e(B?

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37104] Re: ruby1.9 segmentation fault”
on Mon, 17 Nov 2008 18:27:20 +0900, [email protected]
(e$B@PDM7=<ye(B) writes:

|[ruby-dev:37100]e$B$Ne(Bc-yane$B$5$s$N8@$&DL$j$+$bCN$l$J$$$H$*$b$C$Fe(B, e$B%9%l%C%Ie(B
|e$B@8@.;~$Ke(BNoMemoryError e$B$re(Brescuee$B$9$k$H$I$&$J$k$+$H;W$C$F$d$C$F$_$^$7$?e(B.
|
|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", on Nov/17 19:23(JST) Yukihiro M. writes:

まつもと ゆきひろです

|やはり Segvして以下の感じのメッセージが出ました:
ç¾è±¡ã¯åŒã˜ã§ã™ã­ã€‚å¤‰åŒ–ãªã„ã‚“ã§ä»˜åŠ çš„ãªæƒ…å ±ã¯ãªã„ã¨æ€ã„ã¾ã™ã€‚

いや. 再現性のある簡単なスクリプトで確かめたって話です. 添付します.

実行は:

% ruby test-th-pf.rb 3 6000

の感じで実行します. 6000がスレッド数になります.

いや、ほんとにちゃんと動くのか疑問ってことです。メモリの限界
に突き当たりそうな。実際当たってるのかもしれません。

うーん. パラメータ(njpb)を調整して調べました.

スレッド数の問題よりもプロセスサイズが問題みたいです. njob=501でプロセ
スサイズが3067MBだと無事実行が終了し, njob=502だとプロセスが3070MBぐら
いになると動作しなくなります.

ruby1.9はなかなかすばらしく, 6000スレッドでもそれなりに動作しているみ
たいです. とはいえ, 個々のスレッドは対したことをやっているわけでもない
ですが…

Rubyレベルではできないはずです。Cレベルはちょっとわかんない
ですね。生成する瞬間しか指定できないはずですが。

そうですか… limit値にすれば良いような気もするのですが, そう単純でも
ないものです?

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37111] Re: ruby1.9 segmentation fault”
on Tue, 18 Nov 2008 18:58:10 +0900, [email protected]
(e$B@PDM7=<ye(B) writes:

|>Rubye$B%l%Y%k$G$O$G$-$J$$$O$:$G$9!#e(BCe$B%l%Y%k$O$A$g$C$H$o$+$s$J$$e(B
|>e$B$G$9$M!#@8@.$9$k=V4V$7$+;XDj$G$-$J$$$O$:$G$9$,!#e(B
|
|e$B$=$&$G$9$+e(B… limite$BCM$K$9$l$PNI$$$h$&$J5$$b$9$k$N$G$9$,e(B, e$B$=$&C1=c$G$be(B
|e$B$J$$$b$N$G$9e(B?

1.9e$B$N$3$NJU$O;d$,:n6H$7$F$$$J$$$N$Ge(B…e$B!#e(B