RFR: 8293806: JDK_JAVA_OPTIONS picked up twice if launcher re-executes it self
David Holmes
dholmes at openjdk.org
Wed Oct 19 08:01:00 UTC 2022
On Mon, 26 Sep 2022 18:15:17 GMT, Dmitry Samersoff <dsamersoff at openjdk.org> wrote:
> If the user has set LD_LIBRARY_PATH to use a particular libjvm.so, options from the JDK_JAVA_OPTIONS environment variable are picked up twice.
>
> If an option cannot be accepted twice (e.g., -agentlib), the application fails to start.
>
> The same happens on operating systems that doesn't support $RPATH/$ORIGIN and always have to set LD_LIBRARY_PATH and re-exec the launcher.
>
> The fix adds one additional argument - orig_argv to JLI_Launch() and use it in on relaunch in execv() call.
>
> All relevant jtreg tests are passed.
I don't think solution #2 is desirable whilst the broken re-launch logic remains in place - but I might be swayed to defer that code removal to a separate RFE.
That said solution #1 is certainly preferable as there was obviously an intent that relaunch was handled correctly.
Happy to hear other opinions.
-------------
PR: https://git.openjdk.org/jdk/pull/10430
More information about the core-libs-dev
mailing list