JDK-8000311 : G1: ParallelGCThreads==0 broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-10-01
  • Updated: 2013-09-18
  • Resolved: 2012-10-05
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
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
Description
While testing with ParallelGCThreads==0, I ran into the following crash:

2012-10-01T14:32:03.781-0700: 4.018: [GC pause (young)4.029: [SoftReference, 0 refs, 0.0000097 secs]4.029: [WeakReference, 1 refs, 0.0000110 secs]4.029: [FinalReference, 28 refs, 0.0003202 secs]4.029: [PhantomReference, 0 refs, 0.0000061 secs]4.029: [JNI Weak Reference, 0 refs, 0.0000089 secs]#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGFPE (0x8) at pc=0xfe386082, pid=12513, tid=6
#
# JRE version: Java(TM) SE Runtime Environment (7.0-b147)
# Java VM: Java HotSpot(TM) Server VM (25.0-b04-internal-jvmg mixed mode solaris-x86 )
# Problematic frame:
# V  [libjvm.so+0xb86082]  void PLABStats::adjust_desired_plab_sz()+0x182
#
# Core dump written. Default location: /export/GC-TEST-SUITES/gcbasher/core or core.12513
#
# An error report file with more information is saved as:
# /export/GC-TEST-SUITES/gcbasher/hs_err_pid12513.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#
Current thread is 6
Dumping core ...

with the following stack trace:

Stack: [0xe66fe000,0xe677e000],  sp=0xe677d674,  free space=509k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xb86082]  void PLABStats::adjust_desired_plab_sz()+0x182
V  [libjvm.so+0x788e27]  void G1CollectedHeap::release_gc_alloc_regions()+0x57
V  [libjvm.so+0x78b7c3]  void G1CollectedHeap::evacuate_collection_set()+0x503
V  [libjvm.so+0x788297]  bool G1CollectedHeap::do_collection_pause_at_safepoint(double)+0x967
V  [libjvm.so+0xdb2e58]  void VM_G1IncCollectionPause::doit()+0x1b8
V  [libjvm.so+0xdafccd]  void VM_Operation::evaluate()+0x7d
V  [libjvm.so+0xdad7cc]  void VMThread::evaluate_operation(VM_Operation*)+0x9c
V  [libjvm.so+0xdadda0]  void VMThread::loop()+0x4d0
V  [libjvm.so+0xdad401]  void VMThread::run()+0x111
V  [libjvm.so+0xb5d950]  java_start+0x210

during the first GC.
Comments
Divide by zero when ParallelGCThreads is zero.
01-10-2012

SIGFPE is a divide by zero error in the following code: // Compute desired plab size and latch result for later // use. This should be called once at the end of parallel // scavenge; it clears the sensor accumulators. void PLABStats::adjust_desired_plab_sz() { assert(ResizePLAB, "Not set"); if (_allocated == 0) { assert(_unused == 0, err_msg("Inconsistency in PLAB stats: " "_allocated: "SIZE_FORMAT", " "_wasted: "SIZE_FORMAT", " "_unused: "SIZE_FORMAT", " "_used : "SIZE_FORMAT, _allocated, _wasted, _unused, _used)); _allocated = 1; } double wasted_frac = (double)_unused/(double)_allocated; size_t target_refills = (size_t)((wasted_frac*TargetSurvivorRatio)/ TargetPLABWastePct); if (target_refills == 0) { target_refills = 1; } _used = _allocated - _wasted - _unused; size_t plab_sz = _used/(target_refills*ParallelGCThreads); We end up dividing _used by zero because ParallelGCThreads is zero.
01-10-2012