On Mon, 6 Jul 2026 04:19:58 GMT, David Holmes <[email protected]> wrote:
>> Coleen Phillimore has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Code review comments.
>> - Don't restrict AltTempDir at startup and defer to attach and hsperfdata
>> checking. Check socket file length in attach Java code before retrying to
>> connect. Fix the test.
>
> src/hotspot/os/posix/attachListener_posix.cpp line 207:
>
>> 205: os::get_temp_directory(),
>> os::current_process_id());
>> 206: return -1;
>> 207: }
>
> Suggestion:
>
> else {
> log_warning(attach)("Failed to create temporary file for attach
> %s/.java_pid%d: file name is too long",
> os::get_temp_directory(), os::current_process_id());
> return -1;
> }
No, this isn't right. The code above appends .tmp to the name, so we need to
check 'n' after that.
> src/hotspot/os/posix/attachListener_posix.cpp line 355:
>
>> 353: if (n >= (int)UNIX_PATH_MAX) {
>> 354: return;
>> 355: }
>
> Does this not need a warning as well?
I don't think so. The code in initialization only checks if it has to remove
the .java_pid file, but if the path is too long it doesn't really have to do
anything. The user will get a warning on attach if they try to do it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3528778309
PR Review Comment: https://git.openjdk.org/jdk/pull/31407#discussion_r3528786392