B = binding; b.eval("xxx")

e$B0J2<$N$h$&$K$9$k$HMn$A$^$9!#e(B

% ./ruby -ve ’
b = binding
b.eval(“xxx”)’
ruby 1.9.0 (2006-06-29) [i686-linux]
zsh: segmentation fault (core dumped) ./ruby -ve ’ b = binding
b.eval(“xxx”)’
% gdb ruby core
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for
details.
This GDB was configured as “i486-linux-gnu”…Using host libthread_db
library “/lib/tls/libthread_db.so.1”.

Core was generated by `./ruby -ve
b = binding
b.eval(“xxx”)’.
Program terminated with signal 11, Segmentation fault.

warning: Can’t read pathname for load map: /.
Reading symbols from /lib/tls/libdl.so.2…done.
Loaded symbols for /lib/tls/libdl.so.2
Reading symbols from /lib/tls/libcrypt.so.1…done.
Loaded symbols for /lib/tls/libcrypt.so.1
Reading symbols from /lib/tls/libm.so.6…done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/tls/libc.so.6…done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2…done.
Loaded symbols for /lib/ld-linux.so.2
#0 error_line (frame=0xbff964e0, node=0x0) at eval.c:1150
1150 switch (TYPE(frame->self)) {
(gdb) bt
#0 error_line (frame=0xbff964e0, node=0x0) at eval.c:1150
#1 0x0805b78f in backtrace (lev=-1) at eval.c:6093
#2 0x080634bb in rb_longjmp (tag=6, mesg=3084694860) at eval.c:4378
#3 0x08063733 in rb_exc_raise (mesg=16) at eval.c:4426
#4 0x080666f5 in rb_method_missing (argc=1, argv=0xbff95fc0, obj=16) at
eval.c:5448
#5 0x0805609e in call_cfunc (func=0x80665f0 <rb_method_missing>,
recv=3084761620, len=70521, argc=-1210201136,
argv=0xbff95fc0) at eval.c:5503
#6 0x08061a10 in rb_call0 (klass=,
recv=3084761620, id=3977, oid=3977, argc=0, argv=0xbff95fc0,
block=0x0, body=0xb7ddb014, flags=16) at eval.c:5726
#7 0x08061d43 in rb_call (klass=3084766500, recv=3084761620, mid=3977,
argc=1, argv=0xbff95fc0, block=0x0,
scope=CALLING_FUNCALL, iter=0) at eval.c:5931
#8 0x080667f8 in method_missing (obj=3084761620, id=, argc=-1074175960, argv=0x0, block=0x0,
call_status=4) at eval.c:5487
#9 0x08061d84 in rb_call (klass=3084761600, recv=3084761620, mid=10769,
argc=0, argv=0x0, block=0x0, scope=CALLING_VCALL,
iter=0) at eval.c:5890
#10 0x0805e70a in rb_eval (self=3084761620, n=) at
eval.c:3315
#11 0x0806ab36 in eval (self=3084761620, src=3084694980,
scope=3084695000, file=0x8160631 “-e”, line=2) at eval.c:6267
#12 0x0806af09 in rb_f_eval (argc=2, argv=0xb7ddcbd0, self=3084761620)
at eval.c:6375
#13 0x0806b09d in bind_eval (argc=2, argv=0xb7ddcbd0, bind=3084695000)
at eval.c:8218
#14 0x0805609e in call_cfunc (func=0x806b030 <bind_eval>,
recv=3084695000, len=70521, argc=-1210201136, argv=0xbff968e0)
at eval.c:5503
#15 0x08061a10 in rb_call0 (klass=,
recv=3084695000, id=4017, oid=4017, argc=-1074174212,
argv=0xbff968e0, block=0x0, body=0xb7dcc80c, flags=0) at eval.c:5726
#16 0x08061d43 in rb_call (klass=3084699820, recv=3084695000, mid=4017,
argc=1, argv=0xbff968e0, block=0x0,
scope=CALLING_NORMAL, iter=0) at eval.c:5931
#17 0x0805e586 in rb_eval (self=3084761620, n=) at
eval.c:3294
#18 0x0806ccd0 in ruby_exec_internal () at eval.c:1583
#19 0x0806cd06 in ruby_exec () at eval.c:1598
#20 0x0806cd30 in ruby_run () at eval.c:1614
#21 0x0805457c in main (argc=-1210201136, argv=0xb7ddcbd0,
envp=0xbff96d64) at main.c:43
(gdb)

In article [email protected],
Tanaka A. [email protected] writes:

% ./ruby -ve ’
b = binding
b.eval(“xxx”)’
ruby 1.9.0 (2006-06-29) [i686-linux]
zsh: segmentation fault (core dumped) ./ruby -ve ’ b = binding b.eval(“xxx”)’

e$BD4$Y$F$_$k$H=i4|2=$7$F$$$J$$CM$r;H$C$F$7$^$C$F$$$k$h$&$G!"$He(B
e$B$j$"$($:!“0J2<$N$h$&$K$9$k$HMn$A$J$/$J$j$^$9$,!”$3$l$,@5$7$$e(B
e$B$+$I$&$+H=CG$,$D$-$^$;$s!#e(B

e$B$H$$$&$+!"$3$NCM$,;H$o$l$k$H$OA[[email protected]$,$"$k$he(B
e$B$&$K;W$$$^$9!#e(B

e$B$I$&$J$s$G$7$g$&e(B?

Index: eval.c

RCS file: /src/ruby/eval.c,v
retrieving revision 1.910
diff -u -p -r1.910 eval.c
— eval.c 28 Jun 2006 04:51:27 -0000 1.910
+++ eval.c 30 Jun 2006 09:03:43 -0000
@@ -8165,6 +8165,7 @@ rb_f_binding(VALUE self)
VALUE bind;

 PUSH_FRAME(Qtrue);
  • ruby_frame->self = self;
    PUSH_BLOCK(ruby_frame->block,0,0);
    bind = Data_Make_Struct(rb_cBinding,struct
    BLOCK,blk_mark,blk_free,data);
    *data = *ruby_frame->block;

In article [email protected],
Tanaka A. [email protected] writes:

e$B$H$$$&$+!"$3$NCM$,;H$o$l$k$H$OA[[email protected]$,$"$k$he(B
e$B$&$K;W$$$^$9!#e(B

e$B$I$&$J$s$G$7$g$&e(B?

e$B$=$l$O$=$l$H$7$F$I$&$b:[email protected]$,Dc$/$Fe(B (boron e$B$G$OMn$A$J$/$Fe(B)
e$B$J$s$J$N$G!"$A$g$C$H9)IW$7$F$_$^$7$?!#e(B

e$B0J2<$N$h$&$K$9$k$H!"e(Bboron e$B$G$bMn$A$k$h$&$K$J$j$^$9!#e(B

Index: eval.c

RCS file: /src/ruby/eval.c,v
retrieving revision 1.912
diff -u -p -r1.912 eval.c
— eval.c 29 Jun 2006 14:05:40 -0000 1.912
+++ eval.c 1 Jul 2006 09:54:54 -0000
@@ -8169,6 +8169,7 @@ rb_f_binding(VALUE self)
VALUE bind;

 PUSH_FRAME(Qtrue);
  • ruby_frame->self = 8;
    PUSH_BLOCK(ruby_frame->block,0,0);
    bind = Data_Make_Struct(rb_cBinding,struct
    BLOCK,blk_mark,blk_free,data);
    *data = *ruby_frame->block;

PUSH_FRAME e$B$G$Oe(B ruby_frame->self e$B$D$^$je(B frame.self
e$B$O=i4|2=e(B
e$B$7$F$$$J$$$N$G!"$I$s$JCM$G$"$C$F$b$*$+$7$/$"$j$^$;$s!#e(B
e$B$=$3$Ge(B 8 e$B$H$$$&[email protected]$C$?$H$$$&[email protected]$rA[Dj$7$F$
$k$H!"e(B
e$BMn$A$k$H$$$&$o$1$G$9!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:28913] Re: b = binding; b.eval(“xxx”)”
on Fri, 30 Jun 2006 18:11:25 +0900, Tanaka A. [email protected]
writes:

|e$BD4$Y$F$_$k$H=i4|2=$7$F$$$J$$CM$r;H$C$F$7$^$C$F$$$k$h$&$G!"$He(B
|e$B$j$"$($:!“0J2<$N$h$&$K$9$k$HMn$A$J$/$J$j$^$9$,!”$3$l$,@5$7$$e(B
|e$B$+$I$&$+H=CG$,$D$-$^$;$s!#e(B
|
|e$B$H$$$&$+!"$3$NCM$,;H$o$l$k$H$OA[[email protected]$,$"$k$he(B
|e$B$&$K;W$$$^$9!#e(B
|
|e$B$I$&$J$s$G$7$g$&e(B?

e$B=i4|2=$7$F$J$$CM$KMj$k$N$b$$$+$,$J$b$N$+$H;W$&$N$G!"e(B
PUSH_FRAMEe$B$NCf$G=i4|2=$9$k$3$H$K$7$^$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs