t-scan from GMP-4.3.2 [was: t-lucnum_ui segfaults]

Marco Bodrato bodrato at mail.dm.unipi.it
Mon Mar 1 07:32:14 UTC 2021


Ciao,

Il 2021-02-28 20:41 Paul Dufresne ha scritto:
> PASS: t-lucnum_ui

t-lucnum_ui does not segfault, it passes.

> /bin/bash : ligne 4 : 116921 Erreur de segmentation  (core dumped) 
> ${dir}$tst
> 
> FAIL: t-scan

t-scan triggers the error.

> make[2] : on quitte le répertoire 
> « /home/paul/gpc2/gcc-4.6.4/gmp-4.3.2/tests »

If you really want to use that 10 years old release, you may try this 
9.5 years old patch (to the test, not to the library): 
https://gmplib.org/repo/gmp/rev/966737bd91ed

# HG changeset patch
# User Torbjorn Granlund
# Date 1318259187 -7200
# Node ID 966737bd91ed4cd158ca9730167f70db47442fc1
# Parent  27913f466a23776215bd9341866e10a50cf61c01
(check_ref): Fix loop end bound.

diff -r 27913f466a23 -r 966737bd91ed tests/mpz/t-scan.c
--- a/tests/mpz/t-scan.c	Mon Oct 10 12:06:39 2011 +0200
+++ b/tests/mpz/t-scan.c	Mon Oct 10 17:06:27 2011 +0200
@@ -79,7 +79,7 @@

                for (isize = 0; isize <= size; isize++)
                  {
-                  for (oindex = 0; oindex <= numberof (offset); 
oindex++)
+                  for (oindex = 0; oindex < numberof (offset); 
oindex++)
                      {
                        o = offset[oindex];
                        if ((int) isize*GMP_NUMB_BITS < -o)


Ĝis,
m


More information about the gmp-bugs mailing list