Try this patch, please: diff -c /home/fwinkel/stuff/numbers-c.c\~ /home/fwinkel/stuff/numbers-c.c *** /home/fwinkel/stuff/numbers-c.c~ 2005-09-28 22:37:44.000000000 +0200 --- /home/fwinkel/stuff/numbers-c.c 2005-10-12 08:54:49.120990048 +0200 *************** *** 285,292 ****
mpz_init_set_si(big2, C_unfix(y)); setbig(big1, x); ! mpz_sub(big1, big1, big2); ! alloc_bignum(k, big1, 1); } --- 285,292 ---- mpz_init_set_si(big2, C_unfix(y)); setbig(big1, x); ! mpz_sub(big2, big1, big2); ! alloc_bignum(k, big2, 1); } cheers, felix On 10/12/05, Alex Shinn <[EMAIL PROTECTED]> wrote: > At Wed, 12 Oct 2005 08:23:07 +0200, felix winkelmann wrote: > > > > The code for big_random looks ok, could this be related > > to expt? (does the error also appear when expt is not involved?) > > OK, this is just odd. > > $ csi -R numbers -eval '(print (bitwise-and (random 18446744073709551616) > 18446744073709551616))' > 0 > $ csi -R numbers -eval '(print (bitwise-and (random 18446744073709551616) (- > 18446744073709551616 1)))' > 1418227916859036949 > *** glibc detected *** double free or corruption (fasttop): 0x080a7a70 *** > $ csi -R numbers -eval '(print (bitwise-and 18446744073709551616 (- > 18446744073709551616 1)))' > 0 > *** glibc detected *** double free or corruption (fasttop): 0x080a7a70 *** > > The error doesn't occur until you quit. It's also related to > bitwise-and and -, not random or expt. In general: > > (bitwise-and bignum (- bignum fixum)) > > causes the error, but > > (bitwise-and (- bignum fixum) bignum) > (bitwise-and bignum (- bignum bignum)) > > do not. > > -- > Alex > > > On 10/12/05, Alex Shinn <[EMAIL PROTECTED]> wrote: > > > At Wed, 12 Oct 2005 07:35:36 +0200, felix winkelmann wrote: > > > > > > > > Hm... Works fine on this machine. I'll try it on another tonight. > > > > > > > > Can someone else reproduce this problem? > > > > > > I can: > > > > > > $ csi -R numbers -eval '(bitwise-and (random (expt 2 64)) (- (expt 2 64) > > > 1))' > > > *** glibc detected *** double free or corruption (fasttop): 0x080a7c08 *** > > > Aborted > > > > > > $ csi -v|grep Version > > > Version 2, Build 2 - linux-unix-gnu-x86 - [ dload ] > > > > > > $ uname -a > > > Linux strelka 2.6.6 #5 SMP Wed Jun 30 18:38:16 JST 2004 i686 GNU/Linux > > > > > > GMP version 4.1.4-6. > > > > > > -- > > > Alex > > > > > > _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users