JDK-7186278 : Build error after CR#6995781 / 7151532 with GCC 4.7.0
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2012-07-24
  • Updated: 2013-09-04
  • Resolved: 2012-08-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Description
FULL PRODUCT VERSION :


FULL OS VERSION :
Linux Fedora17 3.4.2-4.fc17.x86_64 #1 SMP Thu Jun 14 22:22:05 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
gcc-4.7.0-5.fc17.x86_64
gcc-c++-4.7.0-5.fc17.x86_64

A DESCRIPTION OF THE PROBLEM :
When I try to build JDK8 with Native Memory Tracking (CR#6995781 / 7151532) with GCC 4.7.0 on Fedora17, it fails with message as following.


THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Build JDK8 with GCC 4.7.0

ERROR MESSAGES/STACK TRACES THAT OCCUR :
/usr/src/OpenJDK/8/test/jdk8/hotspot/src/share/vm/utilities/hashtable.hpp: In instantiation of 'int Hashtable<T, F>::index_for(Symbol*) [with T = constantPoolOopDesc*; short unsigned int F = 256u]':
/usr/src/OpenJDK/8/test/jdk8/hotspot/src/share/vm/utilities/hashtable.cpp:317:16:   required from here
/usr/src/OpenJDK/8/test/jdk8/hotspot/src/share/vm/utilities/hashtable.hpp:263:44: error: 'hash_to_index' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
/usr/src/OpenJDK/8/test/jdk8/hotspot/src/share/vm/utilities/hashtable.hpp:263:44: note: declarations in dependent base 'BasicHashtable<256u>' are not found by unqualified lookup
/usr/src/OpenJDK/8/test/jdk8/hotspot/src/share/vm/utilities/hashtable.hpp:263:44: note: use 'this->hash_to_index' instead

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
We have to explicit reference of C++ class member.

  Bug 43282  - GCC looks into dependent bases during unqualified lookup
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43282

comment #4:
-----------
You have to add "this->" or "Bar::" to use another form of lookup (qualified or class-member access) or use a using-declaration to bring the name in scope ("using HasFoo<T>::foo;").
-----------
Patch submitted by originator  - ###@###.###

diff -r e3619706a725 src/share/vm/utilities/hashtable.cpp
--- a/src/share/vm/utilities/hashtable.cpp	Mon Jul 23 12:38:08 2012 -0700
+++ b/src/share/vm/utilities/hashtable.cpp	Tue Jul 24 14:29:30 2012 +0900
@@ -135,7 +135,7 @@
       // walking the hashtable past these entries requires
       // BasicHashtableEntry::make_ptr() call.
       bool keep_shared = p->is_shared();
-      unlink_entry(p);
+      this->unlink_entry(p);
       new_table->add_entry(index, p);
       if (keep_shared) {
         p->set_shared();
diff -r e3619706a725 src/share/vm/utilities/hashtable.hpp
--- a/src/share/vm/utilities/hashtable.hpp	Mon Jul 23 12:38:08 2012 -0700
+++ b/src/share/vm/utilities/hashtable.hpp	Tue Jul 24 14:29:30 2012 +0900
@@ -260,7 +260,7 @@
   }
 
   int index_for(Symbol* name) {
-    return hash_to_index(compute_hash(name));
+    return this->hash_to_index(compute_hash(name));
   }
 
   // Table entry management

Comments
EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/5e2dc722e70d
14-08-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-emb/hotspot/rev/5e2dc722e70d
06-08-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/5e2dc722e70d
01-08-2012

SUGGESTED FIX Patch submitted by originator - ###@###.### diff -r e3619706a725 src/share/vm/utilities/hashtable.cpp --- a/src/share/vm/utilities/hashtable.cpp Mon Jul 23 12:38:08 2012 -0700 +++ b/src/share/vm/utilities/hashtable.cpp Tue Jul 24 14:29:30 2012 +0900 @@ -135,7 +135,7 @@ // walking the hashtable past these entries requires // BasicHashtableEntry::make_ptr() call. bool keep_shared = p->is_shared(); - unlink_entry(p); + this->unlink_entry(p); new_table->add_entry(index, p); if (keep_shared) { p->set_shared(); diff -r e3619706a725 src/share/vm/utilities/hashtable.hpp --- a/src/share/vm/utilities/hashtable.hpp Mon Jul 23 12:38:08 2012 -0700 +++ b/src/share/vm/utilities/hashtable.hpp Tue Jul 24 14:29:30 2012 +0900 @@ -260,7 +260,7 @@ } int index_for(Symbol* name) { - return hash_to_index(compute_hash(name)); + return this->hash_to_index(compute_hash(name)); } // Table entry management
01-08-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/5e2dc722e70d
31-07-2012

PUBLIC COMMENTS 7172226 already addressed a similar problem in binaryTreeDictionary.cpp I think the NoPermGen updates make a number of changes to this file which might address this problem. But we should baxckport any necessary fixes to other release trains.
24-07-2012