gcc

gcc 4.7.0 fixes a bug that Crypto++ 5.6.1 relies on

Bug #915018 reported by Zooko Wilcox-O'Hearn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Crypto++
Fix Released
Unknown
gcc
Fix Released
Medium
pycryptopp
Fix Released
Unknown
Fedora
Invalid
Undecided
Unassigned
libcrypto++ (Fedora)
Invalid
Undecided
libcrypto++ (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

gcc 4.7.0 fixes a bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24163 ) that Crypto++ 5.6.1 was inadvertently relying on (http://sourceforge.net/apps/trac/cryptopp/ticket/14 ). This has been discovered by the Fedora project upgrading to a 4.7.0 prerelease (http://lists.fedoraproject.org/pipermail/devel/2011-December/160723.html ) as well as by the pycryptopp project (https://tahoe-lafs.org/trac/pycryptopp/ticket/78 ). In the pycryptopp project we've written a patch for our embedded copy of Crypto++ which fixes it when pycryptopp is compiled with the option to "use your own embedded copy of Crypto++".

(This doesn't *actually* affect Ubuntu yet as Ubuntu isn't using gcc 4.7 yet, but opening a ticket against Ubuntu's packaging of Crypto++ is the only way I could figure out how to make a ticket on launchpad so that I could link those other tickets. lifeless on IRC suggested this.)

Revision history for this message
In , Jwakely-gcc (jwakely-gcc) wrote :

(I first posted this code to PR5660 but it's apparently a separate issue)

   template <typename T>
     struct A
     {
         typedef T Type;
         void f(Type) {}
     };

   template <typename T>
     struct B : A<T>
     {
         typedef typename A<T>::Type Type;
         void ff(Type t) { f(t); } // XXX
     };

   template struct B<int>;

This should fail to compile, according to 14.6.2/3, but 3.4 - 4.1 (and probably
earlier) accept it.

If A::f and the call to it are changed to take no arguments (so that f is not a
dependent name) then it fails, so it is apparently only at instantiation that
the base class scope is examined.

Revision history for this message
In , Pinskia (pinskia) wrote :

Confirmed.

Revision history for this message
In , Jwakely-gcc (jwakely-gcc) wrote :

Adding "... in template" to end of title.

Revision history for this message
In , Pinskia (pinskia) wrote :

*** Bug 42291 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Pinskia (pinskia) wrote :

This is related to PR 15272 where we look at both dependent and non dependent base classes when only non dependent should be looked at. Actually I think this is a dup of that bug but I will leave it to a C++ expert.

Revision history for this message
In , Pinskia (pinskia) wrote :

*** Bug 43282 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Redi (redi) wrote :

*** Bug 47585 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jason-gcc (jason-gcc) wrote :
Download full text (3.3 KiB)

Author: jason
Date: Fri May 20 18:01:22 2011
New Revision: 173965

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173965
Log:
 PR c++/24163
 PR c++/29131
gcc/cp/
 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Avoid repeating
 unqualified lookup.
 * semantics.c (perform_koenig_lookup): Add complain parm.
 * cp-tree.h: Adjust.
 * parser.c (cp_parser_postfix_expression): Adjust.
 (cp_parser_perform_range_for_lookup): Adjust.
libstdc++-v3/
 * include/ext/pb_ds/assoc_container.hpp: Explicitly qualify calls to
 functions from dependent bases.
 * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Likewise.
 * include/ext/pb_ds/detail/rb_tree_map_/
 split_join_fn_imps.hpp: Likewise.
 * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Likewise.
 * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Likewise.
 * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Likewise.
 * include/ext/pb_ds/detail/splay_tree_/
 split_join_fn_imps.hpp: Likewise.
 * include/ext/pb_ds/detail/tree_policy/
 order_statistics_imp.hpp: Likewise.
 * include/ext/pb_ds/detail/trie_policy/
 prefix_search_node_update_imp.hpp: Likewise.
 * include/ext/rc_string_base.h: Likewise.
 * include/ext/rope: Likewise.
 * include/ext/ropeimpl.h: Likewise.
 * testsuite/util/exception/safety.h: Likewise.
 * testsuite/util/native_type/native_priority_queue.hpp: Likewise.
 * testsuite/util/testsuite_io.h: Likewise.
 * include/std/functional: Declare mem_fn earlier.
 * include/tr1/functional: Likewise.
 * include/tr1/exp_integral.tcc: Declare __expint_E1 earlier.

Added:
    trunk/gcc/testsuite/g++.dg/template/koenig9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/opt/pr47615.C
    trunk/gcc/testsuite/g++.dg/overload/defarg1.C
    trunk/gcc/testsuite/g++.dg/tc1/dr213.C
    trunk/gcc/testsuite/g++.dg/torture/pr34850.C
    trunk/gcc/testsuite/g++.dg/torture/pr39362.C
    trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/memtemp47.C
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
    trunk/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
    trunk/libstdc++-v3/include/ext/rc_string_base.h
    trunk/libstdc++-v3/include/ext/rope
    trunk/libstdc++-v3/include/ext/ropeimpl.h
    trunk/libstdc++-v3/include/std/functional
    trunk/libstdc++-v3/include/tr1/exp_integral.tcc
    trunk/libstdc++-v3/include/tr1/functional
    trunk/libstd...

Read more...

Revision history for this message
In , Jason-gcc (jason-gcc) wrote :

Fixed for 4.7.

Revision history for this message
In , Jason-gcc (jason-gcc) wrote :

*** Bug 47752 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Redi (redi) wrote :

*** Bug 51699 has been marked as a duplicate of this bug. ***

no longer affects: cryptopp
Revision history for this message
In , Zooko (zooko-redhat-bugs) wrote :

Description of problem:

gcc-4.7.0 fixes a bug that various packages rely on

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

4.7.0

How reproducible:

100% deterministic.

Steps to Reproduce:
1. Try to build a package such as Crypto++ v5.6.1 with a pre-release of gcc 4.7.0.
2.
3.

Actual results:

Compile failure.

Expected results:

Compile success.

Additional info:

As reported by Jakub Jellinek: http://lists.fedoraproject.org/pipermail/devel/2011-December/160723.html
As tracked on launchpad: https://bugs.launchpad.net/gcc/+bug/915018, which has links to the issue trackers for Crypto++ and pycryptopp.

Changed in gcc:
importance: Unknown → Medium
status: Unknown → Fix Released
Changed in cryptopp:
status: Unknown → New
Revision history for this message
In , Jakub (jakub-redhat-bugs) wrote :

Why are you filing it against gcc? It is completely intentional. Just fix your package(s).

Revision history for this message
In , Zooko (zooko-redhat-bugs) wrote :

I didn't mean to denote that it was a (current) bug in gcc. I just meant to let myself and others track the fact that the gcc 4.7.0 release (and pre-releases) interact with this bug, and I meant to link to the original gcc ticket: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24163

I guess ideally I would mark this ticket as applying to the list of packages that you posted to the mailing list, but I don't know if that's possible and if it is I'm not going to take the time to do it manually. ;-)

Revision history for this message
In , Zooko (zooko-redhat-bugs) wrote :

P.S. I guess I was thinking of "the package of gcc that is shipped in Fedora" as being one of the subjects of this ticket, more than "gcc itself". I figured it might help other people to understand that if they are seeing these errors, it is the combination of gcc 4.7.0 pre-release and their other packages that results in the errors. But again, I didn't intend to say that the errors were caused by gcc having a bug. Also, of course, Crypto++ and quite a few other packages are also the subjects of this issue. The launchpad ticket -- https://bugs.launchpad.net/gcc/+bug/915018 -- has links to relevant tickets in various issue trackers.

For my own future reference:

1. Is there a way to express in bugzilla.redhat.com that an issue affects a package of software $X version $Y within Fedora release $Z? Ideally I would have said "This is an issue you may have if you're using the 4.7.0 pre-release distributed in Fedora Rawhide.". Is there a way to express that in the bugzilla db?

2. Is there a way to denote "This is an issue that affects $X or that the presence of $X can trigger, but is not a bug in $X?".

Thanks!

Revision history for this message
In , Zooko Wilcox-O'Hearn (zooko) wrote :

Here is a launchpad ticket tracking the effect of this bugfix on various open source projects that were depending on the bug: https://bugs.launchpad.net/cryptopp/+bug/915018

Changed in pycryptopp:
status: Unknown → Fix Released
Changed in libcrypto++ (Ubuntu):
status: New → Invalid
affects: gcc-4.7 (Fedora) → fedora
Changed in fedora:
importance: Unknown → Undecided
status: Unknown → New
status: New → Invalid
importance: Undecided → Unknown
status: Invalid → Unknown
importance: Unknown → Undecided
status: Unknown → New
status: New → Invalid
Revision history for this message
Zooko Wilcox-O'Hearn (zooko) wrote :

The hyperlink to the issue in the Fedora issue tracker is https://bugzilla.redhat.com/show_bug.cgi?id=773443 .

(This is a test of LaunchPad. If you, oh noble LaunchPad, update this ticket to have a hyperlink to that ticket in the table of other projects/distros that this "Affects", at the top, then you win! Except if, in doing so, you blow away the "invalid" setting in the "Status" column and the "Fedora" row, then you lose! See https://bugs.launchpad.net/launchpad/+bug/931582 .)

Changed in cryptopp:
status: New → Fix Released
Changed in libcrypto++ (Fedora):
importance: Unknown → Undecided
status: Unknown → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.