RFR: JDK-8259843: initialize dli_fname array before calling dll_address_to_library_name

David Holmes david.holmes at oracle.com
Wed Jan 20 12:20:54 UTC 2021


On 20/01/2021 6:32 pm, Lutz Schmidt wrote:
> On Wed, 20 Jan 2021 08:21:36 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> 
>>> src/hotspot/share/runtime/frame.cpp line 543:
>>>
>>>> 541:   bool found;
>>>> 542:
>>>> 543:   if (buf == NULL || buflen < 1) return;
>>>
>>> Can this not just be an assert: buf != NULL && buflen > 0 ?
>>
>> Hi David,  I think a return would be clearer but an assert is "better than nothing" .
>>
>> Best regards, Matthias
> 
> With an assert, you assume this is a "cannot occur error". You should be pretty sure to have good test coverage to find all "illegal invocations" before letting a release build escape into the wild.

The problem with a return is that it implies these conditions are 
allowable and could reasonably happen, when in fact it would be an 
internal programming error in the VM. Do we have test coverage for all 
the code paths involved? Probably not. But the vast majority of 
assertions in the VM do not have a "release" bail-out path. Keeping one 
here is unnecessary and overkill IMO but I won't insist it be removed as 
this is essentially error reporting code anyway.

David

> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/2144
> 


More information about the hotspot-dev mailing list