[#24536] 「Rubyの落し方」 v.s. ruby_1_8 — akira yamada / やまだあきら <akira@...>

<URL:http://jp.rubyist.net/magazine/?0002-RubyCore>

40 messages 2004/10/20
[#24541] Re: 「Rubyの落し方」 v.s. ruby_1_8 — Yukihiro Matsumoto <matz@...> 2004/10/20

まつもと ゆきひろです

[#24599] 1.8.2 preview3? — akira yamada / やまだあきら <akira@...> 2004/10/26

2004-10-20 (水) の 21:38 +0900 に Yukihiro Matsumoto さんは書きました:

[#24605] Re: 1.8.2 preview3? — akira yamada / やまだあきら <akira@...> 2004/10/27

2004-10-26 (火) の 16:16 +0900 に akira yamada / やまだあきら さんは書きました:

[#24606] Re: 1.8.2 preview3? — Yukihiro Matsumoto <matz@...> 2004/10/27

まつもと ゆきひろです

[#24608] Re: 1.8.2 preview3? — akira yamada / やまだあきら <akira@...> 2004/10/27

2004-10-27 (水) の 11:48 +0900 に Yukihiro Matsumoto さんは書きました:

[#24620] Re: 1.8.2 preview3? — akira yamada / やまだあきら <akira@...> 2004/10/27

2004-10-27 (水) の 12:42 +0900 に akira yamada / やまだあきら さんは書きました:

[#24629] Re: 1.8.2 preview3? — Tanaka Akira <akr@...17n.org> 2004/10/29

In article <1098888819.9446.14.camel@rice.p.arika.org>,

[ruby-dev:24463] Enumerable#each_with_index causes core dump

From: Tanaka Akira <akr@...17n.org>
Date: 2004-10-10 15:00:06 UTC
List: ruby-dev #24463
次のようにすると core を吐きます。

% ./ruby -e '
r = 1..3
r.each_with_index {|v,i| callcc {|k| $k = k } if v == 2; p [v,i] }
$k.call
'
[1, 0]
[2, 1]
[3, 2]
[2, 1]
[3, 135515225]
[2, 1]
[3, 135515609]
[2, 1]
...
[3, 135789017]
[2, 1]
[3, 135789401]
[2, 1]
[3, 135789785]
[2, 1]
-e:3: [BUG] Segmentation fault
ruby 1.9.0 (2004-10-10) [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 
r = 1..3
r.each_with_index {|v,i| callcc {|k| $k = k } if v == 2; p'.
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  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  0x080d2456 in rb_bug (fmt=0x0) at error.c:214
#4  0x080b0392 in sigsegv (sig=11) at signal.c:446
#5  <signal handler called>
#6  gc_mark (ptr=50331648, lev=0) at gc.c:708
#7  0x0806ff7d in gc_mark_children (ptr=2, lev=0) at gc.c:918
#8  0x080702ab in gc_mark_children (ptr=1075608056, lev=0) at gc.c:889
#9  0x0806fbe3 in mark_locations_array (x=0xbfffe138, n=1528) at gc.c:619
#10 0x08070a08 in garbage_collect () at gc.c:1334
#11 0x0806f835 in rb_newobj () at gc.c:394
#12 0x080b331b in str_alloc (klass=50331648) at string.c:44
#13 0x080b376c in rb_str_buf_new (capa=1) at string.c:200
#14 0x080b37d4 in rb_str_buf_new2 (ptr=0x80f45e1 "[") at string.c:221
#15 0x080c58ce in inspect_ary (ary=1075478536) at array.c:1572
#16 0x080c5698 in inspect_call (arg=0x3000000) at array.c:1493
#17 0x0805d4e9 in rb_ensure (b_proc=0x80c5680 <inspect_call>, data1=3221214640, e_proc=0x80c5780 <inspect_ensure>, 
    data2=1075478536) at eval.c:5176
#18 0x080c583f in rb_protect_inspect (func=0x80c5890 <inspect_ary>, obj=1075478536, arg=0) at array.c:1550
#19 0x080c59e6 in rb_ary_inspect (ary=1075478536) at array.c:1597
#20 0x08069f61 in call_cfunc (func=0x80c5990 <rb_ary_inspect>, recv=1075478536, len=50331648, argc=0, argv=0x0)
    at eval.c:5370
#21 0x0805e167 in rb_call0 (klass=1075647616, recv=1075478536, id=3169, oid=50331648, argc=0, argv=0x0, body=0x401d137c, 
    nosuper=0) at eval.c:5508
#22 0x0805e418 in rb_call (klass=1075647616, recv=1075478536, mid=3169, argc=0, argv=0x0, scope=1) at eval.c:5729
#23 0x0805e794 in rb_funcall (recv=1075478536, mid=50331648, n=0) at ruby.h:635
#24 0x08086156 in rb_inspect (obj=50331648) at object.c:345
#25 0x08079b31 in rb_p (obj=50331648) at io.c:3743
#26 0x08079be2 in rb_f_p (argc=1, argv=0xbfffdad8) at io.c:3773
#27 0x08069f5a in call_cfunc (func=0x8079b70 <rb_f_p>, recv=1075673496, len=50331648, argc=0, argv=0xbfffdad8)
    at eval.c:5367
#28 0x0805e167 in rb_call0 (klass=1075678376, recv=1075673496, id=7417, oid=50331648, argc=1, argv=0xbfffdad8, 
    body=0x401cea3c, nosuper=0) at eval.c:5508
#29 0x0805e418 in rb_call (klass=1075678376, recv=1075673496, mid=7417, argc=1, argv=0xbfffdad8, scope=1) at eval.c:5729
#30 0x08059348 in rb_eval (self=1075673496, n=0x3000000) at ruby.h:635
#31 0x0805c1f3 in rb_yield_0 (val=1075478616, self=1075673496, klass=1075608296, flags=0, avalue=2) at eval.c:4708
#32 0x0805c714 in rb_yield_values (n=2) at eval.c:4807
#33 0x080d1adb in each_with_index_i (val=50331648, memo=0x401c7a0c) at enum.c:882
---Type <return> to continue, or q <return> to quit---
#34 0x0805c457 in rb_yield_0 (val=7, self=1075673496, klass=1075608056, flags=0, avalue=0) at eval.c:4705
#35 0x0805c6d9 in rb_yield (val=50331648) at eval.c:4790
#36 0x0809e461 in range_each (range=1075608096) at range.c:415
#37 0x08069f61 in call_cfunc (func=0x809e330 <range_each>, recv=1075608096, len=50331648, argc=0, argv=0x0) at eval.c:5370
#38 0x0805e167 in rb_call0 (klass=1075638536, recv=1075608096, id=3873, oid=50331648, argc=0, argv=0x0, body=0x401cf004, 
    nosuper=0) at eval.c:5508
#39 0x0805e418 in rb_call (klass=1075638536, recv=1075608096, mid=3873, argc=0, argv=0x0, scope=1) at eval.c:5729
#40 0x0805e794 in rb_funcall (recv=1075608096, mid=50331648, n=0) at ruby.h:635
#41 0x080d0c06 in rb_each (obj=50331648) at enum.c:24
#42 0x0805cec9 in rb_iterate (it_proc=0x80d0be0 <rb_each>, data1=1075608096, bl_proc=0x3000000, data2=50331648)
    at eval.c:5021
#43 0x080d1b3c in enum_each_with_index (obj=1075608096) at enum.c:908
#44 0x08069f61 in call_cfunc (func=0x80d1af0 <enum_each_with_index>, recv=1075608096, len=50331648, argc=0, argv=0x0)
    at eval.c:5370
#45 0x0805e167 in rb_call0 (klass=1075672676, recv=1075608096, id=3857, oid=50331648, argc=0, argv=0x0, body=0x401d72e0, 
    nosuper=0) at eval.c:5508
#46 0x0805e418 in rb_call (klass=1075672676, recv=1075608096, mid=3857, argc=0, argv=0x0, scope=0) at eval.c:5729
#47 0x08059348 in rb_eval (self=1075673496, n=0x3000000) at ruby.h:635
#48 0x080586f8 in rb_eval (self=1075673496, n=0x3000000) at eval.c:2923
#49 0x080558db in ruby_exec () at eval.c:1458
#50 0x08055920 in ruby_run () at eval.c:1484
#51 0x080539e5 in main (argc=50331648, argv=0x3000000, envp=0xbffff934) at main.c:38
(gdb) 
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread

Prev Next