RFR: 8264412: AArch64: CPU description should refer DMI

Andrew Haley aph at openjdk.java.net
Wed Mar 31 08:48:25 UTC 2021


On Tue, 30 Mar 2021 23:43:47 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

>> src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp line 178:
>> 
>>> 176:     ssize_t read_sz = read(fd, buf, buflen - 1);
>>> 177:     close(fd);
>>> 178:     if ((read_sz > 0) && isgraph(*buf)) {
>> 
>> What is `isgraph(*buf)` doing here? Is the problem that the file might contain binary data?
>
> In case of AWS A1 2x.large, board_name has `\n` (0x0A) only. This code intent to ignore it.

Please be more explicit. This is (perhaps obviously?) a workaround for a bug, And t.his code is itself a bug, because it doesn't check for the condition you care about. So, please check explicitly for this condition: `\n` only, and nothing else. And leave a comment explaining why.

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

PR: https://git.openjdk.java.net/jdk/pull/3259


More information about the hotspot-runtime-dev mailing list