Stack overflow in gmp_get_str when passed a big number

Abdulaziz Ghuloum aghuloum at gmail.com
Sat Oct 4 08:52:42 CEST 2008


On Oct 3, 2008, at 3:14 AM, Torbjorn Granlund wrote:

>   this is usually due to a stack overflow. Some GMP routines  
> allocate memory
>   on the stack for a better efficiency, but for large problems this  
> may lead
>   to problems. I believe this problem is fixed in the latest  
> versions of GMP,
>   or a workaround is to configure GMP with --disable-alloca. See  
> for example
>   http://gmplib.org/manual/Debugging.html.
>
> With any recent GMP release, --disable-alloca should never be needed.
>
> Aziz doesn't mention the used GMP version, leaving us to guess it.
> I guess it is GMP 4.1.x, which I no longer maintain.  :-)

No I did not mention it, sorry.  I just upgraded the version on the
machine in question to the latest gmp (4.2.4) and yes, it does seem
to work fine now.  Sorry to bother you all.  Should've checked first.

Thanks for the great work.

Aziz,,,



More information about the gmp-bugs mailing list