RFR: 8358799: Refactor os::jvm_path()

Johan Sjölen jsjolen at openjdk.org
Mon Jun 9 10:06:50 UTC 2025


On Fri, 6 Jun 2025 16:35:15 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> The linux, bsd, and aix versions of os::jvm_path() are very similar and can be combined into one in os_posix.cpp.
> 
> Passed tiers 1 - 3 tests.
> However, tests were not run on the aix platform since it is not one of the Oracle supported platforms.

src/hotspot/os/posix/os_posix.cpp line 1084:

> 1082:   assert(ret != 0, "cannot locate libjvm");
> 1083:   char* rp = os::realpath((char *)dlinfo.dli_fname, buf, buflen);
> 1084:   assert(rp != nullptr, "error in realpath(): maybe the 'path' argument is too long?");

Pre-existing: We should return if `ret == 0` and `rp == nullptr`, not continue as if it didn't fail.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25675#discussion_r2135405198


More information about the hotspot-runtime-dev mailing list