United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7186278 Build error after CR#6995781 / 7151532 with GCC 4.7.0
JDK-7186278 : Build error after CR#6995781 / 7151532 with GCC 4.7.0

Details
Type:
Bug
Submit Date:
2012-07-24
Status:
Closed
Updated Date:
2013-09-04
Project Name:
JDK
Resolved Date:
2012-08-07
Component:
hotspot
OS:
linux
Sub-Component:
runtime
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs24 (b19)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

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
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.
                                     
2012-07-24
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/5e2dc722e70d
                                     
2012-07-31
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
                                     
2012-08-01
EVALUATION

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

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

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



Hardware and Software, Engineered to Work Together