さきほど、cvs update したところ、とあるプログラム(五月雨)が core dump
するようになりました。

update するまえの ChangeLog の revision は 1.3272 で、したあとの
revision は 1.3282 でした。その後にまつもとさんの commit が入ったので、
先端はさらに進んでいますが、先端でも再現します。

clean build しても再現するので、なにか問題が入ったのではないかと思いま
す。

% gdb ../bin/ruby core
GNU gdb 6.1-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 `../bin/ruby -v -I../htree main.rb -v'.
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 /tmp/z/lib/ruby/1.9/i686-linux/stringio.so...done.
Loaded symbols for /tmp/z/lib/ruby/1.9/i686-linux/stringio.so
Reading symbols from /tmp/z/lib/ruby/1.9/i686-linux/syck.so...done.
Loaded symbols for /tmp/z/lib/ruby/1.9/i686-linux/syck.so
Reading symbols from /tmp/z/lib/ruby/1.9/i686-linux/iconv.so...done.
Loaded symbols for /tmp/z/lib/ruby/1.9/i686-linux/iconv.so
Reading symbols from /tmp/z/lib/ruby/1.9/i686-linux/socket.so...done.
Loaded symbols for /tmp/z/lib/ruby/1.9/i686-linux/socket.so
Reading symbols from /tmp/z/lib/ruby/1.9/i686-linux/zlib.so...done.
Loaded symbols for /tmp/z/lib/ruby/1.9/i686-linux/zlib.so
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /tmp/z/lib/ruby/1.9/i686-linux/fcntl.so...done.
Loaded symbols for /tmp/z/lib/ruby/1.9/i686-linux/fcntl.so
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /usr/lib/gconv/EUC-JP.so...done.
Loaded symbols for /usr/lib/gconv/EUC-JP.so
Reading symbols from /usr/lib/gconv/libJIS.so...done.
Loaded symbols for /usr/lib/gconv/libJIS.so
#0  0x4009d721 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x4009d721 in kill () from /lib/libc.so.6
#1  0x4009d4c5 in raise () from /lib/libc.so.6
#2  0x4009e9e8 in abort () from /lib/libc.so.6
#3  0x080d0106 in rb_bug (fmt=0x0) at error.c:208
#4  0x080aefb2 in sigsegv (sig=11) at signal.c:443
#5  <signal handler called>
#6  0x0805f4ee in eval (self=1078037572, src=1086067024, scope=1075605620, 
    file=0x80db2b3 "(eval)", line=1) at eval.c:6047
#7  0x0805f66a in rb_f_eval (argc=2, argv=0x0, self=1078037572) at eval.c:6200
#8  0x0806a09a in call_cfunc (func=0x805f580 <rb_f_eval>, recv=1078037572, 
    len=135490776, argc=135490776, argv=0xbfff6398) at eval.c:5370
#9  0x0805e338 in rb_call0 (klass=1075674280, recv=1078037572, id=3937, oid=0, 
    argc=2, argv=0xbfff6398, body=0x401d6268, nosuper=0) at eval.c:5504
#10 0x0805e568 in rb_call (klass=1075674280, recv=1078037572, mid=3937, 
    argc=2, argv=0xbfff6398, scope=1) at eval.c:5721
#11 0x080595c0 in rb_eval (self=1078037572, n=0x0) at ruby.h:634
#12 0x0805921e in rb_eval (self=1078037572, n=0x0) at eval.c:3209
#13 0x08058b8c in rb_eval (self=1078037572, n=0x0) at eval.c:3385
#14 0x08057a6b in rb_eval (self=1078037572, n=0x0) at eval.c:2667
#15 0x0805de3b in rb_call0 (klass=1077952672, recv=1078037572, id=12145, 
    oid=0, argc=3, argv=0xbfff7ed8, body=0x403be064, nosuper=0) at eval.c:5628
#16 0x0805e568 in rb_call (klass=1077952672, recv=1078037572, mid=12145, 
    argc=3, argv=0xbfff7ed8, scope=0) at eval.c:5721
#17 0x0805934b in rb_eval (self=1077451532, n=0x0) at ruby.h:634
#18 0x08058b8c in rb_eval (self=1077451532, n=0x0) at eval.c:3385
#19 0x0805de3b in rb_call0 (klass=1077454312, recv=1077451532, id=12129, 
    oid=0, argc=0, argv=0xbfff8d6c, body=0x4022d6e8, nosuper=0) at eval.c:5628
#20 0x0805e568 in rb_call (klass=1077454312, recv=1077451532, mid=12129, 
    argc=1, argv=0xbfff8d68, scope=1) at eval.c:5721
#21 0x080595c0 in rb_eval (self=1077451532, n=0x0) at ruby.h:634
#22 0x0805c3b3 in rb_yield_0 (val=1077223572, self=1077451532, klass=0, 
    flags=0, avalue=0) at eval.c:4711
#23 0x08059b18 in rb_eval (self=1077451532, n=0x0) at eval.c:3011
#24 0x0805c3b3 in rb_yield_0 (val=1077223692, self=1077451532, klass=0, 
    flags=0, avalue=2) at eval.c:4711
#25 0x08059b18 in rb_eval (self=1077451532, n=0x0) at eval.c:3011
#26 0x0805c3b3 in rb_yield_0 (val=1077223752, self=1077451532, klass=0, 
    flags=0, avalue=0) at eval.c:4711
#27 0x0805c899 in rb_yield (val=0) at eval.c:4793
---Type <return> to continue, or q <return> to quit---
#28 0x0805d6a9 in rb_ensure (b_proc=0x805c870 <rb_yield>, data1=1077223752, 
    e_proc=0x8077630 <io_close>, data2=1077223752) at eval.c:5179
#29 0x08078aa5 in rb_io_s_open (argc=0, argv=0x0, klass=0) at io.c:2946
#30 0x0806a09a in call_cfunc (func=0x8078a50 <rb_io_s_open>, recv=1075628900, 
    len=135490776, argc=135490776, argv=0xbfffa818) at eval.c:5370
#31 0x0805e338 in rb_call0 (klass=1075632720, recv=1075628900, id=7329, oid=0, 
    argc=2, argv=0xbfffa818, body=0x401cd9d8, nosuper=0) at eval.c:5504
#32 0x0805e568 in rb_call (klass=1075632720, recv=1075628900, mid=7329, 
    argc=2, argv=0xbfffa818, scope=0) at eval.c:5721
#33 0x0805934b in rb_eval (self=1077451532, n=0x0) at ruby.h:634
#34 0x080586a3 in rb_eval (self=1077451532, n=0x0) at eval.c:2935
#35 0x08058ad2 in rb_eval (self=1077451532, n=0x0) at eval.c:3071
#36 0x08058ad2 in rb_eval (self=1077451532, n=0x0) at eval.c:3071
#37 0x0805c3b3 in rb_yield_0 (val=1, self=1077451532, klass=0, flags=0, 
    avalue=0) at eval.c:4711
#38 0x0805c899 in rb_yield (val=0) at eval.c:4793
#39 0x080843df in int_dotimes (num=3) at numeric.c:2728
#40 0x0806a0a1 in call_cfunc (func=0x8084390 <int_dotimes>, recv=3, 
    len=135490776, argc=135490776, argv=0x0) at eval.c:5373
#41 0x0805e338 in rb_call0 (klass=1075655680, recv=3, id=5441, oid=0, argc=0, 
    argv=0x0, body=0x401d3338, nosuper=0) at eval.c:5504
#42 0x0805e568 in rb_call (klass=1075655680, recv=3, mid=5441, argc=0, 
    argv=0x0, scope=0) at eval.c:5721
#43 0x0805934b in rb_eval (self=1077451532, n=0x0) at ruby.h:634
#44 0x080586a3 in rb_eval (self=1077451532, n=0x0) at eval.c:2935
#45 0x0805de3b in rb_call0 (klass=1077454312, recv=1077451532, id=11889, 
    oid=0, argc=0, argv=0xbfffd3d0, body=0x401a8304, nosuper=0) at eval.c:5628
#46 0x0805e568 in rb_call (klass=1077454312, recv=1077451532, mid=11889, 
    argc=2, argv=0xbfffd3c8, scope=1) at eval.c:5721
#47 0x080595c0 in rb_eval (self=1077451532, n=0x0) at ruby.h:634
#48 0x080586a3 in rb_eval (self=1077451532, n=0x0) at eval.c:2935
#49 0x0805de3b in rb_call0 (klass=1077454312, recv=1077451532, id=12065, 
    oid=0, argc=0, argv=0xbfffe24c, body=0x4022e2b4, nosuper=0) at eval.c:5628
#50 0x0805e568 in rb_call (klass=1077454312, recv=1077451532, mid=12065, 
    argc=1, argv=0xbfffe248, scope=1) at eval.c:5721
#51 0x080595c0 in rb_eval (self=1077451532, n=0x0) at ruby.h:634
#52 0x080586a3 in rb_eval (self=1077451532, n=0x0) at eval.c:2935
#53 0x0805de3b in rb_call0 (klass=1077454312, recv=1077451532, id=5097, oid=0, 
    argc=0, argv=0x0, body=0x40228c60, nosuper=0) at eval.c:5628
---Type <return> to continue, or q <return> to quit---
#54 0x0805e568 in rb_call (klass=1077454312, recv=1077451532, mid=5097, 
    argc=0, argv=0x0, scope=0) at eval.c:5721
#55 0x0805934b in rb_eval (self=1075669480, n=0x0) at ruby.h:634
#56 0x0805586b in ruby_exec () at eval.c:1460
#57 0x080558b0 in ruby_run () at eval.c:1481
#58 0x08053985 in main (argc=0, argv=0x0, envp=0xbffff99c) at main.c:50
(gdb) 
(gdb) up
#1  0x4009d4c5 in raise () from /lib/libc.so.6
(gdb) 
#2  0x4009e9e8 in abort () from /lib/libc.so.6
(gdb) 
#3  0x080d0106 in rb_bug (fmt=0x0) at error.c:208
208         abort();
(gdb) 
#4  0x080aefb2 in sigsegv (sig=11) at signal.c:443
443         rb_bug("Segmentation fault");
(gdb) 
#5  <signal handler called>
(gdb) 
#6  0x0805f4ee in eval (self=1078037572, src=1086067024, scope=1075605620, 
    file=0x80db2b3 "(eval)", line=1) at eval.c:6047
6047                file = data->frame.node->nd_file;
(gdb) p data
$1 = (struct BLOCK *) 0x8136cd8
(gdb) p data->frame
$2 = {self = 1075669480, argc = 0, argv = 0x0, last_func = 0, orig_func = 0, 
  last_class = 0, prev = 0x0, tmp = 0x0, node = 0x0, iter = 0, flags = 0, 
  uniq = 0}
(gdb) p data->frame.node
$3 = (struct RNode *) 0x0
(gdb) 

再現手順は以下のようになります。

mkdir /tmp/z
cd /tmp/z
cvs -d :pserver:anonymous / cvs.ruby-lang.org:/src co ruby
cd ruby
autoconf
./configure --prefix=/tmp/z
make
make install
cd ..
cvs -d :pserver:anonymous / cvs.m17n.org:/cvs/ruby co samidare
cvs -d :pserver:anonymous / cvs.m17n.org:/cvs/ruby co htree
cd samidare
../bin/ruby -v -I../htree main.rb -v
-- 
[田中 哲][たなか あきら][Tanaka Akira]