RFR: 8319589: Attach from root to a user java process not supported in Mac [v4]

Sergey Chernyshev schernyshev at openjdk.org
Thu Sep 25 08:46:12 UTC 2025


On Tue, 23 Sep 2025 21:53:46 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Thanks David for pointing this out. A different instance with a different PID may have a different temp path, so the path should be specific to the instance. Since we don't need the path outside the constructor, I think we don't need to cache it. On the other hand I see that `getTempDirFromPid` is called twice, once for `.java_pid` and another time in `createAttachFile` when `.java_pid` doesn't exist. Would you suggest storing the path in a local variable in the constructor and then concatenating it with attach file name, or would a non-static member variable be more suitable for this?
>
> I would save it in a local in the constructor and pass it to `createAttachFile` rather than passing the pid.

done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25824#discussion_r2378277200


More information about the serviceability-dev mailing list