JDK-5081701 : CMS: ATG crash with perm gen collection enabled
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 5.0u9,5.0u11,5.0u14,6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS:
    linux_redhat_3.0,linux_suse_sles_8,solaris_9,solaris_10 linux_redhat_3.0,linux_suse_sles_8,solaris_9,solaris_10
  • CPU: generic,x86,sparc
  • Submitted: 2004-08-02
  • Updated: 2009-05-18
  • Resolved: 2009-05-18
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.
Other Other JDK 6
5.0u18-revFixed 5.0u19Fixed 6 mustangFixed
Related Reports
Relates :  
Description
with perm gen collection enabled, atg client crashed after 112 iterations
with tiger b60.
Flags used: -server -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails  -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled

The first error happened in SweepClosure::doGarbageChunk()

Thread 5 (Thread 3076 (LWP 1473)):
#0  0x400d9771 in nanosleep () from /lib/i686/libc.so.6
#1  0x400d9639 in sleep () from /lib/i686/libc.so.6
#2  0x4053c46c in os::message_box(char const*, char const*) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#3  0x40602836 in VMError::show_message_box(char*, int) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#4  0x406024fa in VMError::report_and_die() ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#5  0x4053da96 in JVM_handle_linux_signal ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#6  0x4053b2c4 in signalHandler(int, siginfo*, void*) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#7  0x4002cb03 in pthread_sighandler_rt () from /lib/i686/libpthread.so.0
#8  <signal handler called>
#9  0x40307ba1 in SweepClosure::doGarbageChunk(FreeChunk*) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#10 0x40307a39 in SweepClosure::do_blk_careful(HeapWord*) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#11 0x402e43bc in CompactibleFreeListSpace::blk_iterate_careful(BlkClosureCareful*) () from /usr/j2se/jre/lib/i386/server/libjvm.so
#12 0x4030460d in CMSCollector::sweep(int) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#13 0x402fe2e2 in CMSCollector::collect_in_background(int) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#14 0x40309dfa in ConcurrentMarkSweepThread::run() ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#15 0x4053cde8 in _start(Thread*) ()
   from /usr/j2se/jre/lib/i386/server/libjvm.so
#16 0x4002a020 in pthread_start_thread () from /lib/i686/libpthread.so.0

###@###.### 2004-08-02
###@###.### 10/7/04 00:13 GMT

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang FIXED IN: mustang
11-08-2004

EVALUATION under test and review for Mustang.
11-08-2004

SUGGESTED FIX ###@###.### 2004-08-03: This is a partial fix that works around some of the issues described in 5040363, essentially trusting the P-marks over the explicit size computation, which is a win in the presence of 5040363: ------- concurrentMarkSweepGeneration.cpp ------- 5803,5808c5803,5806 < if (oop(addr)->klass() == NULL || < (CMSPermGenSweepingEnabled && !oop(addr)->is_parsable())) { < < assert(_bitMap->isMarked(addr + 1), "missing Printezis mark?"); < // this is a yet uninitialized object that's alive, caclulate its end < // from the bit map. --- > assert(_bitMap->isMarked(addr), "Tautology for this control point"); > if (_bitMap->isMarked(addr + 1)) { > // Determine the size from the bit map, rather than trying to > // compute it from the object header. 5812a5811,5818 > DEBUG_ONLY( > if (oop(addr)->klass() != NULL && > (!CMSPermGenSweepingEnabled || oop(addr)->is_parsable())) { > assert(oop(addr)->is_oop(), "live block should be an oop"); > assert(size == CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()), > "P-mark and computed size do not agree"); > } > ) 5819c5825 < debug_only( --- > DEBUG_ONLY( 5821,5827c5827,5828 < if (!_bitMap->isMarked(addr+1)) { < _bitMap->verifyNoOneBitsInRange(addr+2, addr+size); < } else { < _bitMap->verifyNoOneBitsInRange(addr+2, addr+size-1); < assert(_bitMap->isMarked(addr+size-1), < "inconsistent Printezis mark"); < } --- > assert(!_bitMap->isMarked(addr+1), "Tautology for this control point"); > _bitMap->verifyNoOneBitsInRange(addr+2, addr+size); ----------------------------------------------- Job submitted at: 12:24:36 PM Total job time: 2h 00m 49s Job state: success Job fail/kill comment: NoComment Job flags: ARCHIVE SYNC-WORKSPACE VM test flags -XX:+PrintGCDetails -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled Original workspace: neeraja:/net/spot/scratch/ysr/mut Parent workspace: /net/jano.sfbay/export/disk05/hotspot/ws/1.5/tiger_baseline Submitter: ysr PRT data: /net/prt-web.sfbay/prt-workspaces/20040804122333.ysr.mut Archived data: /net/prt-archiver.sfbay/export2/archived_workspaces/1.5/tiger_baseline/2004/20040804122333.ysr.mut/ Webrev: http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/export2/archived_workspaces/1.5/tiger_baseline/2004/20040804122333.ysr.mut/workspace/webrevs/webrev-2004.08.04/index.html Generate binaries for testing; archive ------------------------------------------------ ###@###.### 2004-08-10: Fix put back to Mustang: Event: putback-to Parent workspace: /net/jano.sfbay/export/disk05/hotspot/ws/main/gc_baseline (jano.sfbay:/export/disk05/hotspot/ws/main/gc_baseline) Child workspace: /prt-workspaces/20040810135029.ysr.merge/workspace (prt-web:/prt-workspaces/20040810135029.ysr.merge/workspace) User: ysr Comment: --------------------------------------------------------- Original workspace: neeraja:/net/spot/scratch/ysr/merge Submitter: ysr Archived data: /net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2004/20040810135029.ysr.merge/ Webrev: http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/gc_baseline/2004/20040810135029.ysr.merge/workspace/webrevs/webrev-2004.08.10/index.html Fixed 5081701: CMS: ATG crash with perm gen collection enabled Fixed 5083318: CMS: debug jvm deadlocks because of CodeCache_lock during verification http://analemma.sfbay/net/spot/scratch/ysr/merge/webrev Details: -------- 5081701: The sweeper was trying to parse yet another unparseable, still-partially-initialized object in the perm gen. See 5040363 (FIP) for a catalogue of such issues. One way of avoiding such issues during sweeping is to recognize that such partially initialized objects must necessarily have been allocated since the start of the current CMS cycle, and must therefore have their P-bits set. When possible, we now use the P-bits, in preference to an explicit size computation, for live objects. This avoids any problems with (transiently) unparsable objects in the perm gen. Added appropriate assertions to highlight the cases where the new scheme is superior to the previous. (Perhaps these assertions should convert to "warnings," still non-product only.) Initial performance measurements indicate that the performance impact of this change on sweeping is a wash. More careful performance data being collected. Fix Verified: yes Verification Testing: ATG on SUSE Linux ES8 with CMS + class unloading 5083318: The CMS thread was attempting to take the CompiledIC_lock at a safepoint during nmethod verification. This caused a deadlock as the lock may be held by a JavaThread when it stops at a safepoint. Like the VMThread, the CMS thread also elides the locking if at a safepoint. Fix Verified: yes Verification Testing: ATG with CMS + class unloading (fastdebug) Thanks to June Zhong for verification testing for both fixes. Other Testing: (both bugs) CMS (with & without class unloading) spec, PRT, refWorkload, runThese, cloudscape, HP's class unloading test Reviewed by: John Coomes Files: update: src/share/vm/code/nmethod.cpp update: src/share/vm/memory/concurrentMarkSweepGeneration.cpp Examined files: 3223 Contents Summary: 2 update 3221 no action (unchanged)
11-08-2004