GMP «Arithmetic without limitations» Mini-GMP status
Last modified: 2016-12-18


In November 2016 we added automated testing of the separately maintained mini-gmp library-in-the-library. This triggered several previously unknown problems. GMP releaes up to and including 6.1.1 are affected. All problems except for (15) are fixed in GMP 6.1.2.

highest severity
medium severity
lowest severity
  1. GMP_CHECK_RANDOMIZE is not always printed for failing tests. This makes it hard to reproduce intermittent failures. It needs to be printed earlier, and/or a buffer needs flushing.
  2. There are inexplicable timeouts (or possibly excessive memory use) triggered by t-pprime_p for some of our systems:
    • armel.sys.gmplib.org-dyn:32
    • g5.gmplib.org-dyn:32
    • m68k.sys.gmplib.org-m68040-stat:standard
    • m68k.sys.gmplib.org-m68040-dyn:standard
    Perhaps the test is simply too slow, or its time varies hugely, or it hits an infinite loop.
  3. The mini-gmp check target fails when the main build does not use the compiler default ABI. This affects hundreds of configs.
  4. For some good reason, mini-gmp's Makefile requires GNU make. We have now made significant changes to the testclient.sh script to accomodate this when possible, without also requiring (or even defaulting to) GNU make for GMP proper. There might be bugs in the new code, only subsequent testing can tell.
  5. There are failures with t-str, this affects
    • olympic.gmplib.org-dyn:64
    • olympic.gmplib.org-stat:64
    • olympic.gmplib.org:64
  6. Arithmetic problems triggered by t-div, demonstrated by sky. (But since this example uses clang, it might as well be a compiler bug.)
  7. The t-limbs test triggers an assert. It looks like any config could trigger this, but thus far it has only happened on these:
    • shell.gmplib.org-dyn-gcc49-g++49:64
    • ivydeb32v7.gmplib.org-stat-fat:32.
  8. On alpha, t-cmp_d fails:
    • dupont.gmplib.org-alphaev4-dyn:standard
    • dupont.gmplib.org-alphaev4-stat:standard
    • dupont.gmplib.org-alphaev5-dyn:standard
    • dupont.gmplib.org-alphaev5-stat:standard
    • dupont.gmplib.org-dyn:standard
    • dupont.gmplib.org-stat:standard
    • ... and alpha-gentoo where we disabled mini-gmp for now.
    Note that dupont is currently powered off (not behind the pdu). the much faster and parallel alpha-gentoo is available.
  9. Arithmetic problems triggered by t-gcd, demonstrated by shell.
  10. According to valgrind, t-str leaks many MiB of memory in tens of thousands blocks.
  11. The seeding triggered by GMP_CHECK_RANDOMIZE is based on seconds since epoch plus getpid(). This is not good enough, there will in practice be many collisions over the test machine park. Fix: Copy GMP's seeding code.
  12. Arithmetic problems triggered by t-powm, demonstrated by bwldeb64v7.
  13. The LD_LIBRARY_PATH (and DYLD_LIBRARY_PATH) in Makefile.am's check-mini-gmp rule affects more than desired. It should not be set for the build tools, only for the binaries. Examples:
  14. The test t-signed tests fails on most ppc64 systems (33 failing configs in total).
  15. 32-bit x86 Solaris systems have some linking problems: This, this, this, this.

Post-Mortem

The high-priority errors above (6, 9, 12) were all due to the same bug in division.

Problem 2 was due to test slowness and seed inflicted huge timing variation.