[*0];0 dumps core


#1

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

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

$ ./ruby -e ‘[*0];0’
-e:1: – control frame ----------
c:0003 p:0007 s:0006 b:0005 l:000004 d:000004 TOP -e:1
c:0002 p:---- s:0003 b:0003 l:000002 d:000002 FINISH :inherited
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

– backtrace of native function call (Use addr2line) –
0x80daaf5
0x80f3d50
0x80d80e9
0x80d8514
0x80d8909
0x8059042
0x8059066
0x805d5f1
0x8056d1f
0xb7d4bea8
0x8056c51

[BUG] Stack consistency error (sp: 6, bp: 5)
ruby 1.9.0 (2007-07-01) [i686-linux]

e$B%"%!<%H$7$^$7$?e(B (core dumped)

[ruby-dev:31068] e$B$HF1$8LdBj$@$H;W$$$^$9!#e(B

Index: compile.c

— compile.c (revision 12674)
+++ compile.c (working copy)
@@ -3940,6 +3940,9 @@
case NODE_SPLAT:{
COMPILE(ret, “splat”, node->nd_head);
ADD_INSN1(ret, nd_line(node), splatarray, Qfalse);

  • if (poped) {
  •  ADD_INSN(ret, nd_line(node), pop);
    
  • }
    break;
    }
    case NODE_DEFN:{

#2

e$B!!$5$5$@$G$9!#e(B

Yusuke ENDOH wrote:

$ ./ruby -e ‘[*0];0’

[ruby-dev:31068] e$B$HF1$8LdBj$@$H;W$$$^$9!#e(B

e$B!!$"$j$,$H$&$4$6$$$^$9!#=$@5$7$^$7$?!#$D$$$G$K!"e(B[*0]; 0 e$B$Oe(B

0000 putobject 0
0002 leave

e$B$H%3%s%Q%$%k$9$k$h$&$K$7$^$7$?!#e(B


#3

e$B!!$5$5$@$G$9!#e(B

SASADA Koichi wrote:

e$B!!$"$j$,$H$&$4$6$$$^$9!#=$@5$7$^$7$?!#$D$$$G$K!"e(B[*0]; 0 e$B$Oe(B

0000 putobject 0
0002 leave

e$B$H%3%s%Q%$%k$9$k$h$&$K$7$^$7$?!#e(B

e$B$"!#$3$l$GNc30$,H/@8$7$J$/$J$k$N$O$^$:$$$+$J$!!#e(B

def (o=’’).to_splat
raise
end

[*o]; 0


#4

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

In message “Re: [ruby-dev:31126] Re: [*0];0 dumps core”
on Wed, 4 Jul 2007 04:45:39 +0900, SASADA Koichi removed_email_address@domain.invalid
writes:

|SASADA Koichi wrote:
|> e$B!!$"$j$,$H$&$4$6$$$^$9!#=$@5$7$^$7$?!#$D$$$G$K!“e(B[*0]; 0 e$B$Oe(B
|>
|> 0000 putobject 0
|> 0002 leave
|>
|> e$B$H%3%s%Q%$%k$9$k$h$&$K$7$^$7$?!#e(B
|
|e$B$”!#$3$l$GNc30$,H/@8$7$J$/$J$k$N$O$^$:$$$+$J$!!#e(B
|
|def (o=’’).to_splat
| raise
|end
|
|[*o]; 0

e$B$I$&$$$&M}6~$G$3$l$,Nc30$,H/@8$7$J$/$J$C$?$N$+$A$g$C$H$o$+$ie(B
e$B$J$$$N$G$9$,!"@Q6KE*$K:GE,2=$r9T$&$N$O%j%F%i%kBP>]$N$H$-$@$1e(B
e$B$H$$$&$N$O$I$&$G$7$g$&!#87L)$K$O%j%F%i%k$Ne(Bto_splate$B$,Dj5A$5$le(B
e$B$k2DG=@-$b$"$k$1$I!"$=$l$OBE6($G$-$k$H;W$$$^$9!#e(B