JDK-7099817 : CMS: +FLSVerifyLists +FLSVerifyIndexTable asserts: odd slot non-empty, chunk not on free list
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs23
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-10-11
  • Updated: 2012-01-23
  • Resolved: 2012-01-23
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 7 JDK 8 Other
7u4Fixed 8Fixed hs23Fixed
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
EVALUATION http://hg.openjdk.java.net/hsx/hotspot-emb/hotspot/rev/c08412904149
10-11-2011

EVALUATION See main CR
04-11-2011

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

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.
20-10-2011

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.
20-10-2011

WORK AROUND -XX:SuppressErrorAt=...
20-10-2011