XS RFR: 8006103: [parfait] Possible null pointer dereference at hotspot/src/os/linux/vm/os_linux.cpp; os_windows.cpp; os_solaris.cpp; os_bsd.cpp
serguei.spitsyn at oracle.com
serguei.spitsyn at oracle.com
Thu Apr 4 16:58:27 PDT 2013
On 4/4/13 2:16 PM, David Holmes wrote:
> On 5/04/2013 4:50 AM, Calvin Cheung wrote:
>> On 4/3/2013 9:56 PM, David Holmes wrote:
>>> On 2/04/2013 3:10 AM, Calvin Cheung wrote:
>>>> Simple fix is to add null check on pelements.
>>>
>>> This warning is bogus. You will only get NULL if n==0 and if n==0 then
>>> you don't dereference pelements.
>> After reading the os::split_path(), n will always be set to 0 if a NULL
>> is returned.
>> Yes, I agreed with the above.
>> But adding a null check should do no harm and make the code easier to
>> understand.
>
> I disagree. Adding the null check is redundant overhead that is
> completely unnecessary.
>
>> I'll check with the parfait dev team and see if they can make the tool
>> "smarter".
>
> This CR should be marked as a false positive and no code change should
> be made in my opinion.
Adding extra code just to make the parfait happy does not look right.
This particular case is a false positive and needs to be fixed in the tool.
Thanks,
Serguei
>
> David
>
>> thanks,
>> Calvin
>>
>>>
>>> David
>>> -----
>>>
>>>> webrev: http://cr.openjdk.java.net/~ccheung/8006103/webrev/
>>>> bug: https://jbs.oracle.com/bugs/browse/JDK-8006103
>>>>
>>>> Test: jprt run was successful.
>>>>
>>>> thanks,
>>>> Calvin
>>
More information about the hotspot-runtime-dev
mailing list