昨日の夜からとあるプログラム (五月雨) が 4回ばかり core を吐いていて、
それらで最後に GC が起きた所が一致しています。

そこでその場所で常に GC が起きるように

Index: eval.c
===================================================================
RCS file: /src/ruby/eval.c,v
retrieving revision 1.754
diff -u -p -r1.754 eval.c
--- eval.c	17 Feb 2005 14:29:20 -0000	1.754
+++ eval.c	17 Feb 2005 23:02:33 -0000
@@ -10014,6 +10014,7 @@ rb_thread_save_context(th)
     th->stk_len = 0;
     th->stk_pos = pos;
     if (len > th->stk_max) {
+        rb_gc();
 	REALLOC_N(th->stk_ptr, VALUE, len);
 	th->stk_max = len;
     }

としてみると、

% make test-all                                                                   
./miniruby ./runruby.rb --extout=.ext -- -C "./test" runner.rb --runner=console 
: [BUG] unknown node type 0
ruby 1.9.0 (2005-02-17) [i686-linux]

というように core を吐きました。

% gdb ruby test/core 
GNU gdb 6.3-debian
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 "i386-linux"...Using host libthread_db library "/lib/libthread_db.so.1".

Core was generated by `./ruby -C ./test runner.rb --runner=console'.
Program terminated with signal 6, Aborted.
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/etc.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/etc.so
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/dbm.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/dbm.so
Reading symbols from /usr/lib/libgdbm_compat.so.3...done.
Loaded symbols for /usr/lib/libgdbm_compat.so.3
Reading symbols from /usr/lib/libgdbm.so.3...done.
Loaded symbols for /usr/lib/libgdbm.so.3
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/socket.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/socket.so
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest.so
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/md5.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/md5.so
Reading symbols from /usr/lib/i686/cmov/libcrypto.so.0.9.7...done.
Loaded symbols for /usr/lib/i686/cmov/libcrypto.so.0.9.7
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/rmd160.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/rmd160.so
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/sha1.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/sha1.so
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/sha2.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/digest/sha2.so
Reading symbols from /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/fcntl.so...done.
Loaded symbols for /home/akr/ruby/head-ruby/ruby/.ext/i686-linux/fcntl.so
#0  0x4009e741 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x4009e741 in kill () from /lib/libc.so.6
#1  0x4009e4c5 in raise () from /lib/libc.so.6
#2  0x4009fa08 in abort () from /lib/libc.so.6
#3  0x080de2e6 in rb_bug (fmt=0x0) at error.c:214
#4  0x0805b6bd in rb_eval (self=1077451676, n=0x0) at eval.c:3902
#5  0x0805b87d in module_setup (module=0, n=0x403b826c) at eval.c:3951
#6  0x0805abd4 in rb_eval (self=1075673536, n=0x0) at eval.c:3887
#7  0x08060b3c in rb_load (fname=1077646796, wrap=0) at eval.c:6555
#8  0x080615b7 in rb_require_safe (fname=1077676096, safe=0) at eval.c:6875
#9  0x0806b5b2 in call_cfunc (func=0x8061030 <rb_f_require>, recv=1075673536, len=1075463648, argc=6, argv=0xbfff6c38)
    at eval.c:5452
#10 0x0805ed72 in rb_call0 (klass=1075678356, recv=1075673536, id=9729, oid=0, argc=1, argv=0xbfff6c38, body=0x401c9424, 
    nosuper=0) at eval.c:5596
#11 0x0805f038 in rb_call (klass=1075678356, recv=1075673536, mid=9729, argc=1, argv=0xbfff6c38, scope=1) at eval.c:5818
#12 0x08059a4b in rb_eval (self=1075673536, n=0x0) at ruby.h:635
#13 0x08060b3c in rb_load (fname=1077676216, wrap=0) at eval.c:6555
#14 0x080615b7 in rb_require_safe (fname=1077676376, safe=0) at eval.c:6875
#15 0x0806b5b2 in call_cfunc (func=0x8061030 <rb_f_require>, recv=1075826540, len=1075463648, argc=6, argv=0xbfff7758)
    at eval.c:5452
#16 0x0805ed72 in rb_call0 (klass=1075678356, recv=1075826540, id=9729, oid=0, argc=1, argv=0xbfff7758, body=0x401c9424, 
    nosuper=0) at eval.c:5596
#17 0x0805f038 in rb_call (klass=1075678356, recv=1075826540, mid=9729, argc=1, argv=0xbfff7758, scope=1) at eval.c:5818
#18 0x08059a4b in rb_eval (self=1075826540, n=0x0) at ruby.h:635
#19 0x08059222 in rb_eval (self=1075826540, n=0x0) at eval.c:3089
#20 0x0805e873 in rb_call0 (klass=1075811520, recv=1075826540, id=13657, oid=0, argc=0, argv=0xbfff8604, body=0x401fa730, 
    nosuper=0) at eval.c:5725
#21 0x0805f038 in rb_call (klass=1075811520, recv=1075826540, mid=13657, argc=3, argv=0xbfff85f8, scope=1) at eval.c:5818
#22 0x08059a4b in rb_eval (self=1075826540, n=0x0) at ruby.h:635
#23 0x0805cbac in rb_yield_0 (val=1077730656, self=1075826540, klass=0, flags=0, avalue=0) at eval.c:4789
#24 0x0805d1f9 in rb_yield (val=0) at eval.c:4871
#25 0x080d0e1f in rb_ary_each (ary=1077730796) at array.c:1255
#26 0x0806b5e1 in call_cfunc (func=0x80d0df0 <rb_ary_each>, recv=1077730796, len=1075463648, argc=6, argv=0x0)
    at eval.c:5458
#27 0x0805ed72 in rb_call0 (klass=1075647656, recv=1077730796, id=3865, oid=0, argc=0, argv=0x0, body=0x401d1084, 
    nosuper=0) at eval.c:5596
#28 0x0805f038 in rb_call (klass=1075647656, recv=1077730796, mid=3865, argc=0, argv=0x0, scope=0) at eval.c:5818
#29 0x08059a4b in rb_eval (self=1075826540, n=0x0) at ruby.h:635
#30 0x08058df4 in rb_eval (self=1075826540, n=0x0) at eval.c:2953
#31 0x0805e873 in rb_call0 (klass=1075811520, recv=1075826540, id=13585, oid=0, argc=0, argv=0xbfff9f30, body=0x401faeec, 
---Type <return> to continue, or q <return> to quit---
    nosuper=0) at eval.c:5725
#32 0x0805f038 in rb_call (klass=1075811520, recv=1075826540, mid=13585, argc=2, argv=0xbfff9f28, scope=1) at eval.c:5818
#33 0x08059a4b in rb_eval (self=1075826540, n=0x0) at ruby.h:635
#34 0x08059377 in rb_eval (self=1075826540, n=0x0) at eval.c:3424
#35 0x0805cbac in rb_yield_0 (val=1075810600, self=1075826540, klass=0, flags=0, avalue=0) at eval.c:4789
#36 0x0805d1f9 in rb_yield (val=0) at eval.c:4871
#37 0x080d0e1f in rb_ary_each (ary=1075810960) at array.c:1255
#38 0x0806b5e1 in call_cfunc (func=0x80d0df0 <rb_ary_each>, recv=1075810960, len=1075463648, argc=6, argv=0x0)
    at eval.c:5458
#39 0x0805ed72 in rb_call0 (klass=1075647656, recv=1075810960, id=3865, oid=0, argc=0, argv=0x0, body=0x401d1084, 
    nosuper=0) at eval.c:5596
#40 0x0805f038 in rb_call (klass=1075647656, recv=1075810960, mid=3865, argc=0, argv=0x0, scope=0) at eval.c:5818
#41 0x08059a4b in rb_eval (self=1075826540, n=0x0) at ruby.h:635
#42 0x08058df4 in rb_eval (self=1075826540, n=0x0) at eval.c:2953
#43 0x0805e873 in rb_call0 (klass=1075811520, recv=1075826540, id=13585, oid=0, argc=0, argv=0xbfffbeb0, body=0x401faeec, 
    nosuper=0) at eval.c:5725
#44 0x0805f038 in rb_call (klass=1075811520, recv=1075826540, mid=13585, argc=2, argv=0xbfffbea8, scope=1) at eval.c:5818
#45 0x08059a4b in rb_eval (self=1075826540, n=0x0) at ruby.h:635
#46 0x0805e873 in rb_call0 (klass=1075811520, recv=1075826540, id=3761, oid=0, argc=1, argv=0xbfffc6e8, body=0x401fc044, 
    nosuper=0) at eval.c:5725
#47 0x0805f038 in rb_call (klass=1075811520, recv=1075826540, mid=3761, argc=1, argv=0xbfffc6e8, scope=0) at eval.c:5818
#48 0x08059a4b in rb_eval (self=1075861740, n=0x0) at ruby.h:635
#49 0x0805cbac in rb_yield_0 (val=1075860020, self=1075861740, klass=0, flags=2, avalue=0) at eval.c:4789
#50 0x08063e4f in proc_invoke (proc=1075861300, args=1075860020, self=6, klass=0) at ruby.h:635
#51 0x08063f37 in proc_call (proc=0, args=0) at eval.c:8320
#52 0x0806b5b2 in call_cfunc (func=0x8063f10 <proc_call>, recv=1075861300, len=1075463648, argc=6, argv=0xbfffd368)
    at eval.c:5452
#53 0x0805ed72 in rb_call0 (klass=1075614176, recv=1075861300, id=333, oid=0, argc=1, argv=0xbfffd368, body=0x401c90dc, 
    nosuper=0) at eval.c:5596
#54 0x0805f038 in rb_call (klass=1075614176, recv=1075861300, mid=333, argc=1, argv=0xbfffd368, scope=0) at eval.c:5818
#55 0x08059a4b in rb_eval (self=1075860020, n=0x0) at ruby.h:635
#56 0x080593d5 in rb_eval (self=1075860020, n=0x0) at eval.c:3434
#57 0x0805e873 in rb_call0 (klass=1075861740, recv=1075860020, id=5161, oid=0, argc=0, argv=0x0, body=0x40229aa8, 
    nosuper=0) at eval.c:5725
#58 0x0805f038 in rb_call (klass=1075861740, recv=1075860020, mid=5161, argc=0, argv=0x0, scope=0) at eval.c:5818
#59 0x08059a4b in rb_eval (self=1075861740, n=0x0) at ruby.h:635
#60 0x0805e873 in rb_call0 (klass=1075861720, recv=1075861740, id=5161, oid=0, argc=0, argv=0xbfffea30, body=0x4022f19c, 
    nosuper=0) at eval.c:5725
#61 0x0805f038 in rb_call (klass=1075861720, recv=1075861740, mid=5161, argc=2, argv=0xbfffea28, scope=0) at eval.c:5818
---Type <return> to continue, or q <return> to quit---
#62 0x08059a4b in rb_eval (self=1075673536, n=0x0) at ruby.h:635
#63 0x08059d6c in rb_eval (self=1075673536, n=0x0) at ruby.h:664
#64 0x08055f66 in ruby_exec_internal () at eval.c:1501
#65 0x08055f86 in ruby_exec () at eval.c:1522
#66 0x08055fd0 in ruby_run () at eval.c:1539
#67 0x08053f55 in main (argc=0, argv=0x0, envp=0xbffff8ac) at main.c:38
(gdb) 
-- 
[田中 哲][たなか あきら][Tanaka Akira]