[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SegFault in 2**111111111 calculation
From: |
Pearu Peterson |
Subject: |
Re: SegFault in 2**111111111 calculation |
Date: |
Wed, 6 Dec 2000 22:38:33 +0200 (GMT-2) |
On Wed, 6 Dec 2000, Pearu Peterson wrote:
> Also note that SegFault happens before the malloc call (see the
> supplied gmpy_allocate function).
Sorry, this is not obvious. But with
static void * gmpy_allocate(size_t size)
{
void *res;
fprintf(stderr, "mp_allocate( %d )\n", size);
res = (void *)malloc(size);
fprintf(stderr, "mp_allocate( %d ) ->%8p\n", size, res);
return res;
}
I'll get
Calculating 2**111111111:
mp_allocate( 4 )
mp_allocate( 4 ) ->0x8049ba0
Segmentation fault
Which shows that the problem is not in malloc, at least not in the one
called in gmpy_allocate.
I guess the next thing for me is to read the GMP source;-)
Pearu
Re: SegFault in 2**111111111 calculation, Kevin Ryde, 2000/12/06