RFR: 8264684: os::get_summary_cpu_info padded with spaces

Ioi Lam iklam at openjdk.org
Wed Jan 11 19:14:23 UTC 2023


On Tue, 10 Jan 2023 09:46:34 GMT, Afshin Zafari <duke at openjdk.org> wrote:

> ### Description
> Issue: There are some padded spaces in Host info strings in JVM's outputs on Windows platforms.
> Reason: 
> In Windows, the strings read from Registry entries may be shorter than the buffer given to the API to fill in. In these cases, the actual size is written to the `size` parameter by the API. 
> 
> ### Patch
> The given buffer is null terminated at the position of the returned `size`, if it is not longer than the buffer length.
> 
> ### Tests
> local: linux-x64 some tests that crashed and wrote the Host info using the changed code.
> mach5: tier1-5

LGTM

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

Marked as reviewed by iklam (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11920


More information about the hotspot-runtime-dev mailing list