[前][次][番号順一覧][スレッド一覧][生データ]

yarv-dev:802

From: SASADA Koichi <ko1 atdot.net>
Date: Sat, 04 Feb 2006 08:47:30 +0900
Subject: [yarv-dev:802] fixed> Re: open> break in eval dumps core

 ささだです。

 eval から break で抜けるのを禁止するようにしました。ちょっと、真面目に
対応するのが難しかったので。


sheepman wrote:
> こんばんは、sheepman です。
> 次のようにすると core を吐きます。
> 
> $ cat t.rb
> eval("break")
> 
> $ ./miniruby -v t.rb
> ruby 1.9.0 (2005-11-18) [i686-linux]
> YARVCore 0.3.3 (rev: 358) [opts: ]
> DBG> : "t.rb:1:in `eval'"
> DBG> : "t.rb:1:in `<main>'"
> -- stack frame ------------
> 0x402b1008 (0000): 00000001
> 0x402b100c (0001): 00000004
> 0x402b1010 (0002): 40298144
> 0x402b1014 (0003): 402af204
> 0x402b1018 (0004): 40298130
> 0x402b101c (0005): 00000001
> 0x402b1020 (0006): 00000001 <- lfp <- dfp
> -- control frame ----------
> c:0005 p:-001 s:0007 b:0007 l:0006 d:0006 CFUNC  i:initialize s:         -
> c:0004 p:-001 s:0006 b:0006 l:0005 d:0005 CFUNC  i:eval     s:         -
> c:0003 p:0009 s:0003 b:0003 l:-533 d:-533 TOP    i:<main>   s:
> c:0002 p:-001 s:0001 b:0001 l:0000 d:0000 FINISH i:-        s:         -
> c:0001 p:-001 s:0000 b:-001 l:0000 d:0000 ------ i:-        s:         -
> ---------------------------
> [BUG] Segmentation fault
> ruby 1.9.0 (2005-11-18) [i686-linux]
> 
> zsh: abort      ./miniruby -v t.rb
> 
> 以下はバックトレースです。
> 
> (gdb) bt
> #0  0x400ecc11 in kill () from /lib/i686/libc.so.6
> #1  0x4002a341 in pthread_kill () from /lib/i686/libpthread.so.0
> #2  0x4002a6bb in raise () from /lib/i686/libpthread.so.0
> #3  0x400ec8a4 in raise () from /lib/i686/libc.so.6
> #4  0x400ee008 in abort () from /lib/i686/libc.so.6
> #5  0x080c903e in rb_bug (fmt=0x80f2271 "Segmentation fault") at ../yarv/error.c:173
> #6  0x080a12f3 in sigsegv (sig=11) at ../yarv/signal.c:457
> #7  0x4002ce8e in __pthread_clock_settime () from /lib/i686/libpthread.so.0
> #8  0x400ec908 in killpg () from /lib/i686/libc.so.6
> #9  0x080d04cb in iseq_compile (self=1073937284, narg=1076461792) at ../yarv/compile.c:241
> #10 0x080ba30c in iseq_init (self=1076461772, node=1076461792, name=1076462052,
>     file_name=1076461852, parent=1076462032, type=15, opt=0) at ../yarv/yarvcore.c:514
> #11 0x080b8d96 in call_cfunc (func=0x80ba2d0 <iseq_init>, recv=1076461772, len=1073937284,
>     argc=6, argv=0x6) at call_cfunc.h:39
> #12 0x080b43cd in th_call0 (th=0x813d1d8, klass=0, recv=1076461772, id=0, oid=0, argc=6,
>     argv=0xbfffe2b0, body=0x40298f54, nosuper=0) at ../yarv/vm.c:420
> #13 0x0805a37f in rb_call (klass=1076465632, recv=1076461772, mid=3001, argc=6, argv=0xbfffe2b0,
>     scope=1) at yarv.h:49
> #14 0x0805a66d in rb_funcall2 (recv=0, mid=3001, argc=6, argv=0xbfffe2b0) at ruby.h:658
> #15 0x0805b896 in rb_obj_call_init (obj=1076461772, argc=6, argv=0xbfffe2b0)
>     at ../yarv/eval.c:2546
> #16 0x080748c4 in rb_class_new_instance (argc=6, argv=0xbfffe2b0, klass=1076465632)
>     at ../yarv/object.c:1455
> #17 0x080b9e43 in yarv_new_iseqval (node=0, name=0, file=0, parent=0, type=0, opt=0)
>     at ../yarv/yarvcore.c:345
> #18 0x080b9d2f in th_compile_from_node (th=0x0, node=0x402980e0, file=6) at ../yarv/yarvcore.c:286
> #19 0x0805aa79 in eval (self=1076556292, src=1076461872, scope=4, file=0x80d9dec "(eval)", line=1)
>     at ../yarv/eval.c:1942
> #20 0x0805aee4 in rb_f_eval (argc=1, argv=0x402b1018, self=1076556292) at ../yarv/eval.c:2036
> #21 0x080b8d5f in call_cfunc (func=0x805ae20 <rb_f_eval>, recv=1076556292, len=1073937284,
>     argc=1, argv=0x6) at call_cfunc.h:21
> #22 0x080b6e97 in th_eval (th=0x813d1d8, initial=0) at insns.def:1338
> #23 0x080b89d1 in th_eval_body (th=0x813d1d8) at ../yarv/vm.c:1274
> #24 0x080b9cfc in yarvcore_eval_iseq (iseq=1076462032) at yarv.h:49
> #25 0x0805876c in ruby_exec_internal () at ../yarv/eval.c:269
> #26 0x080587a0 in ruby_exec () at ../yarv/eval.c:281
> #27 0x080587db in ruby_run () at ../yarv/eval.c:298
> #28 0x08055ee1 in main () at ../yarv/main.c:36
> #29 0x400d9c1f in __libc_start_main () from /lib/i686/libc.so.6
> 


-- 
// SASADA Koichi at atdot dot net


-- 
ML: yarv-dev quickml.atdot.net
使い方: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]

       795 2006-02-01 21:45 [sheepman sheepman.sa] open> break in eval dumps core          
->     802 2006-02-04 08:47 ┗[ko1 atdot.net       ] fixed> Re: open> break in eval dumps core
       804 2006-02-04 11:22  ┣[sheepman sheepman.sa] open> redo in eval dumps core       
       855 2006-02-13 20:51  ┃┗[ko1 atdot.net       ] fixed> Re: open> redo in eval dumps core
       881 2006-02-14 19:00  ┃ ┗[sheepman sheepman.sa] close> redo in eval dumps core  
       805 2006-02-04 11:29  ┣[sheepman sheepman.sa] open> break in proc in eval dumps core
       874 2006-02-14 13:46  ┃┗[ko1 atdot.net       ] fixed> Re: open> break in proc in eval dumps core
       889 2006-02-14 19:13  ┃ ┗[sheepman sheepman.sa] close> break in proc in eval dumps core
       883 2006-02-14 19:04  ┗[sheepman sheepman.sa] close> break in eval dumps core