Need reviewer: a couple of hprof fixes for Parfait

Kelly O'Hair kelly.ohair at oracle.com
Tue Jun 12 19:41:28 PDT 2012


On Jun 12, 2012, at 7:23 PM, David Holmes wrote:

> On 13/06/2012 1:06 AM, Kelly Ohair wrote:
>> if size is zero  it returns null
>> thats the cascading error that parfait is finding
>> asserts turn into nothing with product builds so i need a dead stop here to shut up parfait :(
> 
> Seems rather strange to me. Elsewhere where the assert is used a zero size would cause us to index outside of allocated memory. Why isn't parfait picking that up?

The info pointer is a field in the table element, when info_size==0, the info pointer is null anyway.
So I think all this if test was doing was short circuiting returning a NULL info pointer, which would mean
it had no extra info for the element.

> 
> Not your fault but this seems very ad-hoc.

Yeah, very ad-hoc.

-kto

> 
> David
> 
>> 
>> Sent from my iPhone
>> 
>> On Jun 11, 2012, at 22:56, David Holmes<david.holmes at oracle.com>  wrote:
>> 
>>> On 12/06/2012 12:48 PM, Kelly O'Hair wrote:
>>>> 
>>>> Need reviewer.
>>>> 
>>>> I was asked to look at some Parfait errors in hprof code:
>>>> 
>>>> 7176138: Fixes for missing close() calls and possible null pointer reference instead of fatal error
>>>> http://cr.openjdk.java.net/~ohair/openjdk8/parfait_hprof_fixes/webrev/
>>> 
>>> 
>>> hprof_table.c
>>> 
>>> 211     if ( ltable->info_size == 0 ) {
>>> 212         HPROF_ERROR(JNI_TRUE, "Table is empty and should never be.");
>>> 213         return NULL;
>>> 
>>> It is not obvious this should be a fatal error. Elsewhere this is handled as an assert.
>>> 
>>> David



More information about the serviceability-dev mailing list