yarv-dev:1075
From: sheepman <sheepman sheepman.sakura.ne.jp>
Date: Sun, 30 Jul 2006 19:28:52 +0900
Subject: [yarv-dev:1075] Re: open> at_exit and singleton class
こんばんは、sheepman です。
at_exit は関係ありませんでした。
$ cat t.rb
GC.stress = true
class X
def X.def_call_one(s)
s = class << self; self; end
end
end
class C
def C.def_mthd
block = proc{ 1 }
Class.funcall(:define_method, :one, &block)
end
def_mthd
end
X.def_call_one(C)
proc do
p X.one
end.call
$ ruby-2.0 -v t.rb
ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-linux]
YARVCore 0.4.1 Rev: 527 (2006-07-19) [opts: [direct threaded code] [inline method cache] ]
t.rb:21: -- stack frame ------------
0000 (0x402b3008): 00000004
0001 (0x402b300c): 00000005
0002 (0x402b3010): 00000004
0003 (0x402b3014): 40299948
0004 (0x402b3018): 40299934
0005 (0x402b301c): 00000004
0006 (0x402b3020): 00000001
0007 (0x402b3024): 00000004
0008 (0x402b3028): 00000001
0009 (0x402b302c): 0814f0c5 <- dfp
0010 (0x402b3030): 402b12c8 <- bp
0011 (0x402b3034): 4029eefc
-- control frame ----------
c:0006 p:0014 s:0012 b:0010 l:0x0054 d:000009 PROC t.rb:21
c:0005 p:---- s:0009 b:0009 l:000008 d:000008 FINISH
c:0004 p:---- s:0007 b:0007 l:000006 d:000006 CFUNC :call
c:0003 p:0064 s:0004 b:0004 l:0x0054 d:0x0054 TOP t.rb:20
c:0002 p:---- s:0002 b:0002 l:000001 d:000001 FINISH
c:0001 p:---- s:0000 b:-001 l:000000 d:000000 ------
---------------------------
DBG> : "t.rb:20:in `call'"
DBG> : "t.rb:20:in `<main>'"
[BUG] Segmentation fault
ruby 2.0.0 (2006-04-08) [i686-linux]
zsh: abort ruby-2.0 -v t.rb
(gdb) bt
#0 0x400eec11 in kill () from /lib/i686/libc.so.6
#1 0x4002c341 in pthread_kill () from /lib/i686/libpthread.so.0
#2 0x4002c6bb in raise () from /lib/i686/libpthread.so.0
#3 0x400ee8a4 in raise () from /lib/i686/libc.so.6
#4 0x400f0008 in abort () from /lib/i686/libc.so.6
#5 0x080d2992 in rb_bug (fmt=0x80fc731 "nsupported name `SIG%s'") at ../yarv/error.c:161
#6 0x0809f4e7 in sigsegv (sig=11) at ../yarv/signal.c:466
#7 0x4002ee8e in __pthread_clock_settime () from /lib/i686/libpthread.so.0
#8 0x400ee908 in killpg () from /lib/i686/libc.so.6
#9 0x080b5b09 in th_invoke_proc (th=0x8148588, proc=0x81493e8, self=1076489980, argc=0,
argv=0x402b3038) at ../yarv/vm.c:743
#10 0x080bac23 in th_eval (th=0x8148588, initial=0) at ../yarv/vm.c:429
#11 0x080c01d7 in th_eval_body (th=0x8148588) at ../yarv/vm.c:1638
#12 0x080b5bc2 in th_invoke_proc (th=0x8148588, proc=0x814eea8, self=1076564680, argc=0,
argv=0x402b301c) at ../yarv/vm.c:724
#13 0x080c1fde in yarv_proc_alloc () at ../yarv/yarvcore.c:555
#14 0x080c056f in call_cfunc (func=0x80c1fb4 <proc_alloc+56>, recv=1076468020, len=1073945476,
argc=1076468020, argv=0x6) at call_cfunc.h:14
#15 0x080bab2b in th_eval (th=0x8148588, initial=0) at insns.def:2106
#16 0x080c01d7 in th_eval_body (th=0x8148588) at ../yarv/vm.c:1638
#17 0x080c1d9f in yarv_th_eval (th=0x8148588, iseqval=1076465380) at ../yarv/yarvcore.c:441
#18 0x080c1838 in compile_string (str=1076465380, file=1076465420, line=0)
at ../yarv/yarvcore.c:167
#19 0x08058754 in ruby_exec_internal () at ../yarv/eval.c:238
#20 0x08058770 in ruby_exec_internal () at ../yarv/eval.c:233
#21 0x080587ab in ruby_stop (ex=3) at ../yarv/eval.c:253
#22 0x080562c0 in main (argc=3, argv=0xbfffee04, envp=0xbfffee14)
#23 0x400dbc1f in __libc_start_main () from /lib/i686/libc.so.6
--
sheepman / TAMURA Takashi
sheepman sheepman.sakura.ne.jp
--
ML: yarv-dev quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml
1074 2006-07-30 17:00 [sheepman sheepman.sa] open> at_exit and singleton class -> 1075 2006-07-30 19:28 ┗[sheepman sheepman.sa] 1076 2006-07-30 20:00 ┗[sheepman sheepman.sa]