[ruby-dev:3465] [BUG] Segmentaion Fault / Memory Exhaust
From:
Shin-ichro Hara <sinara@...>
Date:
1998-08-24 10:39:34 UTC
List:
ruby-dev #3465
原です。
まつもとさん夏休みなのね。
やっと最近 ruby1.1 に移行中です。で、1.1c2 で(1.0 のころからなんですが)
メモリを使い切る様なあるプログラムで Segmentation fault を起こして困って
います。GC 関係でしょうか。-O2 オプションを外してコンパイルしても同様で
す。gdb の結果をつけておきます。このプログラムを動かすと重くて業務にさし
つかえるので(^^;、こちらでなかなか試せません。「Segmentaion fault お試し
セット」も作ったので必要でしたら送ります。でも 15M byte あるし、そちらで
再現しないかも。
Debian 2.0 での話です。
bash-2.01$ gdb /home/sinara/install/ruby/ruby-1.1c2/ruby
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
...
This GDB was configured as "i586-pc-linux-gnu"...
(gdb) r thrsew/thrsew.rb -drm linux-users
Starting program: /home/sinara/install/ruby/ruby-1.1c2/ruby thrsew/thrsew.rb -drm linux-users
[START: Mon Aug 24 15:37:12 JST 1998]
Program received signal SIGSEGV, Segmentation fault.
...
gc_mark (ptr=0x66203336) at gc.c:385
385 if (obj->as.basic.flags == 0) return; /* free cell */
(gdb) where
#0 gc_mark (ptr=0x66203336) at gc.c:385
#1 0x806472c in mark_entry (key=909128001, value=1713386294) at gc.c:337
#2 0x809ce16 in st_foreach (table=0xa550fe8, func=0x8064720 <mark_entry>,
arg=0x0) at st.c:388
#3 0x8064770 in mark_tbl (tbl=0xa550fe8) at gc.c:346
#4 0x8064d49 in gc_mark (ptr=0x40a4951c) at gc.c:528
#5 0x8064cbf in gc_mark (ptr=0x4010dacc) at gc.c:508
#6 0x806472c in mark_entry (key=9773, value=1074846412) at gc.c:337
#7 0x809ce16 in st_foreach (table=0x80f56d0, func=0x8064720 <mark_entry>,
arg=0x0) at st.c:388
#8 0x8064770 in mark_tbl (tbl=0x80f56d0) at gc.c:346
#9 0x8064c81 in gc_mark (ptr=0x4010df04) at gc.c:499
#10 0x806472c in mark_entry (key=8813, value=1074847492) at gc.c:337
#11 0x809ce16 in st_foreach (table=0x80cb3e8, func=0x8064720 <mark_entry>,
arg=0x0) at st.c:388
#12 0x8064770 in mark_tbl (tbl=0x80cb3e8) at gc.c:346
#13 0x8064c81 in gc_mark (ptr=0x4012fd20) at gc.c:499
#14 0x806472c in mark_entry (key=2809, value=1074986272) at gc.c:337
#15 0x809ce16 in st_foreach (table=0x80cb660, func=0x8064720 <mark_entry>,
arg=0x0) at st.c:388
#16 0x8064770 in mark_tbl (tbl=0x80cb660) at gc.c:346
#17 0x8064c81 in gc_mark (ptr=0x4012fce4) at gc.c:499
#18 0x8064c69 in gc_mark (ptr=0x4012fcd0) at gc.c:497
#19 0x8064c69 in gc_mark (ptr=0x4012fcbc) at gc.c:497
#20 0x8064b59 in gc_mark (ptr=0x4012fcf8) at gc.c:487
#21 0x8064b59 in gc_mark (ptr=0x40127dc8) at gc.c:487
#22 0x8064b59 in gc_mark (ptr=0x40127df0) at gc.c:487
#23 0x8064b59 in gc_mark (ptr=0x4011c194) at gc.c:487
#24 0x8064a75 in gc_mark (ptr=0x40118954) at gc.c:416
#25 0x8064a69 in gc_mark (ptr=0x4011c1f8) at gc.c:402
#26 0x806557c in gc_mark_frame (frame=0xbfffa438) at gc.c:760
#27 0x80655d9 in gc_gc () at gc.c:816
#28 0x8064143 in xmalloc (size=35) at gc.c:62
#29 0x809d05f in str_new (
ptr=0xbfff62f0 "Reply-To: linux-users@linux.or.jp\nnet.or.jp>\n5 -0000\np) (alias@127.0.0.1)\n0.34.169.125])\no the address linux-users-tohoku-ctl@ginga.idac.tohoku.ac.jp\nI1AkTyRHJC0kSiQkISkbKEI=?=)\n022-JP?B?GyRCI1AkTyRHJ"...,
len=34) at string.c:49
#30 0x8069de3 in io_gets (io=1098764644) at io.c:622
#31 0x806976a in io_gets_method (argc=0, argv=0x0, io=1098764644) at io.c:475
#32 0x8058134 in rb_call0 (klass=1074951392, recv=1098764644, id=6433, argc=0,
argv=0x0, body=0x4012706c, nosuper=1) at eval.c:3375
#33 0x80591b4 in rb_call (klass=1074951392, recv=1098764644, mid=6433, argc=0,
argv=0x0, scope=0) at eval.c:3651
#34 0x8053a18 in rb_eval (self=1098764784, node=0x4011b988) at eval.c:1983
#35 0x80549f0 in rb_eval (self=1098764784, node=0x4011b974) at eval.c:2134
#36 0x8052923 in rb_eval (self=1098764784, node=0x4011b294) at eval.c:1722
#37 0x8052490 in rb_eval (self=1098764784, node=0x4011b26c) at eval.c:1610
#38 0x8058d4b in rb_call0 (klass=1074848472, recv=1098764784, id=9009, argc=0,
argv=0x0, body=0x4011b9d8, nosuper=0) at eval.c:3570
#39 0x80591b4 in rb_call (klass=1074848472, recv=1098764784, mid=9009, argc=0,
argv=0x0, scope=2) at eval.c:3651
#40 0x8053d45 in rb_eval (self=1098764784, node=0x40117e78) at eval.c:2001
#41 0x8052490 in rb_eval (self=1098764784, node=0x40117e3c) at eval.c:1610
#42 0x8058d4b in rb_call0 (klass=1074848392, recv=1098764784, id=2897, argc=0,
argv=0xbfffbeb4, body=0x40117e50, nosuper=0) at eval.c:3570
#43 0x80591b4 in rb_call (klass=1074848392, recv=1098764784, mid=2897, argc=1,
argv=0xbfffbeb0, scope=3) at eval.c:3651
#44 0x80540d3 in rb_eval (self=1098764784, node=0x4010fde0) at eval.c:2025
#45 0x8052490 in rb_eval (self=1098764784, node=0x4010fd40) at eval.c:1610
#46 0x8058d4b in rb_call0 (klass=1074847492, recv=1098764784, id=2897, argc=0,
argv=0xbfffc9a4, body=0x4010fd40, nosuper=0) at eval.c:3570
#47 0x80591b4 in rb_call (klass=1074847492, recv=1098764784, mid=2897, argc=3,
---Type <return> to continue, or q <return> to quit---
argv=0xbfffc998, scope=1) at eval.c:3651
#48 0x8059429 in rb_funcall2 (recv=1098764784, mid=2897, argc=3,
argv=0xbfffc998) at eval.c:3735
#49 0x805b53a in obj_call_init (obj=1098764784) at eval.c:4524
#50 0x805b5ca in class_new_instance (argc=3, argv=0xbfffc998, klass=1074847492)
at eval.c:4540
#51 0x8058134 in rb_call0 (klass=1074986232, recv=1074847492, id=3105, argc=3,
argv=0xbfffc998, body=0x4012f1f4, nosuper=1) at eval.c:3375
#52 0x80591b4 in rb_call (klass=1074986232, recv=1074847492, mid=3105, argc=3,
argv=0xbfffc998, scope=0) at eval.c:3651
#53 0x8053a18 in rb_eval (self=1074847492, node=0x4010f908) at eval.c:1983
#54 0x8054a70 in rb_eval (self=1074847492, node=0x4010f8e0) at eval.c:2143
#55 0x8052490 in rb_eval (self=1074847492, node=0x4010f73c) at eval.c:1610
#56 0x805314c in rb_eval (self=1074847492, node=0x4010f494) at eval.c:1860
#57 0x8056d4d in rb_yield_0 (val=135461676, self=1074847492) at eval.c:2919
#58 0x8056eae in rb_yield (val=135461676) at eval.c:2956
#59 0x80aad3b in ary_each (ary=1075284280) at array.c:571
#60 0x805815c in rb_call0 (klass=1074959472, recv=1075284280, id=3529, argc=0,
argv=0x0, body=0x40129128, nosuper=1) at eval.c:3378
#61 0x80591b4 in rb_call (klass=1074959472, recv=1075284280, mid=3529, argc=0,
argv=0x0, scope=0) at eval.c:3651
#62 0x8053a18 in rb_eval (self=1074847492, node=0x4010f9f8) at eval.c:1983
#63 0x8052d7c in rb_eval (self=1074847492, node=0x4010f458) at eval.c:1790
#64 0x8052490 in rb_eval (self=1074847492, node=0x4010f41c) at eval.c:1610
#65 0x8058d4b in rb_call0 (klass=1074846492, recv=1074847492, id=8817, argc=0,
argv=0xbfffe88c, body=0x4010f430, nosuper=0) at eval.c:3570
#66 0x80591b4 in rb_call (klass=1074846492, recv=1074847492, mid=8817, argc=3,
argv=0xbfffe880, scope=0) at eval.c:3651
#67 0x8053a18 in rb_eval (self=1074983152, node=0x4011e1d8) at eval.c:1983
#68 0x8052490 in rb_eval (self=1074983152, node=0x4011e1b0) at eval.c:1610
#69 0x805314c in rb_eval (self=1074983152, node=0x4011ca68) at eval.c:1860
#70 0x8052490 in rb_eval (self=1074983152, node=0x4011ca40) at eval.c:1610
#71 0x8052490 in rb_eval (self=1074983152, node=0x4011c964) at eval.c:1610
#72 0x80507ef in eval_node (self=1074983152) at eval.c:927
#73 0x80508ca in ruby_run () at eval.c:957
#74 0x804f32d in main (argc=4, argv=0xbffffd3c, envp=0xbffffd50) at main.c:32
(gdb) q
長過ぎたか。(^^;