RFR: 8170812: Metaspace corruption caused by incorrect memory size for MethodCounters

Ioi Lam ioi.lam at oracle.com
Thu Apr 6 13:29:12 UTC 2017


I think we should also fix align_metadata_size() and use that for the 
size() function of all MetaspaceObj classes.

Thanks
- Ioi

On 4/6/17 9:20 PM, Coleen Phillimore wrote:
> Deciding...   I say fix the lot now.  I think it's low risk to do so and will save filing another bug etc.
> Thanks!
> Coleen
>
>> On Apr 6, 2017, at 9:02 AM, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
>>
>> Hi Andrew,
>>
>>> On Thu, Apr 6, 2017 at 12:57 PM, Andrew Haley <aph at redhat.com> wrote:
>>>
>>>> On 06/04/17 11:35, Thomas Stüfe wrote:
>>>>
>>>> I think it would make sense. From what I can see, the following methods
>>> are affected:
>>>> ConstantPool::header_size()
>>> Not this one, because the declaration of ConstantPoolCache is
>>>
>>>   int             _length;
>>>   ConstantPool*   _constant_pool;          // the corresponding constant
>>> pool
>>>
>>> The size of this declaration must be a multiple of wordSize
>>> because the fields must be allocated in order, they must be
>>> aligned, and _constant_pool comes last.
>>>
>>> It's very confusing code, but not actually a bug, IMO.
>>>
>>>
>> I am confused:
>>
>> ConstantPool::header_size() is used by ConstantPool::size(len), which in
>> turn is used in ConstantPool::allocate() to allocate space for a
>> ConstantPool. header_size() may be too small, and so the space allocated
>> for the whole ConstantPool plus data may be too small, no?
>>
>> ..Thomas
>>
>>
>>
>>> Andrew.
>>>
>>>



More information about the hotspot-dev mailing list