Re: FAIL: t-printf on Debian sparc64 with gcc-10 patched for gcc bugid 97939

2020-12-06 Thread Dennis Clarke



Follow up to myself, after going in some circles I did land on :

Breakpoint 1, check_one (want=0x101dfc0 "   123",
fmt=0x11267a8 "%10Nd") at t-printf.c:312
312   check_obstack_vprintf (want, fmt, ap);
(gdb) print want
$364 = 0x101dfc0 "   123"
(gdb) print fmt
$365 = 0x11267a8 "%10Nd"
(gdb) print ap
$366 = (va_list) 0x7fef180
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
__memcpy_large () at ../sysdeps/sparc/sparc64/memcpy.S:370
370 stb %g5, [%o0 - 2]  /* Store
   */
(gdb) where
#0  __memcpy_large () at ../sysdeps/sparc/sparc64/memcpy.S:370
#1  0x0100a9f0 in tests_allocate (size=1099511750592) at
memory.c:102
#2  0x01007620 in check_one (want=0x101dfc0 "   123",
fmt=0x11267a8 "%10Nd") at t-printf.c:312
#3  0x01007af4 in check_z () at t-printf.c:424
#4  0x0100a6d0 in main (argc=1, argv=0x7fef628) at
t-printf.c:945
(gdb) quit
A debugging session is active.

Inferior 1 [process 52726] will be killed.

Quit anyway? (y or n) y
ceres$



   * * * So I wonder if that is repeatable. * * *




ceres$ TERM=dumb LC_ALL=en_US.UTF-8 /usr/bin/gdb -q t-printf
Reading symbols from t-printf...
(gdb) dir /opt/bw/build/glibc-2.31/
Source directories searched: /opt/bw/build/glibc-2.31:$cdir:$cwd
(gdb) break t-printf.c:312
Breakpoint 1 at 0x7608: file t-printf.c, line 312.
(gdb) ignore 1 119
Will ignore next 119 crossings of breakpoint 1.
(gdb) run
Starting program: /tmp/t-printf

Breakpoint 1, check_one (want=0x101dfb0 " 0",
fmt=0x11267a8 "%10Nd") at t-printf.c:312
312   check_obstack_vprintf (want, fmt, ap);
(gdb) print want
$1 = 0x101dfb0 " 0"
(gdb) print fmt
$2 = 0x11267a8 "%10Nd"
(gdb) print ap
$3 = (va_list) 0x7fef180
(gdb) cont
Continuing.

Breakpoint 1, check_one (want=0x101dfc0 "   123",
fmt=0x101dfa8 "%10Zd") at t-printf.c:312
312   check_obstack_vprintf (want, fmt, ap);
(gdb) print want
$4 = 0x101dfc0 "   123"
(gdb) print fmt
$5 = 0x101dfa8 "%10Zd"
(gdb) print ap
$6 = (va_list) 0x7fef180
(gdb) step
check_obstack_vprintf (want=0x101dfc0 "   123",
fmt=0x101dfa8 "%10Zd", ap=0x7fef180) at t-printf.c:276
276   want_len = strlen (want);
(gdb) step
strlen () at ../sysdeps/sparc/sparc64/strlen.S:30
30  mov %o0, %o1
(gdb) cont
Continuing.

Breakpoint 1, check_one (want=0x101dfc0 "   123",
fmt=0x11267a8 "%10Nd") at t-printf.c:312
312   check_obstack_vprintf (want, fmt, ap);
(gdb) print want
$7 = 0x101dfc0 "   123"
(gdb) print fmt
$8 = 0x11267a8 "%10Nd"
(gdb) print ap
$9 = (va_list) 0x7fef180
(gdb) step
check_obstack_vprintf (want=0x101dfc0 "   123",
fmt=0x11267a8 "%10Nd", ap=0x7fef180) at t-printf.c:276
276   want_len = strlen (want);
(gdb) step
strlen () at ../sysdeps/sparc/sparc64/strlen.S:30
30  mov %o0, %o1
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
__memcpy_large () at ../sysdeps/sparc/sparc64/memcpy.S:370
370 stb %g5, [%o0 - 2]  /* Store
   */
(gdb) where
#0  __memcpy_large () at ../sysdeps/sparc/sparc64/memcpy.S:370
#1  0x0100a9f0 in tests_allocate (size=1099511750592) at
memory.c:102
#2  0x01007620 in check_one (want=0x101dfc0 "   123",
fmt=0x11267a8 "%10Nd") at t-printf.c:312
#3  0x01007af4 in check_z () at t-printf.c:424
#4  0x0100a6d0 in main (argc=1, argv=0x7fef628) at
t-printf.c:945
(gdb)

Something odd is afoot when *want = "   123" and the fmt string
is "%10Nd".  I will see if I can step around in this until I can find
why the SIGSEGV.


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

___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


FAIL: t-printf on Debian sparc64 with gcc-10 patched for gcc bugid 97939

