GMP terminates when out of memory

Bjarke Roune bjarke at
Sun Dec 28 16:54:22 CET 2008

On Sun, Dec 28, 2008 at 10:44 AM, Roberto Bagnara <bagnara at> wrote:
> Yes, we have one test in our testsuite that simulates virtual memory
> exhaustions and running it with valgrind does not reveal any memory
> leak.  In addition, we have used for years this facility in our
> program analyzers and we never detected a state violation.
It sounds like you make memory unavailable and then call a GMP
algorithm to test it. This would make GMP fail at the first allocation
it attempts. Have you done something to make the first few GMP
allocations succeed, and only then make them fail? I ask because it
seems to me that that kind of situation would be more likely to
trigger both memory leaks and invalid states.

> So, for us the main dream would be for GMP to guarantee a safe
> state: I hope this is not too difficult to achieve.  Absence of
> memory leaks (at least for the simplest functions) is desirable,
> but not crucial.
The safe state is much more important to me as well.


More information about the gmp-discuss mailing list