On Wed, 20 Aug 2025 22:59:51 GMT, Dean Long <[email protected]> wrote:
>> src/hotspot/os/aix/attachListener_aix.cpp line 423:
>>
>>> 421: log_trace(attach)("Failed to find attach file: %s, trying
>>> alternate", fn);
>>> 422: os::snprintf_checked(fn, sizeof(fn), "%s/.attach_pid%d",
>>> 423: os::get_temp_directory(),
>>> os::current_process_id());
>>
>> This could fail if os::get_temp_directory() returns an extremely long path.
>> How about doing a truncation check like at line 354?
>
> Nevermind, same thing. We would need to fix a lot of code if
> os::get_temp_directory() returned a pathologically long string.
I've changed line 352 as per Kim's comment above because `snprintf` followed by
an assert for truncation is what `snprintf_checked` does.
Again the question to ask is: if we hit this during testing do we think it
indicates we need to increase the buffer size. Again I am initially in the yes
camp.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26849#discussion_r2289987176