RFR (S) CR 8014964: @Contended breaks has_nonstatic_fields invariant

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed May 22 16:10:04 PDT 2013


On 5/22/13 3:31 PM, Aleksey Shipilev wrote:
> On 05/23/2013 02:09 AM, Vladimir Kozlov wrote:
>>> Testing:
>>>     - hotspot/test/runtime/contended/ regression tests (failing)
>>
>> Could you run all hotspot/test tests (you have to list them)? It should
>> not take long.
>
> Yes, I can. Let me re-spin the testing for this one.
>
>>>     - JPRT cycle vs hotspot-rt is running now  (just in case)
>>>
>>> I actually start to wonder if no size/offset is reliable for this
>>> assert; and counting the fields will yield the same expression over
>>> fac[...], which is dumb to assert. The asserts there are only to fire
>>> the regression test. Hence, this might seem to be that rare case where
>>> the regression test is impractical?
>>
>> The asserts and test are a protection from future bugs in this code (as
>> most of other asserts in VM). This code is complex and is easy to screw
>> up :)
>
> Yes, I know that. My inclination though is to omit the assert for
> has_nonstatic_fields, because we can not reliably assert it. For
> example, if you run the valid regression test (contended/HasNonStatic),
> it will fail on that assert. Am I missing some good way to test
> has_nonstatic_fields without putting exactly the same expression over
> fac[...] in the assert?

That assert fails R3/R4 case because you do not take into account that 
super has padding: super_klass->super->nonstatic_field_size() > 0 but 
super_klass->has_nonstatic_fields() == 0. In general case that could be 
caused by contended annotations or by alignment. We can check for such 
case in assert. But then it will be equivalent to the second assert 
which checks only local size. Yes, I think we don't need 
has_nonstatic_fields assert.

Thanks,
Vladimir

>
> -Aleksey.
>


More information about the hotspot-dev mailing list