United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6801625 CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
JDK-6801625 : CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp

Details
Type:
Bug
Submit Date:
2009-02-05
Status:
Closed
Updated Date:
2011-03-09
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs15,hs16,7
Fixed Versions:
hs17 (b05)

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

Sub Tasks

Description
eapDump tests crashes with Internal Error:
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (compactingPermGenGen.cpp:361), pid=13121, tid=3
#  Error: ShouldNotReachHere()
#


starting from hs15b01 in case class data sharing is used.
Changed Synopsis from "HeapDump ... in case CDS is used" to
"CDS: HeapDump ...."
Changed Synopsis from ".. tests crashes .." to " ... tests crash ..."

                                    

Comments
EVALUATION

See comments and suggested fix section.
                                     
2009-10-20
SUGGESTED FIX

Delete lines 358-362 below, or if you don't like that, replace
ShouldNotReachHere() with return; I personally think that
performance-sensitive code should either deliberately skip over the
shared space if it wants to, rather than use this whimsical
method of preventing the use of a legitimate interface for
other purposes:-

   355  void CompactingPermGenGen::space_iterate(SpaceClosure* blk, bool usedOnly) {
   356    OneContigSpaceCardGeneration::space_iterate(blk, usedOnly);
   357    if (spec()->enable_shared_spaces()) {
   358  #ifdef PRODUCT
   359      // Making the rw_space walkable will page in the entire space, and
   360      // is to be avoided. However, this is required for Verify options.
   361      ShouldNotReachHere();
   362  #endif
   363
   364      blk->do_space(ro_space());
   365      blk->do_space(rw_space());
   366    }
   367  }
   368
                                     
2009-10-20
EVALUATION

As in suggested fix section. Need some archeology to see why this started
showing up now, but looks like it would be a day-one bug because of the
"ShouldNotReachHere()". Will update re history.
                                     
2009-11-02
SUGGESTED FIX

diff -r 29adffcb6a61 src/share/vm/memory/compactingPermGenGen.cpp
--- a/src/share/vm/memory/compactingPermGenGen.cpp      Fri Oct 30 13:31:11 2009 -0400
+++ b/src/share/vm/memory/compactingPermGenGen.cpp      Mon Nov 02 10:22:28 2009 -0800
@@ -352,15 +352,13 @@ void CompactingPermGenGen::post_compact(
 }
 
 
+// Do not use in time-critical operations due to the possibility of paging.
 void CompactingPermGenGen::space_iterate(SpaceClosure* blk, bool usedOnly) {
   OneContigSpaceCardGeneration::space_iterate(blk, usedOnly);
   if (spec()->enable_shared_spaces()) {
-#ifdef PRODUCT
     // Making the rw_space walkable will page in the entire space, and
-    // is to be avoided. However, this is required for Verify options.
-    ShouldNotReachHere();
-#endif
-
+    // is to be avoided. However, this is required for Verify and
+    // heap dump operations.
     blk->do_space(ro_space());
     blk->do_space(rw_space());
   }
                                     
2009-11-02
EVALUATION

Started failing starting with hs15b01. No clue as yet which specific change
in hs15b01 caused this to start failing. Still investigating.
                                     
2009-11-02
EVALUATION

Regression in behaviour happened as a result of a latent bug that pre-existed
hs15b01, but was uncovered as a result of the changes in 6689653. See comments section for more detail.
                                     
2009-11-03
EVALUATION

This CR will be minimally fixed to attend to the regression, and a separate
one filed to rationalize the structure of CDS to prevent the recurrence
of similar errors in the future.
                                     
2009-11-03
EVALUATION

Filed 6897789 for cleaning up CDS/perm structuring.
                                     
2009-11-03
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/26f1542097f1
                                     
2009-11-04
SUGGESTED FIX

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/26f1542097f1
                                     
2009-11-04
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/baseline/rev/4385d4e7497b
                                     
2009-11-05
PUBLIC COMMENTS

The same assert might be hit with -XX:+UnlockDiagnosticVMOptions -XX:+Verify{Before,After}GC.
The workaround of -Xshare:off documented in the "Workaround" field would work around the issue(s),
but end up turning off class data sharing.
                                     
2009-11-10
WORK AROUND

-Xshare:off
                                     
2009-11-10
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/master/rev/4385d4e7497b
                                     
2009-11-13



Hardware and Software, Engineered to Work Together