[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:26:51 +0200 (GMT-2)

On 6 Dec 2000, Torbjorn Granlund wrote:

> Pearu Peterson <address@hidden> writes:
>   Calculating 2**111111111:
>   mp_allocate( 4 ) ->0x8049b80
>   Segmentation fault
>   Is this a bug of GMP or anything else? Any hints how to get a control over
>   this SegFault are appreciated. Even if there is memory shortage (though
>   there shouldn't be, right?), I would expect a more graceful exit.
> Some malloc packages return a valid pointer even if there is actually
> less VM available.  If the total VM usage of all processes on the
> system at some point gets greater than what is available, the system
> shots down on process with SIGSEGV.
> I suspect that this is what happens on your GNU/Linux system.
> If I am right, you should be able to make the program work by adding
> more swap.

Thanks for your interesting suggestion!

I am running Linux on a machine with 96MB physical memory and with a 256MB
swap. So, there should be plenty of VM. I even tried the reboot in order
to start with a fresh startup (with X and other stuff running there was
50MB free phys. memory available) but still with a SegFault crash. 

Have anybody tried this test on a different machine? Does it run at all?
Any estimates in MB how big is acctually 2**111111111?

Also note that SegFault happens before the malloc call (see the
supplied gmpy_allocate function).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]