United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6621144 CMS: assertion failure "is_cms_thread == Thread::current()->is_ConcurrentGC_thread()"
6621144 : CMS: assertion failure "is_cms_thread == Thread::current()->is_ConcurrentGC_thread()"

Details
Type:
Bug
Submit Date:
2007-10-24
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs12

Related Reports
Backport:
Backport:

Sub Tasks

Description
See comments for email trail describing problem and solution.

                                    

Comments
EVALUATION

Fixed via jprt:2008-02-17-065058.ysr.gc_fixes in hg/hotspot-gc
                                     
2008-02-22
SUGGESTED FIX

changeset:   4:d56d47da9815
user:        ysr
date:        Sat Feb 16 22:41:20 2008 -0800
summary:     6621144: CMS: assertion failure "is_cms_thread == Thread::current()->is_ConcurrentGC_thread()"

diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -5732,13 +5732,19 @@ void CMSCollector::sweep(bool asynch) {
   // in the perm_gen_verify_bit_map. In order to do that we traverse
   // all blocks in perm gen and mark all dead objects.
   if (verifying() && !cms_should_unload_classes()) {
-    CMSTokenSyncWithLocks ts(true, _permGen->freelistLock(),
-                             bitMapLock());
     assert(perm_gen_verify_bit_map()->sizeInBits() != 0,
            "Should have already been allocated");
     MarkDeadObjectsClosure mdo(this, _permGen->cmsSpace(),
                                markBitMap(), perm_gen_verify_bit_map());
-    _permGen->cmsSpace()->blk_iterate(&mdo);
+    if (asynch) {
+      CMSTokenSyncWithLocks ts(true, _permGen->freelistLock(),
+                               bitMapLock());
+      _permGen->cmsSpace()->blk_iterate(&mdo);
+    } else {
+      // In the case of synchronous sweep, we already have
+      // the requisite locks/tokens.
+      _permGen->cmsSpace()->blk_iterate(&mdo);
+    }
   }
 
   if (asynch) {
                                     
2007-11-13
SUGGESTED FIX

------- concurrentMarkSweepGeneration.cpp -------
*** /tmp/sccs.HYa4Hs    Mon Oct 29 15:11:30 2007
--- concurrentMarkSweepGeneration.cpp   Mon Oct 29 14:37:52 2007
***************
*** 5735,5747 ****
    // in the perm_gen_verify_bit_map. In order to do that we traverse
    // all blocks in perm gen and mark all dead objects.
    if (verifying() && !cms_should_unload_classes()) {
-     CMSTokenSyncWithLocks ts(true, _permGen->freelistLock(),
-                              bitMapLock());
      assert(perm_gen_verify_bit_map()->sizeInBits() != 0,
             "Should have already been allocated");
      MarkDeadObjectsClosure mdo(this, _permGen->cmsSpace(),
                                 markBitMap(), perm_gen_verify_bit_map());
!     _permGen->cmsSpace()->blk_iterate(&mdo);
    }
  
    if (asynch) {
--- 5735,5753 ----
    // in the perm_gen_verify_bit_map. In order to do that we traverse
    // all blocks in perm gen and mark all dead objects.
    if (verifying() && !cms_should_unload_classes()) {
      assert(perm_gen_verify_bit_map()->sizeInBits() != 0,
             "Should have already been allocated");
      MarkDeadObjectsClosure mdo(this, _permGen->cmsSpace(),
                                 markBitMap(), perm_gen_verify_bit_map());
!     if (asynch) {
!       CMSTokenSyncWithLocks ts(true, _permGen->freelistLock(),
!                                bitMapLock());
!       _permGen->cmsSpace()->blk_iterate(&mdo);
!     } else {
!       // In the case of synchronous sweep, we already have
!       // the requisite locks/tokens.
!       _permGen->cmsSpace()->blk_iterate(&mdo);
!     }
    }
  
    if (asynch) {
                                     
2007-10-29
SUGGESTED FIX

Replicate and move the dead bit map iteration code into the
if (asynch) { X } else { Y } code further below, removing the
CMSTokenSync c'tor for the Y-copy above. Diffs will be pasted
below.
                                     
2007-10-24
EVALUATION

See comments and suggested fix fields.
                                     
2007-10-24



Hardware and Software, Engineered to Work Together