JDK-6868051 : (SA) FreeChunk support for compressed oops is broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: hs16
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2009-08-03
  • Updated: 2010-04-02
  • Resolved: 2010-01-15
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
6u18Fixed 7Fixed hs16Fixed
Description
The code for parsing FreeChunks when compressed oops is enabled is broken.  It's got the wrong level of indirection so it will always throw an exception.

Error: sun.jvm.hotspot.debugger.UnalignedAddressException: Trying to read at address: 0x0000000000000001 with alignment: 8
sun.jvm.hotspot.debugger.UnalignedAddressException: Trying to read at address: 0x0000000000000001 with alignment: 8   
        at sun.jvm.hotspot.debugger.DebuggerUtilities.checkAlignment(DebuggerUtilities.java:57)
        at sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal.readCInteger(ProcDebuggerLocal.java:316)
        at sun.jvm.hotspot.debugger.proc.ProcAddress.getCIntegerAt(ProcAddress.java:68)
        at sun.jvm.hotspot.types.basic.BasicField.getCInteger(BasicField.java:162)
        at sun.jvm.hotspot.types.basic.BasicCIntegerField.getValue(BasicCIntegerField.java:54)
        at sun.jvm.hotspot.oops.Mark.value(Mark.java:138)
        at sun.jvm.hotspot.oops.Mark.isUnlocked(Mark.java:172)
        at sun.jvm.hotspot.oops.Mark.isCmsFreeChunk(Mark.java:306)
        at sun.jvm.hotspot.memory.FreeChunk.isFree(FreeChunk.java:87)
        at sun.jvm.hotspot.memory.FreeChunk.indicatesFreeChunk(FreeChunk.java:81)
        at sun.jvm.hotspot.memory.CompactibleFreeListSpace.getLiveRegions(CompactibleFreeListSpace.java:192)
        at sun.jvm.hotspot.oops.ObjectHeap$LiveRegionsCollector.doSpace(ObjectHeap.java:554)
        at sun.jvm.hotspot.memory.ConcurrentMarkSweepGeneration.spaceIterate(ConcurrentMarkSweepGeneration.java:66)   
        at sun.jvm.hotspot.oops.ObjectHeap.collectLiveRegions(ObjectHeap.java:579)
        at sun.jvm.hotspot.oops.ObjectHeap.iterateRaw(ObjectHeap.java:284)
        at sun.jvm.hotspot.CommandProcessor$26.doit(CommandProcessor.java:897)
        at sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1265)
        at sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1235)
        at sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:1138)
        at sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:91)
        at sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:35)

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/ef671fb22f73
10-08-2009

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/ef671fb22f73
06-08-2009

SUGGESTED FIX diff --git a/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java b/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java --- a/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java +++ b/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java @@ -63,7 +63,7 @@ public class FreeChunk extends VMObject public long size() { if (VM.getVM().isCompressedOopsEnabled()) { - Mark mark = new Mark(sizeField.getValue(addr)); + Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset())); return mark.getSize(); } else { Address size = sizeField.getValue(addr); @@ -83,7 +83,7 @@ public class FreeChunk extends VMObject public boolean isFree() { if (VM.getVM().isCompressedOopsEnabled()) { - Mark mark = new Mark(sizeField.getValue(addr)); + Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset())); return mark.isCmsFreeChunk(); } else { Address prev = prevField.getValue(addr);
03-08-2009

EVALUATION it's loading the value instead of passing the address to Mark where it will actually be loaded.
03-08-2009