7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV

Wed, 02 Nov 2011 08:04:23 +0100

author
brutisso
date
Wed, 02 Nov 2011 08:04:23 +0100
changeset 3267
ed80554efa25
parent 3266
6fd81579526f
child 3268
8aae2050e83e

7106751: G1: gc/gctests/nativeGC03 crashes VM with SIGSEGV
Summary: _cset_rs_update_cl[] was indexed with values beyond what it is set up to handle.
Reviewed-by: ysr, jmasa, johnc

src/share/vm/gc_implementation/g1/g1RemSet.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Mon Oct 31 08:01:20 2011 +0100
     1.2 +++ b/src/share/vm/gc_implementation/g1/g1RemSet.cpp	Wed Nov 02 08:04:23 2011 +0100
     1.3 @@ -635,10 +635,18 @@
     1.4    ct_freq_note_card(_ct_bs->index_for(start));
     1.5  #endif
     1.6  
     1.7 -  assert(!check_for_refs_into_cset || _cset_rs_update_cl[worker_i] != NULL, "sanity");
     1.8 +  OopsInHeapRegionClosure* oops_in_heap_closure = NULL;
     1.9 +  if (check_for_refs_into_cset) {
    1.10 +    // ConcurrentG1RefineThreads have worker numbers larger than what
    1.11 +    // _cset_rs_update_cl[] is set up to handle. But those threads should
    1.12 +    // only be active outside of a collection which means that when they
    1.13 +    // reach here they should have check_for_refs_into_cset == false.
    1.14 +    assert((size_t)worker_i < n_workers(), "index of worker larger than _cset_rs_update_cl[].length");
    1.15 +    oops_in_heap_closure = _cset_rs_update_cl[worker_i];
    1.16 +  }
    1.17    UpdateRSOrPushRefOopClosure update_rs_oop_cl(_g1,
    1.18                                                 _g1->g1_rem_set(),
    1.19 -                                               _cset_rs_update_cl[worker_i],
    1.20 +                                               oops_in_heap_closure,
    1.21                                                 check_for_refs_into_cset,
    1.22                                                 worker_i);
    1.23    update_rs_oop_cl.set_from(r);

mercurial