ふと、Rubicon を ruby -w で動かすと core を吐くことがあることに気がつ
きました。

具体的には(私のマシンでは)次の手順で core を吐かせられます。

cd /tmp 
rm -rf zzzzzzzzz ruby rubicon

mkdir zzzzzzzzz
cvs -d :pserver:anonymous / cvs.ruby-lang.org:/src co ruby
cvs -d :pserver:anonymous / cvs.ruby-lang.org:/src co rubicon
cd ruby
autoconf
./configure --prefix=/tmp/zzzzzzzzz && make && make install
PATH=/tmp/zzzzzzzzz/bin:$PATH
export PATH
cd ../rubicon
make util/checkstat util/test_touch
ruby -w AllTests.rb 

とすると、最後の ruby -w AllTests.rb で

TestArray: S
TestBignum: /tmp/zzzzzzzzz/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:103: [BUG] Segmentation fault
ruby 1.8.0 (2003-03-12) [i686-linux]
........F................................................................/tmp/tst: line 16:  3785 Aborted                 (core dumped) ruby -w AllTests.rb

というように core を吐きます。

stacktrace は次のようになります。

% gdb /tmp/zzzzzzzzz/bin/ruby core
gdb: Symbol `emacs_ctlx_keymap' has different size in shared object, consider re-linking
GNU gdb 2002-04-01-cvs
Copyright 2002 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"...
Core was generated by `ruby -w AllTests.rb'.
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
#0  0x40094581 in kill () from /lib/libc.so.6
(gdb) where
#0  0x40094581 in kill () from /lib/libc.so.6
#1  0x40094394 in raise () from /lib/libc.so.6
#2  0x400958d1 in abort () from /lib/libc.so.6
#3  0x080c0c57 in rb_bug () at error.c:174
#4  0x080a57df in sigsegv () at signal.c:412
#5  0x40094518 in sigaction () from /lib/libc.so.6
#6  0x08051a94 in search_method (klass=1075308160, id=43, origin=0xbfff3f44) at eval.c:299
#7  0x08051ad8 in rb_get_method_body (klassp=0xbfff3f94, idp=0xbfff3f84, noexp=0xbfff3f88) at eval.c:317
#8  0x0805b7d4 in rb_call (klass=1075308160, recv=1075308168, mid=43, argc=1, argv=0xbfff3fb4, scope=0) at eval.c:4879
#9  0x08056831 in rb_eval (self=1075564536, n=0x401ed770) at eval.c:2833
#10 0x080568bf in rb_eval (self=1075564536, n=0x401ed6d0) at eval.c:2843
#11 0x0805b529 in rb_call0 (klass=1075749336, recv=1075564536, id=12689, oid=12689, argc=0, argv=0x817ca54, 
    body=0x401ed6d0, nosuper=0) at eval.c:4814
#12 0x08060530 in method_call (argc=1, argv=0x817ca50, method=1075432072) at eval.c:7095
#13 0x08060c10 in bmcall (args=1075340492, method=1075432072) at eval.c:7254
#14 0x08059430 in rb_yield_0 (val=1075340492, self=1075534252, klass=0, pcall=2, avalue=2) at eval.c:3956
#15 0x0805f6b8 in proc_invoke (proc=1075431332, args=1075339592, pcall=2, self=6) at eval.c:6698
#16 0x0805f7b9 in proc_call (proc=1075431332, args=1075339592) at eval.c:6735
#17 0x0805af2e in rb_call0 (klass=1075480492, recv=1075431332, id=6121, oid=6121, argc=1, argv=0xbfff51d4, 
    body=0x401a8748, nosuper=1) at eval.c:4558
#18 0x0805b936 in rb_call (klass=1075480492, recv=1075431332, mid=6121, argc=1, argv=0xbfff51d4, scope=0) at eval.c:4903
#19 0x08056831 in rb_eval (self=1075436952, n=0x40209b78) at eval.c:2833
#20 0x08059445 in rb_yield_0 (val=1075431332, self=1075436952, klass=0, pcall=0, avalue=0) at eval.c:3959
#21 0x08059679 in rb_yield (val=1075431332) at eval.c:4027
#22 0x080b64f4 in rb_ary_each (ary=1075339692) at array.c:784
#23 0x0805af61 in rb_call0 (klass=1075509252, recv=1075339692, id=3793, oid=3793, argc=0, argv=0x0, body=0x401af408, 
    nosuper=1) at eval.c:4564
#24 0x0805b936 in rb_call (klass=1075509252, recv=1075339692, mid=3793, argc=0, argv=0x0, scope=0) at eval.c:4903
#25 0x08056831 in rb_eval (self=1075436952, n=0x40209c18) at eval.c:2833
#26 0x08055941 in rb_eval (self=1075436952, n=0x40209ce0) at eval.c:2558
#27 0x0805b529 in rb_call0 (klass=1075752116, recv=1075436952, id=11601, oid=11601, argc=1, argv=0xbfff6678, 
    body=0x40209ce0, nosuper=0) at eval.c:4814
