RFR: 8293806: JDK_JAVA_OPTIONS picked up twice if LD_LIBRARY_PATH is set

Dmitry Samersoff dsamersoff at openjdk.org
Tue Sep 27 14:51:23 UTC 2022


On Tue, 27 Sep 2022 06:00:10 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Sorry @dsamersoff but I don't understand how this arises - can you explain in more detail please? I'm not seeing the connection between setting `LD_LIBRARY_PATH` and reading an env var twice. Thanks

Linker read LD_LIBRARY_PATH only once, at the time of program loading, so if for some reason launcher need to update LD_LIBRARY_PATH, it creates a new environment and re-launch it self using execvp(). 

But the launcher is designed so that the decision to re-launch is made after all arguments from all sources have already been processed and copied to the argv array.

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

PR: https://git.openjdk.org/jdk/pull/10430


More information about the core-libs-dev mailing list