United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6858886 G1: guarantee(_next_marked_bytes <= used(),"invariant") at heapRegion.hpp:359
JDK-6858886 : G1: guarantee(_next_marked_bytes <= used(),"invariant") at heapRegion.hpp:359

Details
Type:
Bug
Submit Date:
2009-07-09
Status:
Closed
Updated Date:
2012-02-01
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs16
Fixed Versions:
hs17 (b04)

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
The following tests fail with identical symptoms:

nsk/stress/except/except005
nsk/stress/except/except006
nsk/stress/except/except008
nsk/stress/except/except009
nsk/stress/except/except010

These tests fail on all platforms (OS, 32/64), but I have not checked
whether the failure symptom is always the guarantee in the Synopsis.
Further investigation of the failure modes of these tests on various
platforms may require the adjustment of platform information
(currently left at OS: generic, Hardware: generic) provided in this initial
filing.
It seems
to have been failing since at least mid-June, although the failure
symptoms have not always been this. (The symptoms seem to vary
all over the map.) I must confess I didn't search back farther
than mid-June.

I'll file a bug unless someone believes there's already a bug tracking this.
-- ramki

;; Using jvm: "/export/local/common/jdk/baseline/linux-amd64/jre/lib/amd64/server/libjvm.so"
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/tmp/jprt/P1/B/220857.ap31282/source/src/share/vm/gc_implementation/g1/heapRegion.hpp:359), pid=14756, tid=140626223606096
#  Error: guarantee(_next_marked_bytes <= used(),"invariant")
#
# JRE version: 7.0-b63
# Java VM: OpenJDK 64-Bit Server VM (16.0-b05-2009-07-07-220857.ap31282.hotspot-g1-push-fastdebug mixed mode linux-amd64 )
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x000000000206c000):  ConcurrentGCThread [stack: 0x00007fe6180aa000,0x00007fe6181ab000] [id=14768]

Stack: [0x00007fe6180aa000,0x00007fe6181ab000],  sp=0x00007fe6181a9640,  free space=3fd0000000000000018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x9c51df];;  _ZN7VMError6reportEP12outputStream+0x11df
V  [libjvm.so+0x9c557a];;  _ZN7VMError14report_and_dieEv+0x2da
V  [libjvm.so+0x44ab3e];;  _Z12report_fatalPKciS0_+0x6e
V  [libjvm.so+0x408235];;  _ZN22CalcLiveObjectsClosure12doHeapRegionEP10HeapRegion+0x705
V  [libjvm.so+0x54f296];;  _ZN13HeapRegionSeq12iterate_fromEP10HeapRegionP17HeapRegionClosure+0x76
V  [libjvm.so+0x3fc3e3];;  _ZN14ConcurrentMark18calcDesiredRegionsEv+0x223
V  [libjvm.so+0x4316fe];;  _ZN20ConcurrentMarkThread3runEv+0x92e
V  [libjvm.so+0x809ed0];;  _ZL10java_startP6Thread+0xf0


see: http://sqeweb.sfbay.sun.com/nfs/results/vm/gtee/JDK7/NIGHTLY/VM/2009-07-08/G1_GC_Baseline/vm/linux-amd64/server/mixed/linux-amd64_server_mixed_nsk.stress.testlist/ResultDir/except006//hs_err_pid14756.log

                                    

Comments
EVALUATION

from Andrey's e-mail:

Details:
   The cause of the failure is integer overflow when converting object size from words to bytes.
The fix is to widen the object size to size_t:

src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -1328,11 +1328,11 @@
#endif
      }
      // In any case, we set the last card num.
      last_card_num = obj_last_card_num;

-      marked_bytes += obj_sz * HeapWordSize;
+      marked_bytes += (size_t)obj_sz * HeapWordSize;
      // Find the next marked object after this one.
      start = _bm->getNextMarkedWordAddress(start + 1, nextTop);
      _changed = true;
    }
    // Handle the last range, if any.
                                     
2009-10-21
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/dfdaf65c3423
                                     
2009-10-22
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/baseline/rev/788af96b55e3
                                     
2009-11-12
EVALUATION

http://hg.openjdk.java.net/hsx/hsx16/master/rev/788af96b55e3
                                     
2009-11-13



Hardware and Software, Engineered to Work Together