ianlancetaylor / libbacktrace

A C library that may be linked into a C/C++ program to produce symbolic backtraces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"edtest" and "ttest" failures

stefantalpalaru opened this issue · comments

test1: [0]: missing file name or function name
FAIL: backtrace_full alloc stress
FAIL: edtest
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
test1: [0]: missing file name or function name
FAIL: threaded backtrace_full noinline
FAIL: ttest

What system are you running on? What compiler, and what version of that compiler, are you using?

Gentoo ~amd64, gcc (Gentoo 9.2.0-r1 p2) 9.2.0.

I've also tried building glibc with debugging symbols (and stripping disabled) but it didn't make any difference.

I second that. I'm trying to build gcc-9.2.0 with binutils-2.32, gmp-6.1.2, isl-0.19, mpc-1.1.0, and mpfr-4.0.2 in a combined bootstrap build on a Ubuntu 18.04 system running on a server with AMD Opteron 6386 SE (Piledriver). The libbacktrace test failures look the same.

What can I do to get this settled?

Ah, there's also an older gcc bug entry for that: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90636 . I'm trying to recover my login over there and will post a response. Teaser: Adding noclone in edtest.c didn't change things.

Also, before it vanishes, I changed edtest.c and then the re-build of the test looked like this:

user@host:/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/libbacktrace$ make edtest
/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./prev-gcc/xgcc -B/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./prev-gcc/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/bin/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/bin/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/lib/ -isystem /sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/include -isystem /sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/sys-include -L/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./ld   -fchecking=1 -DHAVE_CONFIG_H -I. -I../../gcc-9.2.0/libbacktrace  -I ../../gcc-9.2.0/libbacktrace/../include -I ../../gcc-9.2.0/libbacktrace/../libgcc -I ../libgcc  -funwind-tables -frandom-seed=edtest.o -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual  -g -O2 -fchecking=1 -c -o edtest.o ../../gcc-9.2.0/libbacktrace/edtest.c
/bin/bash ./libtool  --tag=CC   --mode=link /dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./prev-gcc/xgcc -B/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./prev-gcc/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/bin/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/bin/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/lib/ -isystem /sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/include -isystem /sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/sys-include -L/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./ld   -fchecking=1 -funwind-tables -frandom-seed=edtest -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual  -g -O2 -fchecking=1  -static-libstdc++ -static-libgcc  -o edtest edtest.o edtest2_build.o testlib.o libbacktrace.la 
libtool: link: /dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./prev-gcc/xgcc -B/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./prev-gcc/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/bin/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/bin/ -B/sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/lib/ -isystem /sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/include -isystem /sw/env/system-gcc/gcc/9.2.0-testing/x86_64-pc-linux-gnu/sys-include -fchecking=1 -funwind-tables -frandom-seed=edtest -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -fchecking=1 -static-libstdc++ -static-libgcc -o edtest edtest.o edtest2_build.o testlib.o  -L/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/./ld ./.libs/libbacktrace.a
user@host:/dev/shm/sw/env/system-gcc/gcc/9.2.0-testing/build/libbacktrace$ ./edtest
test1: [1]: missing file name or function name
FAIL: backtrace_full alloc stress

For what it's worth, on tip, as of 2019-12-04, the relevant line in edtest.c looks like

static int test1 (void) __attribute__ ((noinline, noclone, unused));

and I do not see this test failure.

I just noticed that, indeed, we're talking about just one line. In my version it's the same line twice. And it is identical to yours. But maybe modifying that source is not enough?

I fetched the snapshot of libbacktrace-master and verfied that the edtest.c file is identical. A simple ./configure && make -j3 && make check succeeds without failure (using the system gcc-7.4 from Ubuntu).

Using the gcc-9.2.0/libbacktrace and doing the same dance without building gcc around it also passes the tests, also without the added noclone. So it is something relating to the build inside gcc or indeed with this gcc version.

Even more confusing: When simply installing the freshly built gcc-9.2.0 and using that to use the libbacktrace source from gcc-9.2.0 again, the checks all pass! The build from libbacktrace's configure looks a bit different, though:

$ make edtest
gcc -DHAVE_CONFIG_H -I. -I../../../gcc-9.2.0/libbacktrace/.  -I ../../../gcc-9.2.0/libbacktrace/./../include -I ../../../gcc-9.2.0/libbacktrace/./../libgcc -I ../libgcc  -funwind-tables -frandom-seed=edtest.o -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual  -g -O2 -c -o edtest.o ../../../gcc-9.2.0/libbacktrace/./edtest.c
gcc -DHAVE_CONFIG_H -I. -I../../../gcc-9.2.0/libbacktrace/.  -I ../../../gcc-9.2.0/libbacktrace/./../include -I ../../../gcc-9.2.0/libbacktrace/./../libgcc -I ../libgcc  -funwind-tables -frandom-seed=edtest2_build.o -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual  -g -O2 -c -o edtest2_build.o edtest2_build.c
/bin/bash ./libtool  --tag=CC   --mode=link gcc -funwind-tables -frandom-seed=edtest -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual  -g -O2   -o edtest edtest.o edtest2_build.o testlib.o libbacktrace.la 
libtool: link: gcc -funwind-tables -frandom-seed=edtest -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -g -O2 -o edtest edtest.o edtest2_build.o testlib.o  ./.libs/libbacktrace.a

I wonder if one of those flags that differ is a cause …

Adding the -fchecking=1 doesn't change anyting. In the end, even linking with the libbacktrace.a from the gcc build doesn't break edtest! So it must still be something broken in the test itself. I repeated the variants of the build commands, and it boils down to a difference in edtest2_build.o.

(digging around, messing around with build lines from log file … finally: big facepalm moment)

The difference is this: The build inside gcc drops the -g from the flags for building edtest2_build.o! It builds it twice, actually. The first time, -g is missing, the second time (elsewhere in the tree?) it is prependend before the C(XX)FLAGS from the environment.

Without -g on edtest2_build.o, I get the test failure.

This is no longer happening on my system.

Thanks for following up.