JDK-6910182 : CMS: assert(_cursor[j] == _survivor_plab_array[j].end(),"Ctl pt invariant")
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs17
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: x86
  • Submitted: 2009-12-14
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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 6 JDK 7 Other
6u21pFixed 7Fixed hs18Fixed
Related Reports
Relates :  
Description
The test in attachment could cause CMS crash with assertion:

# after -XX: or in .hotspotrc:  SuppressErrorAt=/concurrentMarkSweepGeneration.cpp:5362
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/BUILD_AREA/jdk7/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp:5362), pid=23504, tid=2865970064
#  Error: assert(_cursor[j] == _survivor_plab_array[j].end(),"Ctl pt invariant")
#
# JRE version: 7.0-b77
# Java VM: Java HotSpot(TM) Server VM (17.0-b05-fastdebug mixed mode linux-x86 )
# An error report file with more information is saved as:
# /home/lm153972/ws/cms/file/hs_err_pid23504.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Current thread is 2865970064
Dumping core ...


I appeares on the 32bit linux:
java -version:
java version "1.7.0-ea-fastdebug"
Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b77)
Java HotSpot(TM) Server VM (build 17.0-b05-fastdebug, mixed mode)

I run it with reduced YoungGen (to provoke CMS) like below: 
/net/vmsqe.russia/export/jdk/7/build/latest/linux-i586/fastdebug/bin/java -server -Xmn200K  -XX:+PrintGCDetails  -XX:+UseConcMarkSweepGC crash_concurrentMarkSweepGeneration_5362  | grep -v ParNew

It does not crash each time sometimes.

Comments
EVALUATION ChangeSet=http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/d47555d7aca8,ChangeRequest=6910182
03-03-2010

SUGGESTED FIX New suggested fix: --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -723,8 +723,9 @@ CMSCollector::CMSCollector(ConcurrentMar // Support for parallelizing survivor space rescan if (CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) { - size_t max_plab_samples = cp->max_gen0_size()/ - ((SurvivorRatio+2)*MinTLABSize); + const size_t max_plab_samples = + ((DefNewGeneration*)_young_gen)->max_survivor_size()/MinTLABSize; + _survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads); _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples); _cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads);
26-02-2010

SUGGESTED FIX Here's a hack. The real fix might want to be more hygienic and principled:- diff -r 7bfd295ec074 src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Tue Dec 08 15:12:17 2009 -0800 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Dec 14 14:45:10 2009 -0800 @@ -709,8 +709,11 @@ CMSCollector::CMSCollector(ConcurrentMar // Support for parallelizing survivor space rescan if (CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) { - size_t max_plab_samples = cp->max_gen0_size()/ - ((SurvivorRatio+2)*MinTLABSize); + const size_t max_surv_size = + ((DefNewGeneration*)_young_gen)-> + compute_survivor_size(_young_gen->max_capacity(), + cp->min_alignment()); + const size_t max_plab_samples = max_surv_size/MinTLABSize; _survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads); _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples); _cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads); diff -r 7bfd295ec074 src/share/vm/memory/defNewGeneration.hpp --- a/src/share/vm/memory/defNewGeneration.hpp Tue Dec 08 15:12:17 2009 -0800 +++ b/src/share/vm/memory/defNewGeneration.hpp Mon Dec 14 14:45:10 2009 -0800 @@ -136,6 +136,7 @@ protected: MinFreeScratchWords = 100 }; + public: // Temporary // Return the size of a survivor space if this generation were of size // gen_size. size_t compute_survivor_size(size_t gen_size, size_t alignment) const {
14-12-2009

EVALUATION See display#2 of Comments field.
14-12-2009