JDK-8142333 : Build failure in debugInfoRec.cpp with SS12u4
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris
  • Submitted: 2015-11-09
  • Updated: 2017-08-09
  • Resolved: 2015-12-01
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 9
9 b97Fixed
Related Reports
Relates :  
Description
The following new build failure has appeared in the hotspot build when using the proposed new compiler version on Solaris, SS12u4.

"/opt/jprt/jprtadm/erik/jdk9-dev/hotspot/src/share/vm/code/debugInfoRec.cpp", line 281: Error: static DIR_Chunk::compare(DIR_Chunk*const&, DIR_Chunk*const&) is not accessible from GrowableArray<DIR_Chunk*>::insert_sorted<&DIR_Chunk::compare>(DIR_Chunk*&).
"/opt/jprt/jprtadm/erik/jdk9-dev/hotspot/src/share/vm/code/debugInfoRec.cpp", line 281:     Where: While instantiating "GrowableArray<DIR_Chunk*>::insert_sorted<&DIR_Chunk::compare>(DIR_Chunk*&)".
"/opt/jprt/jprtadm/erik/jdk9-dev/hotspot/src/share/vm/code/debugInfoRec.cpp", line 281:     Where: Instantiated from non-template code.

The offending lines were added in JDK-8136421
Comments
Confirmed that the above solves the build break.
20-11-2015

The use of friend for access control in DIR_Chunk is horrible. The patch below adds proper access declarations and also should fix the problem reported above. diff -r eada427470a3 src/share/vm/code/debugInfoRec.cpp --- a/src/share/vm/code/debugInfoRec.cpp +++ b/src/share/vm/code/debugInfoRec.cpp @@ -33,7 +33,7 @@ // We keep track of these chunks in order to detect // repetition and enable sharing. class DIR_Chunk { - friend class DebugInformationRecorder; + private: int _offset; // location in the stream of this scope int _length; // number of bytes in the stream int _hash; // hash of stream bytes (for quicker reuse) @@ -41,6 +41,9 @@ DebugInformationRecorder* _DIR; #endif + public: + int offset() { return _offset; } + void* operator new(size_t ignore, DebugInformationRecorder* dir) throw() { assert(ignore == sizeof(DIR_Chunk), ""); if (dir->_next_chunk >= dir->_next_chunk_limit) { @@ -284,7 +287,7 @@ NOT_PRODUCT(++dir_stats.chunks_shared); assert(ns+1 == _next_chunk, ""); _next_chunk = ns; - return match->_offset; + return match->offset(); } else { // Inserted this chunk, so nothing to do return serialized_null;
09-11-2015

Stupid compiler. Not even Clang is complaining about this. Well, maybe it is but could be turned off.
09-11-2015

To build with SS12u4, use one of the new devkits at: /java/devtools/i586/devkit/SS12u4-Solaris11u1 /java/devtools/sparc/devkit/SS12u4-Solaris11u1 e.g. configure --with-devkit=/java/devtools/i586/devkit/SS12u4-Solaris11u1
09-11-2015