RFR: 8333871: check sysinfo return values [v2]

Matthias Baesken mbaesken at openjdk.org
Fri Nov 14 14:07:21 UTC 2025


On Fri, 14 Nov 2025 12:08:05 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   0 - terminate not needed
>
> src/java.base/unix/native/libjava/java_props_md.c line 395:
> 
>> 393:             sprops.cpu_isalist = strdup(list);
>> 394:         } else {
>> 395:             sprops.cpu_isalist = NULL;
> 
> Would you mind checking the code that puts this in a system property can tolerate NULL? I don't suppose sysinfo will fail here (unless you found a case?) but it would be good to confirm that it won't blow up somewhere else.

We do  PUTPROP here
https://github.com/openjdk/jdk/blob/5d65c23cd99b72527dcfab9eb6da9510e7dc6330/src/java.base/share/native/libjava/System.c#L164
with 3rd parameter == NULL in this case.
PUTPROP checks for this so I do not see issues with this
https://github.com/openjdk/jdk/blob/5d65c23cd99b72527dcfab9eb6da9510e7dc6330/src/java.base/share/native/libjava/System.c#L68

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28317#discussion_r2527633331


More information about the hotspot-runtime-dev mailing list