Rb_eval_string("lambda{}") dumps core


#1

e$B<r0f$G$9!#e(B

1.9e$B$G0J2<$N$h$&$J3HD%%i%$%V%i%j$re(Brequiree$B$9$k$HMn$A$k$h$&$G$9!#e(B

#include <ruby.h>
void Init_foo(void)
{
rb_eval_string(“lambda{}”);
}

% ruby-19 -rfoo -ve “”
ruby 1.9.0 (2007-07-07 patchlevel 0) [i686-linux]
(eval):1: – control frame ----------
c:0005 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :lambda
c:0004 p:0007 s:0006 b:0006 l:0x1650 d:0x1688 EVAL (eval):1
c:0003 p:---- s:0005 b:0005 l:000004 d:000004 FINISH :initialize
c:0002 p:-33955804 s:0003 b:0003 l:0x1650 d:0x1650 TOP
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

DBG> : “(eval):1:in `/home/sakai/src/foo/foo.so’”
– backtrace of native function call (Use addr2line) –
0x80d59c0
0x80ed629
0x80ed6c2
0x80ae170
0x40034825
0x400f6678
0x80cd607
0x805e5f1
0x805e6cc
0x80d3a01
0x80d4c85
0x80d41d5
0x80cfe08
0x80d31b0
0x805c079
0x8059cfd
0x400197a2
0x80e9f50
0x80d378c
0x80f1259
0x80f1311
0x805b280
0x80ac236
0x80ac7ce
0x80ad9de
0x80598b3
0x8056e1b
0x400e2e36
0x8056d41


#2

e$B<r0f$G$9!#e(B

From: Masahiro S. (e$B<r0f@/M5e(B) removed_email_address@domain.invalid
Date: Sun, 8 Jul 2007 00:30:39 +0900

% ruby-19 -rfoo -ve “”
ruby 1.9.0 (2007-07-07 patchlevel 0) [i686-linux]
(eval):1: – control frame ----------
c:0005 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :lambda
c:0004 p:0007 s:0006 b:0006 l:0x1650 d:0x1688 EVAL (eval):1
c:0003 p:---- s:0005 b:0005 l:000004 d:000004 FINISH :initialize
c:0002 p:-33955804 s:0003 b:0003 l:0x1650 d:0x1650 TOP
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

DBG> : “(eval):1:in `/home/sakai/src/foo/foo.so’”

lfp_get_special_cref() e$B$Ge(B values e$B$,2?8N$+e(B 0x11
e$B$K$J$C$F$$$k$N$,860x$@$Ce(B
e$B$?$N$G!“0J2<$N$h$&$J%Q%C%A$r$”$F$k$3$H$G2sHr$G$-$^$7$?!#e(B
e$B@5$7$$BP=h$G$O$J$$$H;W$$$^$9$,!"e(B

Index: insnhelper.ci

— insnhelper.ci (e$B%j%S%8%g%se(B 12814)
+++ insnhelper.ci (e$B:n6H%3%T!<e(B)
@@ -729,7 +729,7 @@
lfp_get_special_cref(VALUE *lfp)
{
struct RValues *values;

  • if (((VALUE)(values = (void *)lfp[-1])) != Qnil &&
    values->basic.klass) {
  • if (!rb_special_const_p((VALUE)(values = (void *)(lfp[-1]))) &&
    values->basic.klass) {
    return (NODE *)values->basic.klass;
    }
    else {