Debian Linux SPARC64 issue with FAIL t-printf (exit status: 139)

Dennis Clarke dclarke at blastwave.org
Wed Nov 18 20:19:53 UTC 2020


On 11/18/20 1:30 AM, Paul Zimmermann wrote:
>        Dear Dennis,
> 
>> With an old old Sun Nera server running very latest Debian sid I was
>> surprised to see : [...]
> 
> does the same error occur with previous GMP versions, or is it specific to
> 6.2.1?
> 
> Paul
> 

Well, surprise, the same test fails on that same machine with both 6.2.0
and 6.2.1.  With one small change :

    see https://gmplib.org/repo/gmp-6.2/rev/ad3ca09cfa38

ceres$ diff -u ./tests/mpz/convert.c.orig ./tests/mpz/convert.c
--- ./tests/mpz/convert.c.orig  2020-01-17 13:44:49.000000000 +0000
+++ ./tests/mpz/convert.c       2020-11-18 10:23:54.424808877 +0000
@@ -21,12 +21,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h> /* for strlen */
+#include <ctype.h> /* for tolower */

 #include "gmp-impl.h"
 #include "tests.h"

 void debug_mp (mpz_t, int);

+static int str_casecmp (const char *, const char *);

 void
 string_urandomb (char *bp, size_t len, int base, gmp_randstate_ptr rands)
@@ -140,7 +142,7 @@
       for (bp = buf; bp[0] == '0' && bp[1] != '\0'; bp++)
        ;

-      if (strcasecmp (str, bp) != 0)
+    if (str_casecmp (str, bp) != 0)
        {
          fprintf (stderr, "ERROR, str and buf different in test %d\n", i);
          fprintf (stderr, "str  = %s\n", str);
@@ -162,6 +164,21 @@
   exit (0);
 }

+/* This is similar to POSIX strcasecmp except that we don't do the
comparison
+   with unsigned char.  We avoid strcasecmp for C standard conformance.  */
+static int
+str_casecmp (const char *s1, const char *s2)
+{
+  size_t i;
+  for (i = 0;; i++)
+    {
+      int c1 = s1[i];
+      int c2 = s2[i];
+      if (c1 == 0 || tolower (c1) != tolower (c2))
+       return c1 - c2;
+    }
+}
+
 void
 debug_mp (mpz_t x, int base)
 {
ceres$

I was surprised to see that configure was fine and compile was fine and
then in the tests :

.
.
.
/bin/bash ../../libtool  --tag=CC   --mode=link /usr/bin/gcc
-std=iso9899:1999 -m64 -g -O0 -pedantic -pedantic-errors -fno-builtin
-fno-fast-math -mno-app-regs -mflat -mhard-float -mhard-quad-float
-mno-unaligned-doubles -mno-faster-structs -mcpu=ultrasparc
-mtune=ultrasparc -mno-vis -mno-cbcond -mno-fmaf -mno-fsmuld -mno-popc
-mno-subxc -mcmodel=medany -mmemory-model=tso -Wl,-rpath=/opt/bw/lib
-no-install  -o t-locale t-locale.o ../../tests/libtests.la ../../libgmp.la
libtool: link: /usr/bin/gcc -std=iso9899:1999 -m64 -g -O0 -pedantic
-pedantic-errors -fno-builtin -fno-fast-math -mno-app-regs -mflat
-mhard-float -mhard-quad-float -mno-unaligned-doubles
-mno-faster-structs -mcpu=ultrasparc -mtune=ultrasparc -mno-vis
-mno-cbcond -mno-fmaf -mno-fsmuld -mno-popc -mno-subxc -mcmodel=medany
-mmemory-model=tso -Wl,-rpath=/opt/bw/lib -o t-locale t-locale.o
../../tests/.libs/libtests.a
/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/.libs/libgmp.so
../../.libs/libgmp.so -Wl,-rpath
-Wl,/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/.libs -Wl,-rpath
-Wl,/opt/bw/lib
make[4]: Leaving directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests/misc'
/usr/bin/make  check-TESTS
make[4]: Entering directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests/misc'
make[5]: Entering directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests/misc'
../../test-driver: line 107: 128203 Segmentation fault      "$@" >
$log_file 2>&1
FAIL: t-printf
PASS: t-scanf
PASS: t-locale
============================================================================
Testsuite summary for GNU MP 6.2.0
============================================================================
# TOTAL: 3
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/misc/test-suite.log
Please report to gmp-bugs at gmplib.org, see
https://gmplib.org/manual/Reporting-Bugs.html
============================================================================
make[5]: *** [Makefile:717: test-suite.log] Error 1
make[5]: Leaving directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests/misc'
make[4]: *** [Makefile:825: check-TESTS] Error 2
make[4]: Leaving directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests/misc'
make[3]: *** [Makefile:910: check-am] Error 2
make[3]: Leaving directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests/misc'
make[2]: *** [Makefile:823: check-recursive] Error 1
make[2]: Leaving directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001/tests'
make[1]: *** [Makefile:995: check-recursive] Error 1
make[1]: Leaving directory
'/opt/bw/build/gmp-6.2.0_debian_5.9.0-2-sparc64.001'
make: *** [Makefile:1287: check] Error 2
Command exited with non-zero status 2
ceres$

I see a segfault there.

So here we are with the exact same env vars on both 6.2.0 and 6.2.1
wherein at least the same test fails. With a few changes to the CFLAGS
for some optimization and the inclusion of the assembly code I can get
piles of failures. That is interesting.

I am sure there are very few people out there running Debian sid on
sparc64 so I am not surprised this just suddenly appears.

What are your thoughts ?



-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional












More information about the gmp-bugs mailing list