JDK-8309320 : [GenShen] Assertion "size must be multiple of card table size"" with TestElasticTLAB
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-06-01
  • Updated: 2023-06-07
  • Resolved: 2023-06-07
Related Reports
Relates :  
Description
Reported by Martin Doerr:

gc/shenandoah/TestElasticTLAB.java#generational
#  Internal Error (src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp:695), pid=2948314, tid=2948983
#  assert(size % CardTable::card_size_in_words() == 0) failed: size must be multiple of card table size, was 258


This assertion was seen on linux aarch64 with the following stack snippet:
V  [libjvm.so+0x15795a0]  ShenandoahFreeSet::allocate_aligned_plab(unsigned long, ShenandoahAllocRequest&, ShenandoahHeapRegion*)+0x22c  (shenandoahFreeSet.cpp:695)
V  [libjvm.so+0x157c748]  ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion*, ShenandoahAllocRequest&, bool&)+0x3e8  (shenandoahFreeSet.cpp:788)
V  [libjvm.so+0x157dac8]  ShenandoahFreeSet::allocate_old_with_affiliation(ShenandoahAffiliation, ShenandoahAllocRequest&, bool&)+0x404  (shenandoahFreeSet.cpp:432)
V  [libjvm.so+0x157f384]  ShenandoahFreeSet::allocate_single(ShenandoahAllocRequest&, bool&)+0xaf4  (shenandoahFreeSet.cpp:589)
V  [libjvm.so+0x15b533c]  ShenandoahHeap::allocate_memory_under_lock(ShenandoahAllocRequest&, bool&, bool)+0xac  (shenandoahHeap.cpp:1440)
V  [libjvm.so+0x15b5940]  ShenandoahHeap::allocate_memory(ShenandoahAllocRequest&, bool)+0x50  (shenandoahHeap.cpp:1331)
V  [libjvm.so+0x15b654c]  ShenandoahHeap::allocate_from_plab_slow(Thread*, unsigned long, bool)+0x10c  (shenandoahHeap.cpp:1281)
V  [libjvm.so+0x372bd4]  ShenandoahHeap::try_evacuate_object(oop, Thread*, ShenandoahHeapRegion*, ShenandoahAffiliation)+0x1614  (shenandoahHeap.inline.hpp:306)
V  [libjvm.so+0x373c08]  ShenandoahHeap::evacuate_object(oop, Thread*)+0x7a8  (shenandoahHeap.inline.hpp:346)
V  [libjvm.so+0x1687dcc]  void ShenandoahEvacuateUpdateRootClosureBase<true, false>::do_oop_work<oop>(oop*)+0xcac  (shenandoahClosures.inline.hpp:156)
V  [libjvm.so+0x16880a8]  ShenandoahEvacuateUpdateRootClosureBase<true, false>::do_oop(oop*)+0x88  (shenandoahClosures.inline.hpp:122)
V  [libjvm.so+0xb355dc]  frame::oops_interpreted_do(OopClosure*, RegisterMap const*, bool) const [clone .part.0]+0x17c  (frame.cpp:909)
V  [libjvm.so+0x16fc784]  StackWatermarkFramesIterator::process_one(void*)+0x174  (stackWatermark.cpp:103)
V  [libjvm.so+0x16fce44]  StackWatermark::start_processing_impl(void*)+0xb4  (stackWatermark.cpp:217)
V  [libjvm.so+0x1686f38]  ShenandoahStackWatermark::start_processing_impl(void*)+0xa8  (shenandoahStackWatermark.cpp:118)
 

Comments
We have added code to force alignment of PLAB allocation requests.
07-06-2023

A recent merge allowed unaligned PLAB allocation requests to progress to the point of raising this assertion failure. We have inserted code to force alignment of all PLAB allocation requests in the following two commits: https://github.com/openjdk/jdk/pull/14185/commits/d4d2f1cf224200826593b67eabc2e0730f5a03f9 https://github.com/openjdk/jdk/pull/14185/commits/8f9e2a84966008b3b94bf0268d06d468834ed6fc
07-06-2023

Per Martin Doerr, this was also seen in hs Windows testing as well: gc/shenandoah/TestElasticTLAB.java#generational # Internal Error (src\hotspot\share\gc\shenandoah\shenandoahFreeSet.cpp:695), pid=23288, tid=23784 # assert(size % CardTable::card_size_in_words() == 0) failed: size must be multiple of card table size, was 258
01-06-2023