From: sheepman Date: 2005-09-19T19:09:16+09:00 Subject: [ruby-dev:27174] Re: Attatched script dumps core(Re: ruby-1.8.3 status for release) こんにちは、sheepman です。 On Mon, 19 Sep 2005 17:35:19 +0900 "URABE Shyouhei aka. mput" wrote: > 卜部です。 > > この絡みで、添付のスクリプトを書いてみたのですが、いくつかのテストで実行 > に失敗するのみならず、このスクリプト自身が[BUG]で落ちます。 > Vine Linux 3.1 Linux 2.4.27-0vl7 i686 glibc 2.3.3 ruby 1.8.3 (2005-09-19) [i686-linux] で再現しました。添付されていたスクリプトを切り詰めた結果、以下のような スクリプトでも再現しました。5回に1回くらい core を吐きます。 28行目はちょうど、"if s.nil? then" に相当します。 $ ruby-1.8 core-check.rb core-check.rb:28: [BUG] Segmentation fault ruby 1.8.3 (2005-09-19) [i686-linux] zsh: abort (core dumped) ruby-1.8 core-check.rb ---- ここから ----- #! /usr/bin/env ruby require "timeout" module OreTest module_function Group = ThreadGroup.new def wait_all while Group.list.any? {|t| t.alive? } ; end end def fork_this(b, t) pid = Process.fork(&b) timeout(t) do begin s = Process.waitpid(pid, Process::WNOHANG) end while s.nil? end return $? end def check_core(n, t = 30, &b) Group.add Thread.start(n, t, b) {|n, t, b| Thread.pass s = fork_this(b, t) if s.nil? then end } end end OreTest.check_core "[ruby-core:4010]" do end OreTest.wait_all ---- ここまで ---- 以下はバックトレースです。 (gdb) bt #0 0x4009ac11 in kill () at finddomain.c:145 #1 0x4009a895 in raise (sig=6) at ../linuxthreads/sysdeps/unix/sysv/linux/raise.c:32 #2 0x4009c008 in abort () at ../sysdeps/generic/abort.c:88 #3 0x080bbe32 in rb_bug (fmt=0x80d5e29 "Segmentation fault") at error.c:214 #4 0x080a0d84 in sigpipe (sig=11) at signal.c:447 #5 #6 st_lookup (table=0x8118161, key=3031, value=0xbfffb884) at st.c:259 #7 0x080528c7 in search_method (klass=135364961, id=3031, origin=0xbfffb884) at eval.c:434 #8 0x08052911 in rb_get_method_body (klassp=0xbfffb8d0, idp=0xbfffb8b4, noexp=0xbfffb8b8) at eval.c:455 #9 0x0805ba8f in rb_call (klass=135364961, recv=1075625500, mid=3031, argc=0, argv=0x0, scope=0) at eval.c:5876 #10 0x0805739e in rb_eval (self=1075621980, n=0x0) at ruby.h:638 #11 0x08056079 in rb_eval (self=1075621980, n=0x0) at eval.c:2931 #12 0x08059bac in rb_yield_0 (val=1075615740, self=1075621980, klass=0, flags=0, avalue=2) at eval.c:4877 #13 0x08064214 in rb_thread_yield (arg=1075615740, th=0x811d780) at eval.c:11686 #14 0x080640ed in rb_thread_start_0 (fn=0x8064198 , arg=0x401c97fc, th=0x811d780) at eval.c:11604 #15 0x08064337 in rb_thread_start (klass=1075679040, args=1075615740) at eval.c:11784 #16 0x08065a27 in call_cfunc (func=0x806430c , recv=1075679040, len=1075480936, argc=3, argv=0x6) at eval.c:5530 #17 0x0805b2f2 in rb_call0 (klass=1075679020, recv=1075679040, id=5049, oid=0, argc=3, argv=0xbfffcac0, body=0x401d8eb4, flags=0) at eval.c:5672 #18 0x0805bb1d in rb_call (klass=1075679020, recv=1075679040, mid=5049, argc=3, argv=0xbfffcac0, scope=0) at eval.c:5900 #19 0x0805739e in rb_eval (self=1075621980, n=0x0) at ruby.h:638 #20 0x080568cf in rb_eval (self=1075621980, n=0x0) at eval.c:3100 #21 0x0805743f in rb_eval (self=1075621980, n=0x0) at ruby.h:643 #22 0x0805b618 in rb_call0 (klass=1075615940, recv=1075621980, id=10321, oid=0, argc=0, argv=0xbfffdf54, body=0x401cb854, flags=-1073750656) at eval.c:5806 #23 0x0805bb1d in rb_call (klass=1075615940, recv=1075621980, mid=10321, argc=1, argv=0xbfffdf50, scope=0) at eval.c:5900 #24 0x0805739e in rb_eval (self=1075689840, n=0x0) at ruby.h:638 #25 0x080568cf in rb_eval (self=1075689840, n=0x0) at eval.c:3100 #26 0x08053de0 in ruby_exec_internal () at eval.c:1543 #27 0x08053e14 in ruby_exec () at eval.c:1563 #28 0x08053e36 in ruby_run () at eval.c:1573 #29 0x08052325 in main () at main.c:46 #30 0x40087c1f in __libc_start_main (main=0x8052304
, argc=2, ubp_av=0x2, init=0x80bdd04 <__libc_csu_init>, fini=0x80bdd4c <__libc_csu_fini>, rtld_fini=0x400144a0 <_rtld_local>, stack_end=0x401a8968) at ../sysdeps/generic/libc-start.c:225 -- sheepman / TAMURA Takashi sheepman@sheepman.sakura.ne.jp http://sheepman.parfait.ne.jp/