JDK-8309319 : [GenShen] Assertion "used cannot exceed regions" with TestAllocObjects & TestDynamicSoftMaxHeapSize
  • 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/TestAllocObjects.java#generational
gc/shenandoah/TestDynamicSoftMaxHeapSize.java#generational
#  Internal Error src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp:664), pid=18434, tid=29955
#  assert(is_global() || ShenandoahHeap::heap()->is_full_gc_in_progress() || (_used + _humongous_waste <= _affiliated_region_count * ShenandoahHeapRegion::region_size_bytes())) failed: used cannot exceed regions


These assertions were seen on an intel Mac with the following stack snippet:
V  [libjvm.dylib+0x64f8b4]  report_vm_error(char const*, int, char const*, char const*, ...)+0xb4
V  [libjvm.dylib+0x109818f]  ShenandoahGeneration::increase_used(unsigned long)+0xef
V  [libjvm.dylib+0x109d9e0]  ShenandoahHeap::increase_used(ShenandoahAllocRequest const&)+0x120
V  [libjvm.dylib+0x109f8fb]  ShenandoahHeap::allocate_memory(ShenandoahAllocRequest&, bool)+0x1cb
V  [libjvm.dylib+0x109f6dc]  ShenandoahHeap::allocate_new_tlab(unsigned long, unsigned long, unsigned long*)+0x3c
 

Comments
The failing assertions have been removed.
07-06-2023

Thank you for this problem report. These assertions are invalid because they are vulnerable to various race conditions. The assertions have been removed in commit: https://github.com/openjdk/jdk/pull/14185/commits/8d80780a64d7058bffa27b269157596d937a6b22
07-06-2023