SEGV by ./ruby -v -rprofile -e ''

e$B$=$&$$$($P!"e(Bprofile e$B$,e(B [BUG] Segmentation fault
e$B$K$J$j$^$9!#e(B

% ./ruby -v -rprofile -e ‘’
ruby 1.9.0 (2007-11-10 patchlevel 0) [i686-linux]
./ruby: – control frame ----------
c:0002 p:-33979392 s:0003 b:0003 l:002340 d:002340 TOP
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

– backtrace of native function call (Use addr2line) –
0x80e7195
0x8104a73
0x8104b3b
0x80b97e0
0xb7fe4420
0x80dcd40
0x805fd92
0x80e7735
0x80e8b89
0x80e8bd7
0x80e62fc
0x805a898
0x805abb0
0x80b7695
0x80b8fdc
0x80de96a
0x80b7950
0x805d334
0x8057a38
0xb7e4eea8
0x8057951

e$B1sF#$H?=$7$^$9!#e(B

07/11/11 e$B$Ke(B Tanaka A.[email protected] e$B$5$s$O=q$-$^$7$?e(B:

e$B$=$&$$$($P!"e(Bprofile e$B$,e(B [BUG] Segmentation fault e$B$K$J$j$^$9!#e(B

% ./ruby -v -rprofile -e ‘’
(snip)

e$BLdBj$r4JC1$K$G$-$^$7$?!#e(B

$ cat t.rb
set_trace_func(proc {})
$ ./ruby -rt -e ‘’
(snip)
[BUG] Segmentation fault
ruby 1.9.0 (2007-12-10) [i686-linux]

e$B$A$c$s$HDI$C$F$$$^$;$s$,!"$*$=$i$/0J2<$bF1$8M}M3$GMn$A$F$$$^$9!#e(B

$ ./ruby -e ‘set_trace_func(proc {}); require “zlib”’
(snip)
[BUG] Segmentation fault
ruby 1.9.0 (2007-12-10) [i686-linux]

e$BB?J,$3$s$J>u67$G$9!#e(B

  • rb_vm_call_cfunc e$B$,:n$ke(B iseq e$B$Oe(B (NODE*)0
    e$B$G:n$i$l$F$$$F!"e(B
    e$B$=$Ne(B iseq e$B$Oe(B local_size e$B$,e(B 0
    (e$B$^$?$OL$=i4|2=!)e(B) e$B$K$J$C$F$$$ke(B

  • iseq->local_size e$B$,e(B 0 e$B$N>uBV$Ge(B vm_make_env_object
    e$B$9$k$He(B
    svar (= lftp[-1]) e$B$,;2>H$G$-$J$$4D6-$,[email protected]$i$l$ke(B (e$B;2>H$7$?$ie(B
    segv)

  • ruby_cref e$B$Oe(B get_cref e$B$He(B lfp_get_special_cref e$B7PM3$Ge(B
    svar e$B$re(B
    e$B;2>H$9$ke(B

  • rb_vm_call_cfunc e$B$N=*HW$Ge(B call_trace_proc
    e$B$,8F$S=P$5$l!"$=$NCf$Ge(B
    rb_binding_new e$B$,8F$S=P$5$l$ke(B

  • rb_binding_new e$B$Oe(B vm_make_env_object e$B$r<B9T$7!"$=$ND>8e$Ke(B
    ruby_cref e$B$r<B9T$9$ke(B => segv

e$BMWLs$9$k$H!"e(Bset_trace_func e$B$He(B rb_vm_call_cfunc
e$B$rF1;~$K;HMQ$9$k$He(B
segv [email protected]$H;W$$$^$9!#e(B

e$B$I$&BP=h$9$Y$-$+$o$+$j$^$;$s$,!"Nc$($Pe(B iseq_compile e$B$Ge(B
(NODE*)0 e$B$Ne(B
e$B;~$be(B local_size e$B$r=i4|2=$7$F$d$l$P$h$$$H;W$$$^$9!#e(B

Index: compile.c

— compile.c (revision 14185)
+++ compile.c (working copy)
@@ -145,6 +145,7 @@

 if (node == 0) {

COMPILE(ret, “nil”, node);

  • iseq_set_local_table(iseq, 0);
    }
    else if (nd_type(node) == NODE_SCOPE) {
    /* iseq type of top, method, class, block */

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