2020-12-06 Thread Dennis Clarke


Sadly the situation continues here on Debian sparc64 :

.
.
.
/bin/bash ../../libtool  --tag=CC   --mode=link
/usr/bin/sparc64-linux-gnu-gcc-10  -std=iso9899:1999 -m64 -g -O0
-pedantic -pedantic-errors -fno-builtin -fno-fast-math -mhard-float
-mno-app-regs -mflat -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 -no-install  -o t-scanf t-scanf.o
../../tests/libtests.la ../../libgmp.la
libtool: link: /usr/bin/sparc64-linux-gnu-gcc-10 -std=iso9899:1999 -m64
-g -O0 -pedantic -pedantic-errors -fno-builtin -fno-fast-math
-mhard-float -mno-app-regs -mflat -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 -o t-scanf t-scanf.o
../../tests/.libs/libtests.a
/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/.libs/libgmp.so
../../.libs/libgmp.so -Wl,-rpath
-Wl,/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/.libs -Wl,-rpath
-Wl,/opt/bw/lib
/usr/bin/sparc64-linux-gnu-gcc-10 -DHAVE_CONFIG_H -I. -I../..  -I../..
-I../../tests -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE
-D_TS_ERRNO -D_XOPEN_SOURCE=600  -std=iso9899:1999 -m64 -g -O0 -pedantic
-pedantic-errors -fno-builtin -fno-fast-math -mhard-float -mno-app-regs
-mflat -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 -c
-o t-locale.o t-locale.c
/bin/bash ../../libtool  --tag=CC   --mode=link
/usr/bin/sparc64-linux-gnu-gcc-10  -std=iso9899:1999 -m64 -g -O0
-pedantic -pedantic-errors -fno-builtin -fno-fast-math -mhard-float
-mno-app-regs -mflat -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 -no-install  -o t-locale t-locale.o
../../tests/libtests.la ../../libgmp.la
libtool: link: /usr/bin/sparc64-linux-gnu-gcc-10 -std=iso9899:1999 -m64
-g -O0 -pedantic -pedantic-errors -fno-builtin -fno-fast-math
-mhard-float -mno-app-regs -mflat -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 -o t-locale t-locale.o
../../tests/.libs/libtests.a
/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/.libs/libgmp.so
../../.libs/libgmp.so -Wl,-rpath
-Wl,/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/.libs -Wl,-rpath
-Wl,/opt/bw/lib
make[4]: Leaving directory
'/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/tests/misc'
/usr/bin/make  check-TESTS
make[4]: Entering directory
'/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/tests/misc'
make[5]: Entering directory
'/opt/bw/build/gmp-6.2.1_5.9.0-4-sparc64-smp.001/tests/misc'
../../test-driver: line 107: 51992 Segmentation fault  "$@" >
$log_file 2>&1
FAIL: t-printf
PASS: t-scanf
PASS: t-locale

Testsuite summary for GNU MP 6.2.1

# TOTAL: 3
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

See tests/misc/test-suite.log

Well that log offers very little :

ceres$ cat  tests/misc/test-suite.log
=
   GNU MP 6.2.1: tests/misc/test-suite.log
=

# TOTAL: 3
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: t-printf
==

FAIL t-printf (exit status: 139)

ceres$

I have been single stepping my way through t-printf and I always end up
inside glibc obstack world and memcpy assembly. I glanced at glibc 2.31
where I see obstack.c line 167 inside :

   143  int
   144  _obstack_begin (struct obstack *h,
   145  int size, int alignment,
   146  void *(*chunkfun) (long),
   147  void (*freefun) (void *))
.
.
.
   167size = 4096 - extra;

etc etc.

Looks very familiar however we tested that :

   long f(long arg){return 4096 - arg;}

... works just fine with gcc regardless of the new patch.
So that can not be related.

If I just let things proceed I end up at :

Program received signal SIGSEGV, Segmentation fault.
__memcpy_large () at ../sysdeps/sparc/sparc64/memcpy.S:370
370 stb %g5, [%o0 - 2]  /* Store
   */
(gdb)
(gdb) where
#0  __memcpy_large () at ../sysdeps/sparc/sparc64/memcpy.S:370
#1  0x0100a9f0 in tests_allocate (size=1099511750592) at
memory.c:102
#2  0x01007620 in check_one (want=0x101dfc0 "   123",

Re: FAIL: t-printf on Debian sparc64 with gcc-10 patched for gcc bugid 97939

2020-12-06 Thread Vincent Lefevre
On 2020-12-06 08:23:40 +, Dennis Clarke wrote:
> Sadly the situation continues here on Debian sparc64 :

I suggest that you try with -fsanitize=undefined -fno-sanitize-recover
just in case an issue would be detected before the actual crash.

> I just go single stepping around madly for a while and that includes
> into the sources of glibc-2.31 and I simply got lost.  Is there an
> easier way to track this down?

You should try to reduce the code to a minimal testcase.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs