[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gmp] mpz_probab_prime memory allocation
From: |
Mikkonen Tomi |
Subject: |
[Bug-gmp] mpz_probab_prime memory allocation |
Date: |
Mon, 18 Sep 2000 18:09:25 +0300 (EET DST) |
Hello
There is probably a bug in
gmp-3.0
The following program allocates more and more memory. It would crash eventually
if the loop was infinite (size of t not infinite).
#include<stdio.h>
#include "gmp.h"
int main()
{
mpz_t t;
unsigned long i;
mpz_init( t );
for( i = 1; i < 2000000000 ; i++ )
{
mpz_set_ui( t, 2000000000 - i );
mpz_probab_prime_p( t ,3 );
}
mpz_clear( t );
}
So it seems that mpz_probab_prime_p() function does not release all the memory
it uses.
Compiled with command:
gcc -g -I. -mcpu=pentiumpro -o eset e_set.c
/home/m153446/gmp-3.0/.libs/libgmp.a -lm
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Linux graniitti.dmi.tut.fi 2.2.12-20smp #1 SMP Mon Sep 27 10:34:45 EDT 1999
i686 unknown
pentium3-pc-linux-gnu
Tomi Mikkonen
address@hidden
- [Bug-gmp] mpz_probab_prime memory allocation,
Mikkonen Tomi <=