RFR (S) CR 8014886: @Contended fields can overrun oop maps
Vladimir Kozlov
vladimir.kozlov at oracle.com
Mon May 20 21:17:51 PDT 2013
On 5/20/13 7:26 PM, David Holmes wrote:
> Hi Aleksey,
>
> What value does max_oop_maps get? And how does that compare to the old
max_oop_maps = fac->count[NONSTATIC_OOP] is the same as before
@Contended changes were added. Aleksey restored original correct value.
> value of "nonstatic_oop_count + 1"? I'm just trying to get a sense of
I don't remember why I had (nonstatic_oop_count + 1) in my original
changes from few years ago. May be because resource allocation code
complained about size == 0 (when nonstatic_oop_count == 0). Or when we
allocate with UseMallocOnly.
> how much additional space we are now using here.
2 thread resource array are temporary. Only used elements in these
arrays are copied into class data based on nonstatic_oop_map_count
(methods nonstatic_oop_map_count() and fill_oop_maps()).
Note, current code allocates oopmap per contended oop fields even fields
in one group (not separated by padding).
Vladimir
>
> Thanks,
> David
>
> On 21/05/2013 2:11 AM, Aleksey Shipilev wrote:
>> Hi again,
>>
>> This is a simple, but potentially disruptive issue found during the code
>> review. We messed up calculating the oop maps with @Contended classes,
>> and so we can corrupt something adjacent.
>>
>> The fix is here:
>> http://cr.openjdk.java.net/~shade/8014886/webrev.01/
>>
>> The issue is about nonstatic_oop_count counting only non- at Contended
>> fields. The fix is pretty straight-forward, although entire *_count
>> handling requires more refactoring, which is to be handled elsewhere,
>> during the class field layout cleanup.
>>
>> I also put a few asserts as the range-checks, and those asserts are
>> failing when the max_oop_maps are calculated as before.
>>
>> Testing:
>> - new regression test added, fails on new asserts
>> - Linux x86_64/fastdebug runtime/contended/ tests
>> - full JPRT cycle against hotspot-rt
>>
>> Please review!
>>
>> -Aleksey.
>>
More information about the hotspot-dev
mailing list