Hide Forgot
Description of problem: I got these test failures trying to build the stock latest RHEL compiler on my Scientific Linux SL 7.5 system - it appears to be an 'upstream' (Red Hat) bug - NO non-SL RPM binaries were picked up in my $PATH or $LD_LIBRARY_PATH during build with 'rpmbuild -ba SPECS/gcc.spec', where gcc.spec comes from SRPM: SRPMS/gcc-4.8.5-28.el7_5.1.src.rpm After build, cd to: BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/gcc/testsuite/g++ $ grep '^FAIL' g++.log FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test FAIL: g++.dg/fstack-protector-strong.C -std=gnu++98 scan-assembler-times stack_chk_fail 2 FAIL: g++.dg/fstack-protector-strong.C -std=gnu++11 scan-assembler-times stack_chk_fail 2 (I will raise separate bug about g++.dg/fstack-protector-strong if not already there). Really, the whole reason I install a RHEL image is so that I have access to a GCC instance where things like asan 'just work' . I do have gcc 5, 6, 7 and 8 and binutils-2.30 installed under /usr/local/bin, but my $PATH for the build was '/usr/bin' ONLY , and /usr/local was not in any environment variable setting. All dependencies of GCC RPM are at their latest up-to-date defaults on the target system. So why can't I build the system compiler without these G++ test suite failures ? Here is the GCC testsuite summary: === gcc Summary for unix//-fstack-protector === # of expected passes 100964 # of unexpected failures 51 # of unexpected successes 41 # of expected failures 332 # of unsupported tests 1536 === gcc Summary === # of expected passes 151624 # of unexpected failures 69 # of unexpected successes 82 # of expected failures 548 # of unsupported tests 2103 and for G++: === g++ Summary for unix//-fstack-protector === # of expected passes 45424 # of unexpected failures 2 # of expected failures 284 # of unsupported tests 645 === g++ Summary === # of expected passes 90850 # of unexpected failures 2 # of expected failures 568 # of unsupported tests 1290 Results for GCC 6 (compiled with $PATH starting with /usr/local/bin and with /usr/local/lib64 in LD_LIBRARY_PATH) are very slightly better if workaround for GCC BZ 85924 permitting -static-libasan builds not to coredump is in place : === gcc Summary === # of expected passes 123070 # of unexpected failures 52 # of unexpected successes 21 # of expected failures 326 # of unsupported tests 1773 === g++ Sumary # of unexpected failures 2 $ grep '^FAIL' g++.log FAIL: g++.dg/guality/pr55665.C -O2 line 23 p == 40 FAIL: g++.dg/guality/pr55665.C -O3 -g line 23 p == 40 (I raised GCC bug BZ 85887 about this). GCC 7 gets the same G++ test suite failures. But I'd have expected the stock RHEL compiler to support -fsanitize=address builds properly. Version-Release number of selected component (if applicable): gcc-4.8.5-28.el7_5.1 How reproducible: Steps to Reproduce: 1. Install gcc-4.8.5-28.el7_5.1.srpm & gcc build requires 2. rpmbuild -ba SPECS/gcc.spec 3. cd BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/gcc/testsuite/g++ 4. grep '^FAIL' g++.log Actual results: Test suite failures. Expected results: No test suite failures. Additional info: I can attach complete 'rpmbuild -ba 2>&1 | tee $LOG_FILE' output if desired.
CLUE: when I run in the $OBJDIR/gcc/testsuite directory: $ make check-g++ RUNTESTFLAGS='asan.exp' it succeeds! Only when run under rpmbuild, it fails.
That doesn't fail during rpmbuild either. What fails is: make check-g++ RUNTESTFLAGS='--target_board=unix/-fstack-protector-strong asan.exp'
If I remember correctly there are cases where stack clash protection interferes with asan tests. Arguably either stack clash protection should be turned off for those tests or the tests should be skipped with stack clash protection is enabled.
Seems to work on trunk, gcc-10, and gcc-9: $ make check-g++ RUNTESTFLAGS='--target_board=unix/-fstack-protector-strong asan.exp' Making a new config file... [...] Running /opt/notnfs/polacek/gcc/gcc/testsuite/g++.dg/asan/asan.exp ... === g++ Summary === # of expected passes 3168 # of unsupported tests 168 /opt/notnfs/polacek/trunk/gcc/xg++ version 10.2.1 20210105 (GCC) make[1]: Leaving directory '/opt/notnfs/polacek/trunk/gcc' gcc-8 fails: $ make check-g++ RUNTESTFLAGS='--target_board=unix/-fstack-protector-strong asan.exp' Making a new config file... [...] Running /opt/notnfs/polacek/gcc/gcc/testsuite/g++.dg/asan/asan.exp ... FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test FAIL: g++.dg/asan/asan_test.C -O2 AddressSanitizer_SimpleStackTest A[kSize + 31] = 0 execution test === g++ Summary === # of expected passes 3124 # of unexpected failures 3 # of unsupported tests 162 /opt/notnfs/polacek/trunk/gcc/xg++ version 8.4.1 20210105 (GCC) Moving to GTS where it's fixed.
Clearing ITM.
Should be resolved now.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (new packages: gcc-toolset-11-gcc), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4227