Assertion failed in array.c on mswin32 Ruby (trunk)


#1

e$B=uED$G$9!#e(B
e$BJs9p$@$1$G$9!#e(B

mswin32e$BHGe(B Ruby(trunk) e$B$Ge(B nmake
e$B$9$k$He(B1e$B2sL$O$9$s$J$j:G8e$^$Ge(B
e$B%3%s%Q%$%k!"%j%s%/$G$-$k$N$G$9$,!"e(B1e$B2sL$ND>8e$K$b$&0lEYe(B
nmake e$B$9$k$He(B array.c e$B$Ne(B 150e$B9TL$Ge(B Assertion failed
e$B$,H/@8$7$^$9!#e(B

nmake -f enc.mk RUBY=".\miniruby.exe
-I…/…/…/…/svn/ruby/trunk/lib "
MINIRUBY=".\miniruby.exe -I…/…/…/…/svn/ruby/trunk/lib " -l srcs
.\miniruby.exe -I…/…/…/…/svn/ruby/trunk/lib
…/…/…/…/svn/ruby/trunk/enc/trans/make_transdb.rb transdb.h.new
…/…/…/…/svn/ruby/trunk/enc/trans enc/trans
Assertion failed: RARRAY_LEN(ary) == len, file
…/…/…/…/svn/ruby/trunk/array.c, line 150

e$B%3%s%Q%$%ie(B e$B$Ne(B cl e$B$N%P!<%8%g%s$Oe(B
Microsoft® 32-bit C/C++ Optimizing Compiler
Version 14.00.50727.762 for 80x86
e$B$G$9e(B(Visual Studio 2005e$BImB0$N$b$N!#e(B)
OSe$B$Oe(BWindows XP e$B$G$9!#e(B

mingw32 e$B$de(B cygwin e$B$G$OH/@8$7$F$$$J$$$G$9!#e(B

e$B=uEDe(B e$B2m5*e(B


#2

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:36704] Assertion failed in array.c on mswin32 Ruby
(trunk)”
on Oct.11,2008 07:31:17, removed_email_address@domain.invalid wrote:

mswin32e$BHGe(B Ruby(trunk) e$B$Ge(B nmake e$B$9$k$He(B1e$B2sL$O$9$s$J$j:G8e$^$Ge(B
e$B%3%s%Q%$%k!"%j%s%/$G$-$k$N$G$9$,!"e(B1e$B2sL$ND>8e$K$b$&0lEYe(B
nmake e$B$9$k$He(B array.c e$B$Ne(B 150e$B9TL$Ge(B Assertion failed
e$B$,H/@8$7$^$9!#e(B

VC++6e$B$G$b:F8=$7$J$$$s$G$9$h$M$(!#e(B

e$B$G!"$J$s$H$J$/0J2<$N%Q%C%A$GLdBj$O2sHr$G$-$k$h$&$J5$$,$9$k$se(B
e$B$G$9$,!"$J$s$G$3$l$GD>$k$N$+$O??LLL$K9M$($F$J$$$N$G$o$+$j$^e(B
e$B$;$s!#e(B

RESIZE_CAPA()e$B$NCf$Ge(BARY_SET_LEN()e$B$9$k%Q%9$,$"$k$N$b$I$&$b5$e(B

e$B$K$+$+$k$s$G$9$,e(B…

Index: array.c

— array.c (revision 19786)
+++ array.c (working copy)
@@ -2927,10 +2927,10 @@ rb_ary_compact_bang(VALUE ary)
if (RARRAY_LEN(ary) == n) {
return Qnil;
}

  • ARY_SET_LEN(ary, n);
    if (n * 2 < ARY_CAPA(ary) && ARY_DEFAULT_SIZE * 2 < ARY_CAPA(ary))
    {
    RESIZE_CAPA(ary, n * 2);
    }
  • ARY_SET_LEN(ary, n);

    return ary;
    }

e$B$=$l$G$O!#e(B


#3

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:36735] Re: Assertion failed in array.c on mswin32
Ruby (trunk)”
on Oct.15,2008 12:47:40, removed_email_address@domain.invalid wrote:

e$B$G!"$J$s$H$J$/0J2<$N%Q%C%A$GLdBj$O2sHr$G$-$k$h$&$J5$$,$9$k$se(B
e$B$G$9$,!"$J$s$G$3$l$GD>$k$N$+$O??LLL$K9M$($F$J$$$N$G$o$+$j$^e(B
e$B$;$s!#e(B

RESIZE_CAPA()e$B$NCf$Ge(BARY_SET_LEN()e$B$9$k%Q%9$,$"$k$N$b$I$&$b5$e(B

e$B$K$+$+$k$s$G$9$,e(B…

e$BD>46$KMj$i$J$$$G??LLL$K860x$r9M$($F$_$?$H$3$m!“e(BRESIZE_CAPA()
e$B$NCf$G!“e(Bcapacitye$B$,e(Blene$B$h$jC;$$;~$Ke(Bas.arye$B$N=*C<$r1[$($F%3%T!<$re(B
e$B$7$F$7$^$&$3$H$,$”$k!”$H$$$&$3$H$N$h$&$G$9!#e(B
e$BNc$($P0J2<$N%Q%C%A$N$h$&$K$9$k$3$H$,9M$($i$l$^$9$,!"e(Bcapacity
e$B$,e(Blene$B$h$jC;$$>l9g$K2?$,5/$3$k$Y$-$+$O9M$($J$$$H$$$1$J$$$h$&$Ke(B
e$B;W$$$^$9e(B([BUG]e$B$H$+e(B)e$B!#e(B

Index: array.c

— array.c (revision 19786)
+++ array.c (working copy)
@@ -145,9 +145,9 @@
if (!ARY_EMBED_P(ary)) {
long len = RARRAY_LEN(ary);
VALUE *ptr = RARRAY_PTR(ary);

  •        MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len);
    
  •        MEMCPY(RARRAY(ary)->as.ary, ptr, VALUE, len > capacity ? 
    

capacity : len);
FL_SET_EMBED(ary);

  •        ARY_SET_LEN(ary, len);
    
  •        if (len > capacity) ARY_SET_LEN(ary, capacity);
           xfree(ptr);
       }
    
    }

e$B$=$l$G$O!#e(B


#4

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

In message “Re: [ruby-dev:36738] Re: Assertion failed in array.c on
mswin32 Ruby (trunk)”
on Wed, 15 Oct 2008 15:24:48 +0900, “U.Nakamura”
removed_email_address@domain.invalid writes:

|e$BD>46$KMj$i$J$$$G??LLL$K860x$r9M$($F$_$?$H$3$m!“e(BRESIZE_CAPA()
|e$B$NCf$G!“e(Bcapacitye$B$,e(Blene$B$h$jC;$$;~$Ke(Bas.arye$B$N=*C<$r1[$($F%3%T!<$re(B
|e$B$7$F$7$^$&$3$H$,$”$k!”$H$$$&$3$H$N$h$&$G$9!#e(B
|e$BNc$($P0J2<$N%Q%C%A$N$h$&$K$9$k$3$H$,9M$($i$l$^$9$,!"e(Bcapacity
|e$B$,e(Blene$B$h$jC;$$>l9g$K2?$,5/$3$k$Y$-$+$O9M$($J$$$H$$$1$J$$$h$&$Ke(B
|e$B;W$$$^$9e(B([BUG]e$B$H$+e(B)e$B!#e(B

e$BK\MhE*$JOC$r$9$k$He(Bcapacitye$B$,e(Blene$B$h$j$bC;$$$N$O%P%0$@$H;W$&$Ne(B
e$B$G!"$=$N%P%0$r$D$V$9I,MW$,$"$k$H;W$$$^$9$,!#e(B

|— array.c (revision 19786)
|+++ array.c (working copy)

e$B$H$j$"$($:!"$3$N%Q%C%A$r%3%_%C%H$7$F$$$?$@$$$F$b9=$$$^$;$s!#e(B


#5

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:36744] Re: Assertion failed in array.c on mswin32
Ruby (trunk)”
on Oct.15,2008 18:28:18, removed_email_address@domain.invalid wrote:

|e$BD>46$KMj$i$J$$$G??LLL$K860x$r9M$($F$_$?$H$3$m!“e(BRESIZE_CAPA()
|e$B$NCf$G!“e(Bcapacitye$B$,e(Blene$B$h$jC;$$;~$Ke(Bas.arye$B$N=*C<$r1[$($F%3%T!<$re(B
|e$B$7$F$7$^$&$3$H$,$”$k!”$H$$$&$3$H$N$h$&$G$9!#e(B
|e$BNc$($P0J2<$N%Q%C%A$N$h$&$K$9$k$3$H$,9M$($i$l$^$9$,!"e(Bcapacity
|e$B$,e(Blene$B$h$jC;$$>l9g$K2?$,5/$3$k$Y$-$+$O9M$($J$$$H$$$1$J$$$h$&$Ke(B
|e$B;W$$$^$9e(B([BUG]e$B$H$+e(B)e$B!#e(B

e$BK\MhE*$JOC$r$9$k$He(Bcapacitye$B$,e(Blene$B$h$j$bC;$$$N$O%P%0$@$H;W$&$Ne(B
e$B$G!"$=$N%P%0$r$D$V$9I,MW$,$"$k$H;W$$$^$9$,!#e(B

e$B0l$DA0$N%Q%C%Ae(B([ruby-dev:36735])e$B$,$=$N%P%0$rDY$7$F$$$k%Q%C%Ae(B
e$B$G$9!#e(B
e$B$G!"e(Blene$B$h$jC;$$e(Bcapacitye$B$Ge(BRESIZE_CAPA()e$B$r8F$S=P$9$N$,%P%0$G$“e(B
e$B$k$J$i$=$l$r%3!<%I$GI=8=$9$l$P$h$$$H;W$&$N$G$9$,!”$o$6$o$63:e(B
e$BEvIt$K$O85!9e(Blene$B$rJQ99$9$k%3!<%I$bF~$C$F$$$k$?$a!"85$N%3!<%I$Ne(B
e$B0U?^$,$o$+$i$J$$$N$G3NG’$7$?$+$C$?$N$G$9!#e(B

e$B$G!"@h$N%Q%C%A$Oe(Blene$B$rJQ99$7$h$&$H$7$F$k$s$@$+$ie(BRESIZE_CAPA()
e$B$KI,MW$J$i$Pe(Blene$B$rJQ99$9$k5!G=$bM?$($h$&$H$7$F$k$s$@$H2r<a$7$Fe(B
e$B:n@.$7$?$o$1$G$9$,!"e(B

e$B$H$j$"$($:!"$3$N%Q%C%A$r%3%_%C%H$7$F$$$?$@$$$F$b9=$$$^$;$s!#e(B

e$B;d$N9%$_$r8@$($P!"e(B[BUG]e$B$G;&$9J}$,$$$$$s$8$c$J$$$+$H;W$$$^$9!#e(B

e$B85$N%3!<%I$r=q$$$?e(Byuguie$B$5$s$N<qL#$rB:=E$9$k$He(Bassert()e$B$G$9$+e(B

e$B$M!#e(B

e$B$=$l$G$O!#e(B


#6

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

In message “Re: [ruby-dev:36745] Re: Assertion failed in array.c on
mswin32 Ruby (trunk)”
on Wed, 15 Oct 2008 18:43:11 +0900, “U.Nakamura”
removed_email_address@domain.invalid writes:

|e$B0l$DA0$N%Q%C%Ae(B([ruby-dev:36735])e$B$,$=$N%P%0$rDY$7$F$$$k%Q%C%Ae(B
|e$B$G$9!#e(B
|e$B$G!"e(Blene$B$h$jC;$$e(Bcapacitye$B$Ge(BRESIZE_CAPA()e$B$r8F$S=P$9$N$,%P%0$G$“e(B
|e$B$k$J$i$=$l$r%3!<%I$GI=8=$9$l$P$h$$$H;W$&$N$G$9$,!”$o$6$o$63:e(B
|e$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(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:36748] Re: Assertion failed in array.c on mswin32
Ruby (trunk)”
on Oct.15,2008 22:09:24, removed_email_address@domain.invalid wrote:

RESIZE_CAPA()e$B$NCf$Ne(BARY_SET_LEN(ary, len);e$B$,$"$k$3$H$r5$$K$7e(B
e$B$F$$$i$C$7$c$k$s$G$7$g$&$+!#$3$N%1!<%9$Oe(Bresizee$B$N7k2Le(Bembede$B$9e(B
e$B$k%5%$%:$K$J$C$?$?$a$KH/@8$7$F$$$k$N$Ge(B(embede$B$G$Oe(Bsizee$B$r;XDj$7e(B
e$B$J$$$o$1$K$O$$$+$J$$e(B)e$B!"e(BRESIZE_CAPA()e$B$Ke(Blene$B$rJQ99$9$k5!G=$rM?e(B
e$B$($h$&$H$7$F$$$k$H$$$&$N$OE,@Z$G$O$J$$$+$b$7$l$^$;$s!#e(B

e$B$"!<!"e(Bembede$B$H$=$&$G$J$$>l9g$H$Ge(Blene$B$rF~$l$F$k>l=j$,0c$&$s$G$9e(B
e$B$M!#$H$$$&$o$1$G;d$NJ}$,M}2r$G$-$F$^$;$s$G$7$?!#e(B

|> e$B$H$j$"$($:!"$3$N%Q%C%A$r%3%%C%H$7$F$$$?$@$$$F$b9=$$$^$;$s!#e(B
|
|e$B;d$N9%$
$r8@$($P!"e(B[BUG]e$B$G;&$9J}$,$$$$$s$8$c$J$$$+$H;W$$$^$9!#e(B
|# e$B85$N%3!<%I$r=q$$$?e(Byuguie$B$5$s$N<qL#$rB:=E$9$k$He(Bassert()e$B$G$9$+e(B
|# e$B$M!#e(B

e$B$=$NJU$O$*$^$+$;$7$^$9!#e(B

assert()e$B$G;`$L$h$&$K$7$F$*$-$^$7$?!#e(B

e$B$=$l$G$O!#e(B


#8

e$B=uED$G$9!#e(B

U.Nakamura wrote:

e$B$;$s!#e(B
e$B%Q%C%A$Ge(BAssertion failede$B$OH/@8$7$J$/$J$j$^$7$?!#e(B

e$B=uEDe(B e$B2m5*e(B