[ruby-dev:24273] Array#delete causes core dump
From:
Tanaka Akira <akr@...17n.org>
Date:
2004-09-15 09:16:04 UTC
List:
ruby-dev #24273
次のようにすると core を吐きます。
% ./ruby -e '
arr = (0...100).to_a
o = Object.new
class << o; self end.__send__(:define_method, :==) {|a|
arr.clear; arr.compact!
false
}
arr[50] = o
arr.delete(80)
p arr
'
-e:10: [BUG] Segmentation fault
ruby 1.9.0 (2004-09-14) [i686-linux]
zsh: abort (core dumped) ./ruby -e
% gdb 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 `./ruby -e
arr = (0...100).to_a
o = Object.new
class << o; self end.__send__(:d'.
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 0x4009e721 in kill () from /lib/libc.so.6
(gdb) bt
#0 0x4009e721 in kill () from /lib/libc.so.6
#1 0x4009e4c5 in raise () from /lib/libc.so.6
#2 0x4009f9e8 in abort () from /lib/libc.so.6
#3 0x080d0b76 in rb_bug (fmt=0x0) at error.c:214
#4 0x080af192 in sigsegv (sig=11) at signal.c:446
#5 <signal handler called>
#6 0x401a5431 in __after_morecore_hook () from /lib/libc.so.6
#7 0xbfffe694 in ?? ()
#8 0xbfffe698 in ?? ()
#9 0xbfffe69c in ?? ()
#10 0xbfffe6a0 in ?? ()
#11 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#12 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#13 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#14 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#15 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#16 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#17 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#18 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#19 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#20 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#21 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#22 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#23 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#24 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#25 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#26 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#27 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#28 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#29 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#30 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#31 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#32 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#33 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#34 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#35 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#36 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#37 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#38 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
#39 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#40 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#41 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#42 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#43 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#44 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#45 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#46 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#47 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#48 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#49 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#50 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#51 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#52 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#53 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#54 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#55 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#56 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#57 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#58 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#59 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#60 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#61 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#62 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#63 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#64 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#65 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#66 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#67 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#68 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#69 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#70 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#71 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#72 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#73 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#74 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#75 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#76 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#77 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
#78 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#79 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#80 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#81 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#82 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#83 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#84 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#85 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#86 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#87 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#88 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#89 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#90 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#91 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#92 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#93 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#94 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#95 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#96 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#97 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#98 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#99 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#100 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#101 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#102 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#103 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#104 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#105 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#106 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#107 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#108 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#109 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#110 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#111 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#112 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#113 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#114 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#115 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#116 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
#117 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#118 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#119 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#120 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#121 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#122 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#123 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#124 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#125 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#126 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#127 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#128 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#129 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#130 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#131 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#132 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#133 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#134 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#135 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#136 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#137 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#138 0x401a513c in __after_morecore_hook () from /lib/libc.so.6
#139 0x08103c30 in cache ()
#140 0x08103c30 in cache ()
#141 0x08103c30 in cache ()
#142 0x08103c30 in cache ()
#143 0x08103c30 in cache ()
#144 0x08103c30 in cache ()
#145 0x08103c30 in cache ()
#146 0x08103c30 in cache ()
#147 0x08103c30 in cache ()
#148 0x08103c30 in cache ()
#149 0x08103c30 in cache ()
#150 0x08103c30 in cache ()
#151 0x08103c30 in cache ()
#152 0x08103c30 in cache ()
#153 0x08103c30 in cache ()
#154 0x08103c30 in cache ()
#155 0x08103c30 in cache ()
---Type <return> to continue, or q <return> to quit---
#156 0x08103c30 in cache ()
#157 0x08103c30 in cache ()
#158 0x08103c30 in cache ()
#159 0x08103c30 in cache ()
#160 0x08103c30 in cache ()
#161 0x08103c30 in cache ()
#162 0x08103c30 in cache ()
#163 0x08103c30 in cache ()
#164 0x08103c30 in cache ()
#165 0x08103c30 in cache ()
#166 0x08103c30 in cache ()
#167 0x08103c30 in cache ()
#168 0x08103c30 in cache ()
#169 0x08103c30 in cache ()
#170 0x08103c30 in cache ()
#171 0x08103c30 in cache ()
#172 0x08103c30 in cache ()
#173 0x08103c30 in cache ()
#174 0x08103c30 in cache ()
#175 0x08103c30 in cache ()
#176 0x08103c30 in cache ()
#177 0x08103c30 in cache ()
#178 0x08103c30 in cache ()
#179 0x08103c30 in cache ()
#180 0x08103c30 in cache ()
#181 0x08103c30 in cache ()
#182 0x08103c30 in cache ()
#183 0x08103c30 in cache ()
#184 0x08103c30 in cache ()
#185 0x08103c30 in cache ()
#186 0x08103c30 in cache ()
#187 0x08103c30 in cache ()
#188 0x08103c30 in cache ()
#189 0x08103c30 in cache ()
#190 0x08103c30 in cache ()
#191 0x08103c30 in cache ()
#192 0x08103c30 in cache ()
#193 0x08103c30 in cache ()
#194 0x080b19b7 in st_lookup (table=0x401a513c, key=3168, value=0xbfffe9b8) at st.c:258
---Type <return> to continue, or q <return> to quit---
#195 0x080540e3 in search_method (klass=1075466556, id=3169, origin=0xbfffe9e4) at eval.c:380
#196 0x08054139 in rb_get_method_body (klassp=0xbfffea40, idp=0xbfffea24, noexp=0xbfffea28) at eval.c:401
#197 0x0805e31a in rb_call (klass=1075466556, recv=1075466564, mid=3169, argc=0, argv=0x0, scope=1) at eval.c:5701
#198 0x0805e744 in rb_funcall (recv=1075466564, mid=1075466740, n=0) at ruby.h:634
#199 0x08085cd6 in rb_inspect (obj=1075466740) at object.c:345
#200 0x080c4451 in inspect_ary (ary=1075607956) at array.c:1528
#201 0x080c41b8 in inspect_call (arg=0x401a513c) at array.c:1447
#202 0x0805d499 in rb_ensure (b_proc=0x80c41a0 <inspect_call>, data1=3221220304, e_proc=0x80c42a0 <inspect_ensure>,
data2=1075607956) at eval.c:5173
#203 0x080c435f in rb_protect_inspect (func=0x80c43b0 <inspect_ary>, obj=1075607956, arg=0) at array.c:1504
#204 0x080c4506 in rb_ary_inspect (ary=1075607956) at array.c:1551
#205 0x08069e91 in call_cfunc (func=0x80c44b0 <rb_ary_inspect>, recv=1075607956, len=1075466556, argc=135281712, argv=0x0)
at eval.c:5367
#206 0x0805e117 in rb_call0 (klass=1075647656, recv=1075607956, id=3169, oid=1075466740, argc=0, argv=0x0,
body=0x401d13a4, nosuper=0) at eval.c:5504
#207 0x0805e3c8 in rb_call (klass=1075647656, recv=1075607956, mid=3169, argc=0, argv=0x0, scope=1) at eval.c:5725
#208 0x0805e744 in rb_funcall (recv=1075607956, mid=1075466740, n=0) at ruby.h:634
#209 0x08085cd6 in rb_inspect (obj=1075466740) at object.c:345
#210 0x08079701 in rb_p (obj=1075466740) at io.c:3747
#211 0x080797b2 in rb_f_p (argc=1, argv=0xbffff0f8) at io.c:3777
#212 0x08069e8a in call_cfunc (func=0x8079740 <rb_f_p>, recv=1075673496, len=1075466556, argc=135281712, argv=0xbffff0f8)
at eval.c:5364
#213 0x0805e117 in rb_call0 (klass=1075678376, recv=1075673496, id=7401, oid=1075466740, argc=1, argv=0xbffff0f8,
body=0x401cea8c, nosuper=0) at eval.c:5504
#214 0x0805e3c8 in rb_call (klass=1075678376, recv=1075673496, mid=7401, argc=1, argv=0xbffff0f8, scope=1) at eval.c:5725
#215 0x08059308 in rb_eval (self=1075673496, n=0x401a51f4) at ruby.h:634
#216 0x0805589b in ruby_exec () at eval.c:1458
#217 0x080558e0 in ruby_run () at eval.c:1479
#218 0x080539b5 in main (argc=1075466740, argv=0x401a51f4, envp=0xbffff8e4) at main.c:38
(gdb)
# これが最後ではない
--
[田中 哲][たなか あきら][Tanaka Akira]