United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7099817 CMS: +FLSVerifyLists +FLSVerifyIndexTable asserts: odd slot non-empty, chunk not on free list
JDK-7099817 : CMS: +FLSVerifyLists +FLSVerifyIndexTable asserts: odd slot non-empty, chunk not on free list

Details
Type:
Bug
Submit Date:
2011-10-11
Status:
Closed
Updated Date:
2012-01-23
Project Name:
JDK
Resolved Date:
2012-01-23
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs23 (b04)

Related Reports
Backport:
Backport:

Sub Tasks

Description
Stefan Karlsson reported the following failures with a clean hsx/hotspot-gc/hotspot workspace today:-

-XX:+FLSVerifyLists gives:
#  Internal Error (/home/stefank/hg/hsx-gc/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp:2347), pid=4428, tid=140454366914304
#  guarantee(_sp->verifyChunkInFreeLists(fc)) failed: Chunk should be on a free list

-XX:+FLSVerifyIndexTable gives:
#  Internal Error (/home/stefank/hg/hsx-gc/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp:2498), pid=4472, tid=140439802255104
#  guarantee((size % 2 == 0) || fc == NULL) failed: Odd slots should be empty

Reproducer:
(cd /localhome/tests/SPECjvm2008/ ; ~/hg/hsx-gc/build/linux/linux_amd64_compiler2/jvmg/hotspot -XX:+FLSVerifyLists -XX:+FLSVerifyIndexTable -XX:+VerifyAfterGC -XX:+UseConcMarkSweepGC -jar SPECjvm2008.jar -ikv compiler.compiler)


These should be investigated because they may lead to heap corruption and (temporary) leakage of free space
(before a crash). The likely reason here could be that an object's size is being incorrectly computed.

                                    

Comments
WORK AROUND

-XX:SuppressErrorAt=...
                                     
2011-10-20
SUGGESTED FIX

The check:-

   guarantee((size % 2 == 0) || fc == NULL) failed: Odd slots should be empty

should instead check:-

   (size > MinChunkSize && (size % IndexSetStride == 0)) || fc == NULL

The check:-

    guarantee(_sp->verifyChunkInFreeLists(fc)) failed: Chunk should be on a free list

should instead check:-

    _sp->verify_chunk_is_linear_alloc_block(fc) || _sp->verify_chunk_in_free_lists(fc)

where

bool CompactibleFreeListSpace::verify_chunk_is_linear_alloc_block(FreeChunk* fc) {
   return ((_smallLinearLinearAllocBlock._ptr == (HeapWord*)fc) &&
           (_smallLinearLinearAllocBlock._word_size == fc->size()));
}

My initial reaction was to fold the linAB check into the existing
verify_chunk_in_free_lists(), but that might cause issues at other
places (making the checks perhaps weaker than was intended), so I
left that well alone, but it would be a good idea to audit these
other uses and figure out what would be the better place for
the check.
                                     
2011-10-20
EVALUATION

The first assert was too strong for 64-bit, and needed to be suitably modified.

The second assert was also too strong, when linear allocation
blocks are used. The assert needed to be suitably modified to
deal with that case.

See suggested fix section.

Since these are both problems with assertions rather than with production
code, I'll downgrade this to a P4 and target to hs23.
                                     
2011-10-20
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/c08412904149
                                     
2011-10-26
EVALUATION

See main CR
                                     
2011-11-04
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-emb/hotspot/rev/c08412904149
                                     
2011-11-10



Hardware and Software, Engineered to Work Together