<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    Could I have reviews for the fix for a G1 GC crash:<br>
    <br>
    <a id="key-val"
      href="https://bugs.openjdk.java.net/browse/JDK-8044406"
      rel="4728073">8044406</a>: JVM crash with JDK8 (build 1.8.0-b132)
    with G1 GC<br>
    Webrev: <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~poonam/8044406/webrev.00/webrev/">http://cr.openjdk.java.net/~poonam/8044406/webrev.00/webrev/</a><br>
    <br>
    The crash happens with the following stack trace:<br>
    Stack: [0x00007fd435a1f000,0x00007fd435b20000], 
    sp=0x00007fd435b1bc30,  free space=1011k<br>
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code,
    C=native code)<br>
    V  [libjvm.so+0x541261] 
    G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord*,
    HeapWord*, void const*)+0xf1<br>
    V  [libjvm.so+0x959e54] 
    DirtyCardToOopClosure::do_MemRegion(MemRegion)+0x64<br>
    V  [libjvm.so+0x56d2a4] 
    ScanRSClosure::doHeapRegion(HeapRegion*)+0x374<br>
    V  [libjvm.so+0x542dd0] 
    G1CollectedHeap::collection_set_iterate_from(HeapRegion*,
    HeapRegionClosure*)+0x60<br>
    V  [libjvm.so+0x56c08c]  G1RemSet::scanRS(OopsInHeapRegionClosure*,
    CodeBlobToOopClosure*, int)+0xdc<br>
    V  [libjvm.so+0x56c4d5] 
    G1RemSet::oops_into_collection_set_do(OopsInHeapRegionClosure*,
    CodeBlobToOopClosure*, int)+0x145<br>
    V  [libjvm.so+0x549ef4] 
    G1CollectedHeap::g1_process_strong_roots(bool,
    SharedHeap::ScanningOption, OopClosure*, OopsInHeapRegionClosure*,
    G1KlassScanClosure*, int)+0x224<br>
    V  [libjvm.so+0x558a88]  G1ParTask::work(unsigned int)+0xb88<br>
    V  [libjvm.so+0xa4a9ff]  GangWorker::loop()+0xcf<br>
    V  [libjvm.so+0x8a0058]  java_start(Thread*)+0x108<br>
    <br>
    Here, the GC thread crashes while scanning the RemSet (part of the
    non-CSet regions). And it happens to scan a region to which another
    thread in G1ParEvacuateFollowersClosure is copying contents to, and
    this region was found out to be an Old GC alloc region.<br>
    <br>
    This change makes sure that we fill up the last card of the Old GC
    alloc region that was being allocated into, with a dummy object so
    that it does not get scanned by the remset scanning GC threads.<br>
    <br>
    This change applies cleanly to 8u and 7u repos.<br>
    <br>
    Thanks to Thomas Schatzl for his help in investigating the crash and
    suggesting this solution.<br>
    <br>
    Testing:<br>
    - JPRT<br>
    - Testing by Coherence QA<br>
    <br>
    Thanks,<br>
    Poonam<br>
    <br>
  </body>
</html>