United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6804746 G1: guarantee(variance() > -1.0,"variance should be >= 0") (due to evacuation failure)
JDK-6804746 : G1: guarantee(variance() > -1.0,"variance should be >= 0") (due to evacuation failure)

Details
Type:
Bug
Submit Date:
2009-02-12
Status:
Resolved
Updated Date:
2010-04-04
Project Name:
JDK
Resolved Date:
2009-03-18
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs15
Fixed Versions:
hs15 (b03)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
Nightly testing uncovered this failure:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/tmp/jprt/P2/B/154324.ap159146/source/src/share/vm/utilities/numberSeq.cpp:177), pid=15885, tid=9
#  Error: guarantee(variance() > -1.0,"variance should be >= 0")
#
# JRE version: 7.0-b46
# Java VM: Java HotSpot(TM) 64-Bit Server VM (15.0-b01-2009-02-10-154324.ap159146.hotspot-g1-allocspec-6700941-fastdebug mixed mode solaris-amd64 )
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

                                    

Comments
SUGGESTED FIX

While investigating this failure I also noticed the following:

  update_recent_gc_times(end_sec, full_gc_time_sec);

This is incorrect as update_recent_gc_time() is expecting the second parameter to be in ms:

void G1CollectorPolicy::update_recent_gc_times(double end_time_sec,
                                               double elapsed_ms) {

The fix is straightforward (as full_gc_time_ms is already calculated):

-  update_recent_gc_times(end_sec, full_gc_time_sec);
+  update_recent_gc_times(end_sec, full_gc_time_ms);
                                     
2009-02-12
SUGGESTED FIX

Revert this change:

+     if (!evacuation_failed()) {
        g1_policy()->record_pause_time((end_time_sec - start_time_sec)*1000.0);
+     }

to make sure we correctly set _last_pause_ms, but only update the pause statistics at the end of the pause if the pause didn't have evacuation failure (which was the original intention of the change).
                                     
2009-02-12
EVALUATION

Even though it looks similar to 6785211 I think the cause is different. The failure in this CR was introduced by 6797754 and in particular this change:

+     if (!evacuation_failed()) {
        g1_policy()->record_pause_time((end_time_sec - start_time_sec)*1000.0);
+     }

So, if there was an evacuation failure, record_pause_time() was not called to notify the policy how long the pause time was. As a result the policy will pick up junk if it reads _last_pause_ms (which is the case here), or pick up an incorrect value (if _last_pause_ms) had been set by a previous pause.
                                     
2009-02-12
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/3698e8f47799
                                     
2009-02-25
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/3698e8f47799
                                     
2009-02-28



Hardware and Software, Engineered to Work Together