Code Review Request: 6812428: G1: Error: assert(ret or obj_in_cs(obj),"sanity") (XXXS)

Igor Veresov Igor.Veresov at Sun.COM
Tue Mar 3 16:45:48 UTC 2009


Looks good.

igor

On Tuesday 03 March 2009 08:17:55 Tony Printezis wrote:
>  From the CR blurb:
>
> The problem is caused by my fix for the evacuation pause efficiency
> improvements (6484956 <http://monaco.sfbay.sun.com/detail.jsf?cr=6484956>).
> When I set up the byte vector which denotes which regions are in the
> collection set (the vector for the fast cset test), I used n_regions() to
> decide its size. However, the number of regions can actually be increased
> during the GC. If this happens and we try to look up into the fast cset
> test vector, we'll fall off its edge and read junk.
>
> The very straightforward fix is to use max_regions() (i.e., the number of
> reserved regions) instead of n_regions() (i.e., the number of committed
> regions at the beginning of the GC) when setting up the fast cset test
> vector.
>
> I won't bother with a webrev. Here's the diff:
>
> --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
> +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
> @@ -2493,7 +2493,7 @@ G1CollectedHeap::do_collection_pause_at_
>
>      guarantee(_in_cset_fast_test == NULL, "invariant");
>      guarantee(_in_cset_fast_test_base == NULL, "invariant");
> -    _in_cset_fast_test_length = n_regions();
> +    _in_cset_fast_test_length = max_regions();
>      _in_cset_fast_test_base =
>                               NEW_C_HEAP_ARRAY(bool,
> _in_cset_fast_test_length);
>      memset(_in_cset_fast_test_base, false,
>
> Tony





More information about the hotspot-gc-dev mailing list