ローカルの BitChannel が落ちまくり。 どうして俺が新しいことをしようとすると必ず ruby が落ちるんだろう。
/home/aamine/public_html/bc/lib/bitchannel/syntax.rb:436: [BUG] Segmentation fault ruby 1.9.0 (2005-10-06) [x86_64-linux] /home/aamine/public_html/bc/lib/bitchannel/filesystem.rb:50: [BUG] Segmentation fault ruby 1.9.0 (2005-10-22) [x86_64-linux] /home/aamine/public_html/bc/lib/bitchannel/lineinput.rb:52: [BUG] Segmentation fault ruby 1.9.0 (2005-10-22) [x86_64-linux] /home/aamine/public_html/bc/lib/bitchannel/syntax.rb:398: [BUG] Segmentation fault ruby 1.9.0 (2005-10-22) [x86_64-linux]
コードを追加するだけで落ちる場所が移動するので、いかにも GC 関係くさい。 まだ Apache 経由でしか落とせてないおかげで core がとれてない。 なんで端末から実行すると落ちないんだ! ウガー!
GC.start を入れまくったら落ちた。やったー
(gdb) bt #0 0x0000002a956b945f in gc_mark (ptr=180388626432, lev=1) at ../../src/ruby/gc.c:697 #1 0x0000002a956b988a in gc_mark_children (ptr=182916056536, lev=1) at ../../src/ruby/gc.c:902 #2 0x0000002a956b9502 in gc_mark (ptr=182916056576, lev=0) at ../../src/ruby/gc.c:713 #3 0x0000002a956b92db in mark_locations_array (x=0x7fbffdfcc8, n=16128) at ../../src/ruby/gc.c:624 #4 0x0000002a956b9317 in rb_gc_mark_locations (start=0x7fbffde140, end=0x7fbffff4d0) at ../../src/ruby/gc.c:636 #5 0x0000002a956ba798 in garbage_collect () at ../../src/ruby/gc.c:1313 #6 0x0000002a956ba84f in rb_gc () at ../../src/ruby/gc.c:1385 #7 0x0000002a956ba85f in rb_gc_start () at ../../src/ruby/gc.c:1402 #8 0x0000002a956b37c4 in call_cfunc (func=0x2a956ba856 <rb_gc_start>, recv=182903891032, len=5796064, argc=0, argv=0x1) at /home/aamine/src/ruby/eval.c:5409 #9 0x0000002a956a6087 in rb_call0 (klass=182903890992, recv=182903891032, id=5129, oid=5129, argc=0, argv=0x0, body=0x2a95ebe408, flags=0) at /home/aamine/src/ruby/eval.c:5617 #10 0x0000002a956a6399 in rb_call (klass=182903890992, recv=182903891032, mid=5129, argc=0, argv=0x0, scope=0) at /home/aamine/src/ruby/eval.c:5790 #11 0x0000002a956a0376 in rb_eval (self=182907303728, n=0x1) at ruby.h:659 #12 0x0000002a956a5ba3 in rb_call0 (klass=182907916248, recv=182907303728, id=18049, oid=18049, argc=1, argv=0x7fbffdf2e0, body=0x2a95f0d0b0, flags=8) at /home/aamine/src/ruby/eval.c:5698 #13 0x0000002a956a6399 in rb_call (klass=182907916248, recv=182907303728, mid=18049, argc=1, argv=0x7fbffdf2e0, scope=1) at /home/aamine/src/ruby/eval.c:5790 #14 0x0000002a956a0376 in rb_eval (self=182907303728, n=0x1) at ruby.h:659 #15 0x0000002a956a0437 in rb_eval (self=182907303728, n=0x1) at ruby.h:683 #16 0x0000002a956a5ba3 in rb_call0 (klass=182907916248, recv=182907303728, id=7385, oid=7385, argc=1, argv=0x7fbffe0dc8, body=0x2a95f0b440, flags=0) at /home/aamine/src/ruby/eval.c:5698 #17 0x0000002a956a6399 in rb_call (klass=182907916248, recv=182907303728, mid=7385, argc=1, argv=0x7fbffe0dc8, scope=0) at /home/aamine/src/ruby/eval.c:5790 #18 0x0000002a956a65b2 in send_funcall (argc=1, argv=0x7fbffe0dc8, recv=182907303728, scope=0) at ruby.h:659 #19 0x0000002a956b37bb in call_cfunc (func=0x2a956a6640 <rb_f_send>, recv=182907303728, len=5796064, argc=0, argv=0x1) at /home/aamine/src/ruby/eval.c:5406 #20 0x0000002a956a6087 in rb_call0 (klass=182904027432, recv=182907303728, id=4089, oid=4089, argc=2, argv=0x7fbffe0dc0, body=0x2a95edba80, flags=0) at /home/aamine/src/ruby/eval.c:5617 #21 0x0000002a956a6399 in rb_call (klass=182904027432, recv=182907303728, mid=4089, argc=2, argv=0x7fbffe0dc0, scope=0) at /home/aamine/src/ruby/eval.c:5790 #22 0x0000002a956a0376 in rb_eval (self=182907303648, n=0x1) at ruby.h:659 #23 0x0000002a956ac06b in rb_block_pass (func=0x2a956ac130 <call_block>, arg=548681947760, proc=4) at /home/aamine/src/ruby/eval.c:8519 #24 0x0000002a956ac16c in block_pass (self=180388626432, node=0x1) at /home/aamine/src/ruby/eval.c:8589 #25 0x0000002a956a0fd8 in rb_eval (self=182907303648, n=0x1) at /home/aamine/src/ruby/eval.c:2949 以下略
マシンスタックをマーク中に落ちているようだ。 壊れてるオブジェクトは 10 要素の配列の 8 番目で、 配列はこんな感じ。
[59, 6, 15, 23, 10, 2005, 0, 296, (C の 0x2a << 32), "UTC"]
これはどう見ても時刻だよなあ。 296 が 10 月 23 日の yday だから、 たぶん Time#to_a の返り値だろう。
え、ということは 0x2a<<32 は isdst か。 真偽値がなんでこんな値に化けてるんだろう。
とりあえず今日はここまで。
(19:28)
うげ、AMD64 だと cvsup のバイナリがないのか。 というか、コンパイルすらできなかったら泣くので。
いや、IA-32 エミュレーション内で動かせばいいのかな。 やってみよう。
(20:12)
Copyright (c) 2002-2007 青木峰郎 / Minero Aoki. All rights reserved.
Looks similar.
/usr/local/lib/ruby/1.8/net/protocol.rb:197: [BUG] Segmentation fault
ruby 1.8.2 (2004-12-25) [x86_64-linux]
Aborted (core dumped)
(gdb) bt
#0 0x00000032f812e4cd in raise () from /lib64/tls/libc.so.6
#1 0x0000002a9a12401d in MagickSignalHandler (signal_number=6)
at magick/magick.c:834
#2 <signal handler called>
#3 0x00000032f812e4cd in raise () from /lib64/tls/libc.so.6
#4 0x00000032f812fc1e in abort () from /lib64/tls/libc.so.6
#5 0x00000000004880e2 in rb_bug (fmt=0x4a4708 "Segmentation fault")
at error.c:214
#6 0x00000000004693d0 in sigsegv (sig=16997) at signal.c:446
#7 <signal handler called>
#8 gc_mark (ptr=545460846592, lev=1) at gc.c:713
#9 0x0000000000429db6 in gc_mark_children (ptr=2, lev=1) at gc.c:923
#10 0x0000000000429f8f in mark_locations_array (x=0xd934e8, n=12668)
at gc.c:624
#11 0x0000000000411f32 in thread_mark (th=0x1102d00) at eval.c:9726
#12 0x0000000000429ba6 in gc_mark_children (ptr=4294967295, lev=1) at gc.c:974
#13 0x0000000000411d5f in thread_mark (th=0x5f4000) at eval.c:9713
#14 0x0000000000429ba6 in gc_mark_children (ptr=0, lev=1) at gc.c:974
#15 0x0000000000411d5f in thread_mark (th=0x1049a30) at eval.c:9713
#16 0x0000000000429f8f in mark_locations_array (x=0x7fbffe4790, n=13881)
at gc.c:624
#17 0x000000000042a2b4 in garbage_collect () at gc.c:1354
#18 0x000000000042ac17 in ruby_xmalloc (size=1025) at gc.c:119
#19 0x000000000046bc67 in str_new (klass=545460846592, ptr=0x0, len=1024)
at string.c:92
#20 0x0000000000431bea in rb_io_sysread (argc=0, argv=0x1, io=182920194280)
at io.c:2178
#21 0x0000000000417acd in rb_call0 (klass=182894404728, recv=182920194280,
id=7497, oid=18446744073709551615, argc=1, argv=0x7fbffe6b10,
body=0x2a955b1cf8, nosuper=0) at eval.c:5386
#22 0x0000000000418428 in rb_call (klass=182894404728, recv=182920194280,
mid=7497, argc=1, argv=0x7fbffe6b10, scope=0) at eval.c:5743
#23 0x0000000000415fc9 in rb_eval (self=182920194880, n=0x1) at ruby.h:631
#24 0x0000000000413b01 in rb_eval (self=182920194880, n=0x1) at eval.c:3224
#25 0x000000000041a574 in rb_yield_0 (val=121, self=182920194880, klass=0,
flags=0, avalue=0) at eval.c:4726
#26 0x0000000000413e8c in rb_eval (self=182907324048, n=0x1) at eval.c:3025
---Type <return> to continue, or q <return> to quit---
#27 0x00000000004167b9 in rb_eval (self=182907324048, n=0x1) at eval.c:3085
#28 0x00000000004175f8 in rb_call0 (klass=182907323528, recv=182907324048,
id=16609, oid=0, argc=0, argv=0x7fbffe93b0, body=0x2a96208808, nosuper=0)
at eval.c:5650
#29 0x0000000000418428 in rb_call (klass=182907323528, recv=182907324048,
mid=16609, argc=2, argv=0x7fbffe93a0, scope=0) at eval.c:5743
#30 0x0000000000415fc9 in rb_eval (self=182920194880, n=0x1) at ruby.h:631
#31 0x000000000041e87f in block_pass (self=182920194880, node=0x2a96206198)
at eval.c:8475
#32 0x00000000004142ba in rb_eval (self=182920194880, n=0x1) at eval.c:2935
#33 0x00000000004175f8 in rb_call0 (klass=182894488128, recv=182920194880,
id=16609, oid=0, argc=0, argv=0x7fbffeaab8, body=0x2a962062d8, nosuper=0)
at eval.c:5650
#34 0x0000000000418428 in rb_call (klass=182894488128, recv=182920194880,
mid=16609, argc=1, argv=0x7fbffeaab0, scope=1) at eval.c:5743
#35 0x0000000000413c1e in rb_eval (self=182920194880, n=0x1) at ruby.h:631
#36 0x0000000000416b03 in rb_eval (self=182920194880, n=0x1) at eval.c:2949
#37 0x00000000004175f8 in rb_call0 (klass=182907320688, recv=182920194880,
id=61017, oid=0, argc=0, argv=0x0, body=0x2a96235ad8, nosuper=0)
at eval.c:5650
#38 0x0000000000418428 in rb_call (klass=182907320688, recv=182920194880,
mid=61017, argc=0, argv=0x0, scope=2) at eval.c:5743
#39 0x0000000000413c1e in rb_eval (self=182920194880, n=0x1) at ruby.h:631
#40 0x0000000000415620 in rb_eval (self=182920194880, n=0x1) at eval.c:2908
#41 0x0000000000416663 in rb_eval (self=182920194880, n=0x1) at eval.c:3060
#42 0x00000000004175f8 in rb_call0 (klass=182907320688, recv=182920194880,
id=61025, oid=0, argc=0, argv=0x7fbffedca8, body=0x2a9623ad80, nosuper=0)
at eval.c:5650
#43 0x0000000000418428 in rb_call (klass=182907320688, recv=182920194880,
mid=61025, argc=1, argv=0x7fbffedca0, scope=1) at eval.c:5743
#44 0x0000000000413c1e in rb_eval (self=182920194880, n=0x1) at ruby.h:631
#45 0x0000000000413a7c in rb_eval (self=182920194880, n=0x1) at eval.c:3223
#46 0x00000000004175f8 in rb_call0 (klass=182907320688, recv=182920194880,
id=7353, oid=0, argc=0, argv=0x0, body=0x2a9623a4e8, nosuper=0)
at eval.c:5650
#47 0x0000000000418428 in rb_call (klass=182907320688, recv=182920194880,
mid=7353, argc=0, argv=0x0, scope=0) at eval.c:5743
---Type <return> to continue, or q <return> to quit---
#48 0x0000000000415fc9 in rb_eval (self=182920195720, n=0x1) at ruby.h:631
#49 0x000000000041519f in rb_eval (self=182920195720, n=0x1) at eval.c:3399
#50 0x0000000000415546 in rb_eval (self=182920195720, n=0x1) at eval.c:2873
#51 0x00000000004175f8 in rb_call0 (klass=182907307168, recv=182920195720,
id=60713, oid=0, argc=0, argv=0x0, body=0x2a962597a8, nosuper=0)
at eval.c:5650
#52 0x0000000000418428 in rb_call (klass=182907307168, recv=182920195720,
mid=60713, argc=0, argv=0x0, scope=1) at eval.c:5743
#53 0x0000000000413c1e in rb_eval (self=182920195720, n=0x1) at ruby.h:631
#54 0x000000000041a574 in rb_yield_0 (val=6, self=182920195720, klass=0,
flags=0, avalue=0) at eval.c:4726
#55 0x0000000000413e8c in rb_eval (self=182920195720, n=0x1) at eval.c:3025
#56 0x0000000000413e56 in rb_eval (self=182920195720, n=0x1) at eval.c:3173
#57 0x0000000000416663 in rb_eval (self=182920195720, n=0x1) at eval.c:3060
#58 0x00000000004175f8 in rb_call0 (klass=182907307168, recv=182920195720,
id=5097, oid=0, argc=0, argv=0x0, body=0x2a96258268, nosuper=0)
at eval.c:5650
#59 0x0000000000418428 in rb_call (klass=182907307168, recv=182920195720,
mid=5097, argc=0, argv=0x0, scope=1) at eval.c:5743
#60 0x0000000000413c1e in rb_eval (self=182920195720, n=0x1) at ruby.h:631
#61 0x0000000000416b03 in rb_eval (self=182920195720, n=0x1) at eval.c:2949
#62 0x000000000041519f in rb_eval (self=182920195720, n=0x1) at eval.c:3399
#63 0x00000000004175f8 in rb_call0 (klass=182907307168, recv=182920195720,
id=60881, oid=0, argc=0, argv=0x7fbfff5438, body=0x2a9625a388, nosuper=0)
at eval.c:5650
#64 0x0000000000418428 in rb_call (klass=182907307168, recv=182920195720,
mid=60881, argc=1, argv=0x7fbfff5430, scope=1) at eval.c:5743
#65 0x0000000000413c1e in rb_eval (self=182920195720, n=0x1) at ruby.h:631
#66 0x00000000004175f8 in rb_call0 (klass=182907307168, recv=182920195720,
id=60745, oid=0, argc=0, argv=0x0, body=0x2a9625ab30, nosuper=0)
at eval.c:5650
#67 0x0000000000418428 in rb_call (klass=182907307168, recv=182920195720,
mid=60745, argc=0, argv=0x0, scope=2) at eval.c:5743
#68 0x0000000000413c1e in rb_eval (self=182920195720, n=0x1) at ruby.h:631
#69 0x00000000004167b9 in rb_eval (self=182920195720, n=0x1) at eval.c:3085
#70 0x00000000004175f8 in rb_call0 (klass=182907307168, recv=182920195720,
id=60673, oid=0, argc=0, argv=0x0, body=0x2a96272550, nosuper=0)
---Type <return> to continue, or q <return> to quit---
at eval.c:5650
#71 0x0000000000418428 in rb_call (klass=182907307168, recv=182920195720,
mid=60673, argc=0, argv=0x0, scope=2) at eval.c:5743
#72 0x0000000000413c1e in rb_eval (self=182920195720, n=0x1) at ruby.h:631
#73 0x000000000041677e in rb_eval (self=182920195720, n=0x1) at eval.c:3092
#74 0x00000000004175f8 in rb_call0 (klass=182907307168, recv=182920195720,
id=5033, oid=0, argc=0, argv=0x7fbfff8920, body=0x2a96277a28, nosuper=0)
at eval.c:5650
#75 0x0000000000418428 in rb_call (klass=182907307168, recv=182920195720,
mid=5033, argc=4, argv=0x7fbfff8900, scope=0) at eval.c:5743
#76 0x0000000000415fc9 in rb_eval (self=182907307168, n=0x1) at ruby.h:631
#77 0x000000000041e87f in block_pass (self=182907307168, node=0x2a9627cac8)
at eval.c:8475
#78 0x00000000004142ba in rb_eval (self=182907307168, n=0x1) at eval.c:2935
#79 0x00000000004175f8 in rb_call0 (klass=182907305808, recv=182907307168,
id=5033, oid=0, argc=0, argv=0x7fbfffa070, body=0x2a9627cd48, nosuper=0)
at eval.c:5650
#80 0x0000000000418428 in rb_call (klass=182907305808, recv=182907307168,
mid=5033, argc=6, argv=0x7fbfffa040, scope=0) at eval.c:5743
#81 0x0000000000415fc9 in rb_eval (self=182921268680, n=0x1) at ruby.h:631
#82 0x0000000000416b03 in rb_eval (self=182921268680, n=0x1) at eval.c:2949
#83 0x00000000004175f8 in rb_call0 (klass=182906488688, recv=182921268680,
id=53985, oid=0, argc=0, argv=0x7fbfffb850, body=0x2a96146618, nosuper=0)
at eval.c:5650
#84 0x0000000000418428 in rb_call (klass=182906488688, recv=182921268680,
mid=53985, argc=1, argv=0x7fbfffb848, scope=1) at eval.c:5743
#85 0x0000000000418a99 in rb_f_send (argc=1, argv=0x7fbfffb848,
recv=182921268680) at ruby.h:631
#86 0x0000000000417acd in rb_call0 (klass=182894487848, recv=182921268680,
id=4033, oid=18446744073709551615, argc=2, argv=0x7fbfffb840,
body=0x2a955c2ad0, nosuper=0) at eval.c:5386
#87 0x0000000000418428 in rb_call (klass=182894487848, recv=182921268680,
mid=4033, argc=2, argv=0x7fbfffb840, scope=1) at eval.c:5743
#88 0x0000000000413c1e in rb_eval (self=182921268680, n=0x1) at ruby.h:631
#89 0x0000000000416663 in rb_eval (self=182921268680, n=0x1) at eval.c:3060
#90 0x00000000004175f8 in rb_call0 (klass=182906488688, recv=182921268680,
id=53871, oid=0, argc=0, argv=0x0, body=0x2a9614c108, nosuper=0)
---Type <return> to continue, or q <return> to quit---
at eval.c:5650
#91 0x0000000000418428 in rb_call (klass=182906488688, recv=182921268680,
mid=53871, argc=0, argv=0x0, scope=0) at eval.c:5743
#92 0x0000000000415fc9 in rb_eval (self=182921274680, n=0x1) at ruby.h:631
#93 0x00000000004175f8 in rb_call0 (klass=182906435248, recv=182921274680,
id=3881, oid=0, argc=2, argv=0x7fbfffd8f8, body=0x2a96144b88, nosuper=0)
at eval.c:5650
#94 0x0000000000418428 in rb_call (klass=182906435248, recv=182921274680,
mid=3881, argc=3, argv=0x7fbfffd8f0, scope=1) at eval.c:5743
#95 0x000000000041b78f in method_missing (obj=182921274680, id=2629902,
argc=2, argv=0x7fbfffda30, call_status=6) at eval.c:5367
#96 0x0000000000418473 in rb_call (klass=182921274640, recv=182921274680,
mid=10273, argc=2, argv=0x7fbfffda30, scope=0) at eval.c:5739
#97 0x0000000000415fc9 in rb_eval (self=182894478208, n=0x1) at ruby.h:631
#98 0x000000000041519f in rb_eval (self=182894478208, n=0x1) at eval.c:3399
#99 0x00000000004175f8 in rb_call0 (klass=182894488128, recv=182894478208,
id=10241, oid=0, argc=0, argv=0x0, body=0x2a955a4a58, nosuper=0)
at eval.c:5650
#100 0x0000000000418428 in rb_call (klass=182894488128, recv=182894478208,
mid=10241, argc=0, argv=0x0, scope=2) at eval.c:5743
#101 0x0000000000413c1e in rb_eval (self=182894478208, n=0x1) at ruby.h:631
#102 0x0000000000420915 in ruby_exec_internal () at eval.c:1473
#103 0x0000000000420933 in ruby_exec () at eval.c:1493
#104 0x0000000000421a6d in ruby_run () at eval.c:1503
#105 0x000000000040ccd9 in main (argc=2, argv=0x7fbffffa58, envp=0x120200)
at main.c:46
(gdb)