gmp_printf bug?

Zimmermann Paul Paul.Zimmermann at
Wed Jul 20 13:16:50 CEST 2011


> The bug is in GMP.  It related to some calculations on the 64-bit
> exponent using the 53 bits of accuracy of IEEE double.  This leads to
> rounding, making some internal sizes slightly too large, which in turn
> causes a one-byte stack smash, overwriting the least sigificant byte of
> a saved register, which contains a pointer, later to be passed to
> realloc.

what is funny is that mpf_dump (which calls mpf_get_str too) gets it right
for the same input. Is there some explanation?


More information about the gmp-bugs mailing list