#28 0x0805b936 in rb_call (klass=1075752116, recv=1075436952, mid=11601, argc=2, argv=0xbfff6674, scope=1) at eval.c:4903
#29 0x08056a2c in rb_eval (self=1075436952, n=0x401eb790) at eval.c:2847
#30 0x08059445 in rb_yield_0 (val=1075340952, self=1075436952, klass=0, pcall=0, avalue=0) at eval.c:3959
#31 0x08055d3e in rb_eval (self=1075449732, n=0x401f5fec) at eval.c:2643
#32 0x0805b529 in rb_call0 (klass=1075778736, recv=1075449732, id=6025, oid=6025, argc=0, argv=0xbfff73c8, 
    body=0x401f5fec, nosuper=0) at eval.c:4814
#33 0x0805b936 in rb_call (klass=1075778736, recv=1075449732, mid=6025, argc=1, argv=0xbfff73c4, scope=3) at eval.c:4903
---Type <return> to continue, or q <return> to quit---
#34 0x08056cd3 in rb_eval (self=1075449732, n=0x4020def8) at eval.c:2884
#35 0x0805fd98 in block_pass (self=1075449732, node=0x4020df0c) at eval.c:6898
#36 0x080557e0 in rb_eval (self=1075449732, n=0x4020e024) at eval.c:2544
#37 0x0805b529 in rb_call0 (klass=1075778776, recv=1075449732, id=6025, oid=6025, argc=0, argv=0xbfff8138, 
    body=0x4020e024, nosuper=0) at eval.c:4814
#38 0x0805b936 in rb_call (klass=1075778776, recv=1075449732, mid=6025, argc=1, argv=0xbfff8134, scope=0) at eval.c:4903
#39 0x08056831 in rb_eval (self=1075541736, n=0x40206d4c) at eval.c:2833
#40 0x0805fd98 in block_pass (self=1075541736, node=0x40206d60) at eval.c:6898
#41 0x080557e0 in rb_eval (self=1075541736, n=0x40206d38) at eval.c:2544
#42 0x08059445 in rb_yield_0 (val=1075449732, self=1075541736, klass=0, pcall=0, avalue=0) at eval.c:3959
#43 0x08059679 in rb_yield (val=1075449732) at eval.c:4027
#44 0x080b64f4 in rb_ary_each (ary=1075415692) at array.c:784
#45 0x0805af61 in rb_call0 (klass=1075509252, recv=1075415692, id=3793, oid=3793, argc=0, argv=0x0, body=0x401af408, 
    nosuper=1) at eval.c:4564
#46 0x0805b936 in rb_call (klass=1075509252, recv=1075415692, mid=3793, argc=0, argv=0x0, scope=0) at eval.c:4903
#47 0x08056831 in rb_eval (self=1075541736, n=0x40206e14) at eval.c:2833
#48 0x08055941 in rb_eval (self=1075541736, n=0x40207030) at eval.c:2558
#49 0x0805b529 in rb_call0 (klass=1075864496, recv=1075541736, id=6025, oid=6025, argc=0, argv=0xbfff9c18, 
    body=0x40207030, nosuper=0) at eval.c:4814
#50 0x0805b936 in rb_call (klass=1075864496, recv=1075541736, mid=6025, argc=1, argv=0xbfff9c14, scope=3) at eval.c:4903
#51 0x08056cd3 in rb_eval (self=1075541736, n=0x40207954) at eval.c:2884
#52 0x0805fd98 in block_pass (self=1075541736, node=0x40207968) at eval.c:6898
#53 0x080557e0 in rb_eval (self=1075541736, n=0x40207a80) at eval.c:2544
#54 0x0805b529 in rb_call0 (klass=1075864536, recv=1075541736, id=6025, oid=6025, argc=0, argv=0xbfffa988, 
    body=0x40207a80, nosuper=0) at eval.c:4814
#55 0x0805b936 in rb_call (klass=1075864536, recv=1075541736, mid=6025, argc=1, argv=0xbfffa984, scope=0) at eval.c:4903
#56 0x08056831 in rb_eval (self=1075436952, n=0x401eb8bc) at eval.c:2833
#57 0x08055941 in rb_eval (self=1075436952, n=0x401ebe84) at eval.c:2558
#58 0x0805b529 in rb_call0 (klass=1075752396, recv=1075436952, id=12705, oid=12705, argc=0, argv=0x0, body=0x401ebe84, 
    nosuper=0) at eval.c:4814
