United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6859911 G1: assert(Heap_lock->owner() != NULL, "Should be owned on this thread's behalf")
6859911 : G1: assert(Heap_lock->owner() != NULL, "Should be owned on this thread's behalf")

Details
Type:
Bug
Submit Date:
2009-07-13
Status:
Closed
Updated Date:
2011-03-08
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:
hs16

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
I am getting an occasional assert w/the fatsdebug jvm during shudown
in the following code:-

 1654
 1655   // Computes the sum of the storage used by the various regions.
 1656
 1657   size_t G1CollectedHeap::used() const {
 1658     assert(Heap_lock->owner() != NULL,
 1659            "Should be owned on this thread's behalf.");
 1660     size_t result = _summary_bytes_used;
 1661     if (_cur_alloc_region != NULL)
 1662       result += _cur_alloc_region->used();
 1663     return result;
 1664   }
 1665


with the following backtrace:-

  [6] report_assertion_failure(file_name = ???, line_no = ???, message = ???) (optimized), at 0xfffffd7ffcced6fb (line ~173) in "debug.cpp"
=>[7] G1CollectedHeap::used(this = ???) (optimized), at 0xfffffd7ffce4b8e1 (line ~1663) in "g1CollectedHeap.cpp"
  [8] G1CollectedHeap::print_on(this = ???, st = ???, extended = ???) (optimized), at 0xfffffd7ffce4e21c (line ~2344) in "g1CollectedHeap.cpp"
  [9] G1CollectedHeap::print_on(this = ???, st = ???) (optimized), at 0xfffffd7ffce4e1cb (line ~2339) in "g1CollectedHeap.cpp"
  [10] Universe::print() (optimized), at 0xfffffd7ffdfe42cb (line ~1146) in "universe.cpp"
  [11] before_exit(thread = ???) (optimized), at 0xfffffd7ffd0bb8dd (line ~402) in "java.cpp"
  [12] JVM_Halt(code = ???) (optimized), at 0xfffffd7ffd289c86 (line ~341) in "jvm.cpp"
  [13] Java_java_lang_Shutdown_halt0(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ffbdd77db
  [14] 0xfffffd7ff8c1d3c1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c1d3c1
  [15] 0xfffffd7ff8c1d3c1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c1d3c1
  [16] 0xfffffd7ff8c05b82(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c05b82
  [17] 0xfffffd7ff8c05b82(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c05b82
  [18] 0xfffffd7ff8c05b82(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c05b82
  [19] 0xfffffd7ff8c05b82(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c05b82
  [20] 0xfffffd7ff8c05b82(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c05b82
  [21] 0xfffffd7ff8c00575(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff8c00575
  [22] JavaCalls::call_helper(result = ???, m = ???, args = ???, __the_thread__ = ???) (optimized), at 0xfffffd7ffd0c5543 (line ~378) in "javaCalls.cpp"
  [23] JavaCalls::call(result = ???, method = CLASS, args = ???, __the_thread__ = ???) (optimized), at 0xfffffd7ffd0c4cf5 (line ~293) in "javaCalls.cpp"
  [24] jni_invoke_static(env = ???, result = ???, receiver = ???, call_type = ???, method_id = ???, args = ???, __the_thread__ = ???) (optimized), at 0xfffffd7ffd167f08 (line ~1016) in "jni.cpp"
  [25] jni_CallStaticVoidMethod(env = ???, cls = ???, methodID = ???, ...) (optimized), at 0xfffffd7ffd188f7d (line ~1588) in "jni.cpp"
  [26] JavaMain(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x404519
  [27] _thr_setup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff15d907
  [28] _lwp_start(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff15dbb0
May be reproduced with
/net/sqenfs-1.sfbay/export1/comp/vm/jdk/hsx/16/pit/b06/jdk7b65/fastdebug/solaris-sparc/bin/java -XX:+PrintGCDetails -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
originally reproduced with javac:
javac -J-XX:+PrintGCDetails -J-XX:+UnlockExperimentalVMOptions -J-XX:+UseG1GC

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/42d84bbbecf4
                                     
2009-07-22
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/42d84bbbecf4
                                     
2009-07-15
WORK AROUND

do not use -XX:+PrintGCDetails
                                     
2009-07-13
EVALUATION

The failure seems to have been introduced by recent CR 6855834. This changed the format of the print() method on the G1CollectedHeap class and now calls the used() method to get the used amount of bytes in the G1 heap. However, the used() method takes the heap lock and can introduce the issue reported.
                                     
2009-07-13



Hardware and Software, Engineered to Work Together