Bug 1726630

Summary: regression from devtoolset-8-gcc-c++-8.2.1-3.el7.x86_64 to devtoolset-8-gcc-c++-8.3.1-3.el7.x86_64
Product: Red Hat Developer Toolset Reporter: Kefu Chai <kchai>
Component: gccAssignee: Marek Polacek <mpolacek>
Status: CLOSED ERRATA QA Contact: Alexandra Petlanová Hájková <ahajkova>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 8.1 RHEL 7CC: ahajkova, jakub, jeremy.coulon.jrmc, kdreyer, law, mcermak, mnewsome, ohudlick, tborcin
Target Milestone: alpha   
Target Release: 9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1730726 (view as bug list) Environment:
Last Closed: 2019-12-10 07:49:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1730726    

Description Kefu Chai 2019-07-03 10:19:29 UTC
Description of problem:

dear maintainers, after upgrading devtoolset-8 from 8.2.1-3 to 8.3.1, our project fails to compile


Version-Release number of selected component (if applicable):

8.3.1-3

How reproducible:

always

Steps to Reproduce:
1. git clone git:ceph/ceph.git 
2. cd ceph
3. ./run-make-check.sh

Actual results:

the error message looks like:

/home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/aux_/preprocessed/gcc/bind.hpp:466:67: error: template parameter 'template<class T1, class T2, class T3> class F'
 template< template< typename T1, typename T2, typename T3 > class F, typename Tag >
                                                                   ^
In file included from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/aux_/include_preprocessed.hpp:37,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/quote.hpp:45,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/aux_/full_lambda.hpp:25,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/lambda.hpp:22,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/iter_fold.hpp:20,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/variant/detail/initializer.hpp:28,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/variant/variant.hpp:30,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/variant.hpp:17,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/src/common/options.h:9,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/src/common/config.h:23,
                 from /home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/src/test/objectstore/store_test_fixture.cc:8:
/home/jenkins-build/build/workspace/ceph-dev-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-2338-ge928089/rpm/el7/BUILD/ceph-15.0.0-2338-ge928089/build/boost/include/boost/mpl/aux_/preprocessed/gcc/quote.hpp:64:8: error: redeclared here as 'template<class P1, class P2, class P3> class F'
 struct quote3
        ^~~~~~

Expected results:

the source tree builds.

Additional info: the failure looks exactly like https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926371 which was fixed by https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926234

Comment 2 Marek Polacek 2019-07-09 20:06:40 UTC
I think this is 87651 which was fixed in GCC 9, but not GCC 8.  I'm not sure whether we'll be able to backport this to DTS 8 gcc.

Comment 3 Ken Dreyer (Red Hat) 2019-07-09 23:59:08 UTC
It would be really helpful to fix this for Ceph's sake.

Today we've had to pin to an older version, https://github.com/ceph/ceph/pull/28859/files

Comment 4 Kefu Chai 2019-07-10 01:53:49 UTC
@Marek i guess it's not 

per the bug report of 87651 at https://marc.info/?l=gcc-bugs&m=153992398516778&w=2 impacts GCC 8.2. and i can reproduce the failure with gcc-c++-8.2.1 

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-8/root/usr/libexec/gcc/aarch64-redhat-linux/8/lto-wrapper
Target: aarch64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-8/root/usr --mandir=/opt/rh/devtoolset-8/root/usr/share/man --infodir=/opt/rh/devtoolset-8/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-8.2.1-20180905/obj-aarch64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --build=aarch64-redhat-linux
Thread model: posix
gcc version 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC)

$ g++ -std=c++17 ~/test.cc
/home/kchai/test.2.cc: In instantiation of ‘class Outer<void>::Failure<Cls>’:
/home/kchai/test.2.cc:15:18:   required from here
/home/kchai/test.2.cc:5:33: error: template parameter ‘template<class> template<class> class<template-parameter-2-1>’
   template <template <typename> class>
                                 ^~~~~
/home/kchai/test.2.cc:8:18: error: redeclared here as ‘template<class> class<template-parameter-1-1>’
     friend class Failure; // All Failures should be friends
                  ^~~~~~~

in which, test.cc is the sample program from https://marc.info/?l=gcc-bugs&m=153992398516778&w=2 .

instead, i think the issue is c++/89906, see https://marc.info/?l=gcc-bugs&m=155413596109186&w=2 . we might want to apply the patch at https://salsa.debian.org/toolchain-team/gcc/commit/94810ec90a4720c57975b1d70e8959e8d1aea0c7 to revert the fix which introduced the regression.

Comment 5 Marek Polacek 2019-07-12 16:57:28 UTC
Ah, you're probably right.  If it's c++/89906, it's not fixed upstream, but the fix would be this:

--- gcc/cp/typeck.c
+++ gcc/cp/typeck.c
@@ -1375,6 +1375,11 @@ structural_comptypes (tree t1, tree t2, int strict)
 	 template parameters set, they can't be equal.  */
       if (!comp_template_parms_position (t1, t2))
 	return false;
+      /* If T1 and T2 don't represent the same class template deduction,
+         they aren't equal.  */
+      if (CLASS_PLACEHOLDER_TEMPLATE (t1)
+	  != CLASS_PLACEHOLDER_TEMPLATE (t2))
+	return false;
       /* Constrained 'auto's are distinct from parms that don't have the same
 	 constraints.  */
       if (!equivalent_placeholder_constraints (t1, t2))

I'll try to fix it upstream, and then in DTS 8.

Comment 6 Marek Polacek 2019-07-16 20:20:08 UTC
Proposing 8.1.z.  (qa_ack+ and therefore rhdts-9.0.0+ should come soon)

Comment 10 errata-xmlrpc 2019-12-10 07:49:25 UTC
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, 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/RHEA-2019:4134