New failures related to recent developments

Torbjorn Granlund tg at
Tue Feb 28 10:18:30 CET 2012

Torbjorn Granlund <tg at> writes:

  There is a systematic problem in mini-gmp.c when MPZ_REALLOC is called
  when a destination variable is the same as some other (source or
  destination) variable.
  After MPZ_REALLOC, all cached pointers must be considered to be defunct.
  I've spotted this error in 4 functions, but I haven't made a proper code

This gives an idea for a testing mode allocation trick:

Let the MPZ_REALLOC macro always allocate a new block whether needed or
not, copy the data thereto, write random garbage to the old area, then
free it.  This will make any defunct pointers read data that very likely
will cause an obvious miscomputation.


More information about the gmp-devel mailing list