#59 0x0805b936 in rb_call (klass=1075752396, recv=1075436952, mid=12705, argc=0, argv=0x0, scope=0) at eval.c:4903
#60 0x08056831 in rb_eval (self=1075564536, n=0x401ee2d8) at eval.c:2833
#61 0x08056312 in rb_eval (self=1075564536, n=0x401ee260) at eval.c:2781
#62 0x0805b529 in rb_call0 (klass=1075749336, recv=1075564536, id=12641, oid=12641, argc=0, argv=0x0, body=0x401ee260, 
    nosuper=0) at eval.c:4814
#63 0x0805b936 in rb_call (klass=1075749336, recv=1075564536, mid=12641, argc=0, argv=0x0, scope=2) at eval.c:4903
#64 0x08056a9c in rb_eval (self=1075564536, n=0x401eef30) at eval.c:2853
#65 0x08056312 in rb_eval (self=1075564536, n=0x401eef6c) at eval.c:2781
#66 0x0805b529 in rb_call0 (klass=1075749336, recv=1075564536, id=5945, oid=5945, argc=0, argv=0x0, body=0x401eef6c, 
---Type <return> to continue, or q <return> to quit---
    nosuper=0) at eval.c:4814
#67 0x0805b936 in rb_call (klass=1075749336, recv=1075564536, mid=5945, argc=0, argv=0x0, scope=2) at eval.c:4903
#68 0x08056a9c in rb_eval (self=1075564536, n=0x401f07e0) at eval.c:2853
#69 0x0805b529 in rb_call0 (klass=1075748396, recv=1075564536, id=6025, oid=6025, argc=0, argv=0xbfffd478, 
    body=0x401f07e0, nosuper=0) at eval.c:4814
#70 0x0805b936 in rb_call (klass=1075748396, recv=1075564536, mid=6025, argc=1, argv=0xbfffd474, scope=0) at eval.c:4903
#71 0x08056831 in rb_eval (self=1075743516, n=0x401866fc) at eval.c:2833
#72 0x080566c7 in rb_eval (self=1075743516, n=0x40186b84) at eval.c:2829
#73 0x08059445 in rb_yield_0 (val=1075725616, self=1075743516, klass=0, pcall=0, avalue=0) at eval.c:3959
#74 0x08059679 in rb_yield (val=1075725616) at eval.c:4027
#75 0x080b64f4 in rb_ary_each (ary=1075743476) at array.c:784
#76 0x0805af61 in rb_call0 (klass=1075509252, recv=1075743476, id=3793, oid=3793, argc=0, argv=0x0, body=0x401af408, 
    nosuper=1) at eval.c:4564
#77 0x0805b936 in rb_call (klass=1075509252, recv=1075743476, mid=3793, argc=0, argv=0x0, scope=0) at eval.c:4903
#78 0x08056831 in rb_eval (self=1075743516, n=0x40186cd8) at eval.c:2833
#79 0x08055941 in rb_eval (self=1075743516, n=0x401865bc) at eval.c:2558
#80 0x0805b529 in rb_call0 (klass=1075746316, recv=1075743516, id=6025, oid=6025, argc=0, argv=0x0, body=0x401865bc, 
    nosuper=0) at eval.c:4814
#81 0x0805b936 in rb_call (klass=1075746316, recv=1075743516, mid=6025, argc=0, argv=0x0, scope=0) at eval.c:4903
#82 0x08056831 in rb_eval (self=1075534252, n=0x401a6b00) at eval.c:2833
#83 0x0805736a in rb_eval (self=1075534252, n=0x401a7370) at eval.c:3007
#84 0x08052be4 in eval_node (self=1075534252, node=0x401a7370) at eval.c:1168
#85 0x0805302c in ruby_exec () at eval.c:1314
#86 0x08053099 in ruby_run () at eval.c:1335
#87 0x08051582 in main (argc=3, argv=0xbffff994, envp=0xbffff9a4) at main.c:50
(gdb) 

ただ、かなり微妙な条件のようで、今のところ問題を絞り込めていません。
(少なくとも prefix の長さに依存することは分かっています。z の数がひと
つ多くても少なくても再現しません。)

問題を絞り込もうとは思ったのですが、TestBignum.rb だけでは core を吐か
ないし、AllTests.rb の最後の exit(failure_count) の行を削っただけでも
core を吐かなくなるので手に負えません。というわけで、現時点でとりあえ
ず報告しておきます。

環境は Debian (testing/unstable) です。

% uname -a
Linux serein 2.4.20-686 #1 Mon Jan 13 22:22:30 EST 2003 i686 Mobile Intel(R) Pentium(R) III CPU - M  1200MHz GenuineIntel GNU/Linux
-- 
[田中 哲][たなか あきら][Tanaka Akira]