RFR: 8368781: PerfMemory - make issues more transparent [v6]
David Holmes
dholmes at openjdk.org
Tue Oct 21 05:38:13 UTC 2025
On Mon, 20 Oct 2025 12:17:45 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> Currently issues with perfMemory like problems with the secure tmp subdirectory creation are not very transparent in release JVMs.
>>
>> There exists some warnings traces but they are behind develop flags like Verbose so only available in debug JVMs.
>> We could (in case of issues) store some information and write it later into hsinfo/hserr files ; or make the existing warnings available too in release JVMs.
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove log_is_enabled
A few formatting suggestions and one minor fix, but otherwise this looks good to me. Thanks
src/hotspot/os/posix/perfMemory_posix.cpp line 464:
> 462: else {
> 463: log.print_cr("Could not determine user name: %s",
> 464: p->pw_name == nullptr ? "pw_name = null" : "pw_name zero length");
Suggestion:
log.print_cr("Could not determine user name: %s",
p->pw_name == nullptr ? "pw_name = null" : "pw_name zero length");
Fix indent
src/hotspot/os/posix/perfMemory_posix.cpp line 678:
> 676: if (errno != ENOENT) {
> 677: log_debug(perf)("Could not unlink shared memory backing"
> 678: " store file %s : %s", path, os::strerror(errno));
Suggestion:
log_debug(perf)("Could not unlink shared memory backing store file %s : %s",
path, os::strerror(errno));
src/hotspot/os/windows/perfMemory_windows.cpp line 217:
> 215: // unexpected error, declare the path insecure
> 216: log_debug(perf)("could not get attributes for file %s: "
> 217: " lasterror = %d", path, lasterror);
Suggestion:
log_debug(perf)("could not get attributes for file %s: lasterror = %d",
path, lasterror);
src/hotspot/os/windows/perfMemory_windows.cpp line 484:
> 482: if (errno != ENOENT) {
> 483: log_debug(perf)("Could not unlink shared memory backing"
> 484: " store file %s : %s", path, os::strerror(errno));
Suggestion:
log_debug(perf)("Could not unlink shared memory backing store file %s : %s",
path, os::strerror(errno));
src/hotspot/os/windows/perfMemory_windows.cpp line 505:
> 503: DWORD lastError = GetLastError();
> 504: if (lastError != ERROR_INVALID_PARAMETER) {
> 505: log_debug(perf)("OpenProcess failed: %d", GetLastError());
Suggestion:
log_debug(perf)("OpenProcess failed: %d", lastError);
src/hotspot/os/windows/perfMemory_windows.cpp line 557:
> 555: // we can't get information about the volume, so assume unsafe.
> 556: log_debug(perf)("could not get device information for %s: "
> 557: " path = %s: lasterror = %d",
Suggestion:
log_debug(perf)("could not get device information for %s: path = %s: lasterror = %d",
src/hotspot/os/windows/perfMemory_windows.cpp line 565:
> 563: // file system doesn't support ACLs, declare file system unsafe
> 564: log_debug(perf)("file system type %s on device %s does not support"
> 565: " ACLs", fs_type, root_path);
Suggestion:
log_debug(perf)("file system type %s on device %s does not support ACLs",
fs_type, root_path);
src/hotspot/os/windows/perfMemory_windows.cpp line 764:
> 762: if (lasterror != ERROR_INSUFFICIENT_BUFFER) {
> 763: log_debug(perf)("GetTokenInformation failure: lasterror = %d,"
> 764: " rsize = %d", lasterror, rsize);
Suggestion:
log_debug(perf)("GetTokenInformation failure: lasterror = %d, rsize = %d",
lasterror, rsize);
src/hotspot/os/windows/perfMemory_windows.cpp line 775:
> 773: if (!GetTokenInformation(hAccessToken, TokenUser, token_buf, rsize, &rsize)) {
> 774: log_debug(perf)("GetTokenInformation failure: lasterror = %d,"
> 775: " rsize = %d", GetLastError(), rsize);
Suggestion:
log_debug(perf)("GetTokenInformation failure: lasterror = %d, rsize = %d",
GetLastError(), rsize);
src/hotspot/os/windows/perfMemory_windows.cpp line 786:
> 784: if (!CopySid(nbytes, pSID, token_buf->User.Sid)) {
> 785: log_debug(perf)("GetTokenInformation failure: lasterror = %d,"
> 786: " rsize = %d", GetLastError(), rsize);
Suggestion:
log_debug(perf)("GetTokenInformation failure: lasterror = %d, rsize = %d",
GetLastError(), rsize);
src/hotspot/os/windows/perfMemory_windows.cpp line 952:
> 950: if (!SetSecurityDescriptorDacl(pSD, TRUE, newACL, FALSE)) {
> 951: log_debug(perf)("SetSecurityDescriptorDacl failure:"
> 952: " lasterror = %d", GetLastError());
Suggestion:
log_debug(perf)("SetSecurityDescriptorDacl failure: lasterror = %d", GetLastError());
src/hotspot/os/windows/perfMemory_windows.cpp line 970:
> 968: SE_DACL_PROTECTED)) {
> 969: log_debug(perf)("SetSecurityDescriptorControl failure:"
> 970: " lasterror = %d", GetLastError());
Suggestion:
log_debug(perf)("SetSecurityDescriptorControl failure: lasterror = %d", GetLastError());
src/hotspot/os/windows/perfMemory_windows.cpp line 1000:
> 998: if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
> 999: log_debug(perf)("InitializeSecurityDescriptor failure: "
> 1000: "lasterror = %d", GetLastError());
Suggestion:
log_debug(perf)("InitializeSecurityDescriptor failure: lasterror = %d", GetLastError());
src/hotspot/os/windows/perfMemory_windows.cpp line 1054:
> 1052: 0, 0, 0, 0, 0, 0, &administratorsSid)) {
> 1053: log_debug(perf)("AllocateAndInitializeSid failure: "
> 1054: "lasterror = %d", GetLastError());
Suggestion:
log_debug(perf)("AllocateAndInitializeSid failure: lasterror = %d", GetLastError());
src/hotspot/os/windows/perfMemory_windows.cpp line 1069:
> 1067: 0, 0, 0, 0, 0, 0, 0, &everybodySid)) {
> 1068: log_debug(perf)("AllocateAndInitializeSid failure: "
> 1069: "lasterror = %d", GetLastError());
Suggestion:
log_debug(perf)("AllocateAndInitializeSid failure: lasterror = %d", GetLastError());
-------------
PR Review: https://git.openjdk.org/jdk/pull/27602#pullrequestreview-3358529566
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446751388
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446753186
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446756485
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446757435
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446757971
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446758996
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446759591
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446760492
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446761493
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446761961
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446762711
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446763125
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446763472
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446763862
PR Review Comment: https://git.openjdk.org/jdk/pull/27602#discussion_r2446764141
More information about the hotspot-runtime-dev
mailing list