[9] RFR(S): 8029343: CodeCache::allocate increments '_number_of_blobs' even if allocation fails.

Igor Veresov igor.veresov at oracle.com
Thu May 8 19:31:16 UTC 2014


Yes, sure.

igor

On May 8, 2014, at 3:26 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:

> Thank you Vladimir and Igor.
> 
> Can we push the changes?
> 
> Tobias
> 
> On 06.05.2014 20:26, Vladimir Kozlov wrote:
>> On 5/6/14 5:44 AM, Tobias Hartmann wrote:
>>> Hi Vladimir,
>>> 
>>> On 06.05.2014 09:41, Vladimir Kozlov wrote:
>>>> Parfait may complain about returning NULL and without guarantee.
>>>> Please, test.
>>> 
>>> I tested the implementation with parfait and no new defects showed up.
>> 
>> Okay.
>> 
>> Thanks,
>> Vladimir
>> 
>>> 
>>> Thanks,
>>> Tobias
>>> 
>>>> Thanks,
>>>> Vladimir
>>>> 
>>>> On 5/6/14 12:27 AM, Tobias Hartmann wrote:
>>>>> Hi,
>>>>> 
>>>>> please review the following patch for bug 8029343.
>>>>> 
>>>>> *Problem:*
>>>>> (1) CodeCache::allocate(...) increments _number_of_blobs before the
>>>>> actual allocation is performed. In case the
>>>>> allocation fails the counter is set to a wrong value.
>>>>> (2) The guarantee(size >= 0, ...) is incorrect. Calling
>>>>> CodeCache::allocate(...) with size = 0 leads to a segmentation
>>>>> fault. Further, a guarantee is too strong here. We can simply return
>>>>> NULL at runtime if the size is <= 0.
>>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8029343
>>>>> 
>>>>> *Solution:*
>>>>> (1) The increment is moved after the allocation.
>>>>> (2) An assert is used instead of the guarantee and NULL is returned
>>>>> if size <= 0.
>>>>> Webrev: http://cr.openjdk.java.net/~anoll/8029343/webrev.00/
>>>>> 
>>>>> Thanks,
>>>>> Tobias
>>> 
> 



More information about the hotspot-compiler-dev mailing list