yarv-dev-en:77
From: Christian Neukirchen <chneukirchen gmail.com>
Date: Sat, 25 Feb 2006 15:58:28 +0100
Subject: [yarv-dev-en:77] Block-taking-blocks bugs
Hi, while playing with blocks that take blocks, I discovered this:
def gen
lambda { |&block| }
end
gen 5
DBG> : block
-- stack frame ------------
0x405000 (0000): 00000001
0x405004 (0001): 00000001
0x405008 (0002): 00000001 <- lfp <- dfp
-- control frame ----------
c:0004 p:-001 s:0003 b:0003 l:0002 d:0002 CFUNC i:initialize s: -
c:0003 p:-001 s:0002 b:0002 l:0001 d:0001 CFUNC i:initialize s: -
c:0002 p:-001 s:0001 b:0001 l:0000 d:0000 CFUNC i:initialize s: -
c:0001 p:-001 s:0000 b:-001 l:0000 d:0000 ------ i:- s: -
---------------------------
DBG> : ":0:in `initialize'"
DBG> : ":0:in `initialize'"
[BUG] NODE_DASGN_CURR, but lv == 25181200 (line: 2)
ruby 2.0.0 (2006-02-14) [powerpc-darwin7.9.0]
Program received signal SIGABRT, Aborted.
0x9004312c in kill ()
Simplifying further,
lambda { |&block| }
DBG> : block
-- stack frame ------------
0x405000 (0000): 00000001
0x405004 (0001): 00000001 <- lfp <- dfp
-- control frame ----------
c:0003 p:-001 s:0002 b:0002 l:0001 d:0001 CFUNC i:initialize s: -
c:0002 p:-001 s:0001 b:0001 l:0000 d:0000 CFUNC i:initialize s: -
c:0001 p:-001 s:0000 b:-001 l:0000 d:0000 ------ i:- s: -
---------------------------
Program received signal EXC_BAD_ACCESS, Could not access memory.
yarv_bug () at vm_dump.c:551
551 for (i = 0; i < RARRAY(bt)->len; i++) {
#0 yarv_bug () at vm_dump.c:551
#1 0x0001a4b0 in rb_bug (fmt=0xaee00 "NODE_DASGN_CURR, but lv == %d (line: %d)") at error.c:163
#2 0x0001a4b0 in rb_bug (fmt=0xaee00 "NODE_DASGN_CURR, but lv == %d (line: %d)") at error.c:163
#3 0x0006a510 in iseq_compile_each (iseq=0x522820, ret=0xbfffec50, node=0x2d763c, poped=0) at compile.c:3120
#4 0x0006bc90 in iseq_compile_each (iseq=0x522820, ret=0xbfffed20, node=0x2d7628, poped=1) at compile.c:4007
#5 0x000664b0 in set_block_initializer (iseq=0x522820, node=0x2d7628, anchor=0xbfffedf0, didx=1) at compile.c:950
#6 0x000666b4 in set_block_local_tbl (iseq=0x522820, node=0x2d7614, anchor=0xbfffedf0) at compile.c:1031
#7 0x000657ac in iseq_compile (self=2979148, narg=4294967295) at compile.c:149
#8 0x0000dfc8 in iseq_init (self=2979148, node=2979348, name=2979168, file_name=2979308, parent=2979268, type=7, opt=0) at yarvcore.c:463
#9 0x00051054 in th_call0 (th=0x1801400, klass=4294967295, recv=2979148, id=10, oid=757935405, argc=6, argv=0xbffff060, body=0x2d8e10, nosuper=0) at vm.c:436
#10 0x00007aa0 in rb_call (klass=2985628, recv=2979148, mid=3001, argc=6, argv=0xbffff060, scope=1) at eval.c:1652
#11 0x0001e238 in rb_class_new_instance (argc=6, argv=0xbffff060, klass=28) at object.c:1473
#12 0x00065fc8 in new_child_iseq (iseq=0x5226d0, node=0xffffffff, name=28, parent=10, type=757935405, opt=28) at compile.c:723
#13 0x0006986c in iseq_compile_each (iseq=0x5226d0, ret=0xbffff2d0, node=0x2d7614, poped=0) at compile.c:2787
#14 0x00065a88 in iseq_compile (self=2979268, narg=4294967295) at compile.c:248
#15 0x0000dfc8 in iseq_init (self=2979268, node=2979348, name=2979288, file_name=2979308, parent=0, type=3, opt=0) at yarvcore.c:463
#16 0x00051054 in th_call0 (th=0x1801400, klass=4294967295, recv=2979268, id=10, oid=757935405, argc=6, argv=0xbffff540, body=0x2d8e10, nosuper=0) at vm.c:436
#17 0x00007aa0 in rb_call (klass=2985628, recv=2979268, mid=3001, argc=6, argv=0xbffff540, scope=1) at eval.c:1652
#18 0x0001e238 in rb_class_new_instance (argc=6, argv=0xbffff540, klass=28) at object.c:1473
#19 0x0000da20 in yarv_new_iseqval (node=4, name=4294967295, file=28, parent=10, type=757935405, opt=28) at yarvcore.c:287
#20 0x0000d898 in th_compile_from_node (th=0x4, node=0x2d7614, file=2979308) at yarvcore.c:234
#21 0x0000d924 in yarvcore_eval_parsed (node=481484, file=28) at yarvcore.c:250
#22 0x000059a0 in ruby_exec_internal () at eval.c:233
#23 0x000059dc in ruby_exec () at eval.c:247
#24 0x00005a38 in ruby_run () at eval.c:265
#25 0x00002a34 in main (argc=2, argv=0xbffffc14, envp=0x1c) at main.c:46
#26 0x000024ec in _start (argc=2, argv=0xbffffc14, envp=0xbffffc20) at /SourceCache/Csu/Csu-47/crt.c:267
#27 0x8fe1a278 in __dyld__dyld_start ()
HTH,
--
Christian Neukirchen <chneukirchen gmail.com> http://chneukirchen.org
--
ML: yarv-dev-en quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml
-> 77 2006-02-25 23:58 [chneukirchen gmail.c] Block-taking-blocks bugs 78 2006-02-26 00:14 ┗[ko1 atdot.net ]