Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly load libcrypto for JITServer #21085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Feb 7, 2025

When libssl3 (or higher) is bundled with the JDK, we want to load that version in preference over the one present on the system. dlopen will do that because the RUNPATH for the JIT dll (from which dlopen is invoked) includes the "JDK/lib" path where libssl is bundled. However, as part of loading libssl3, dlopen will also attempt to load libcrypto3 (because it is a dependency). This is searched in the RPATH of the jitserver executable for a server, or in the RPATH of the java executable for a client. Currently, the jitserver executable does not include an RPATH, so libcrypto3 is searched on the system and this may fail on systems that do not have version 3 installed. This problem can be circumvented by performing an explicit dlopen for the crypto library, in which case the RUNPATH for the JIT is going to be used as search path.

Fixes: #21066

When libssl3 (or higher) is bundled with the JDK, we want to load that version
in preference over the one present on the system. `dlopen` will do that because
the RUNPATH for the JIT dll (from which `dlopen` is invoked) includes the
"JDK/lib" path where libssl is bundled. However, as part of loading libssl3,
`dlopen` will also attempt to load libcrypto3 (because it is a dependency).
This is searched in the RPATH of the jitserver executable for a server,
or in the RPATH of the java executable for a client. Currently, the jitserver
executable does not include an RPATH, so libcrypto3 is searched on the system
and this may fail on systems that do not have version 3 installed. This problem
can be circumvented by performing an explicit `dlopen` for the crypto library,
in which case the RUNPATH for the JIT is going to be used as search path.

Fixes: eclipse-openj9#21066

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Feb 7, 2025
@mpirvu
Copy link
Contributor Author

mpirvu commented Feb 7, 2025

jenkins test sanity xlinux,plinux,zlinux jdk21

@mpirvu
Copy link
Contributor Author

mpirvu commented Feb 7, 2025

zlinux failed cmdLineTester_GCRegressionTests_1 , but there is no connection to this PR.

13:22:03  Testing: Ensure no core files have been produced by the preceding tests
13:22:03  Test start time: 2025/02/07 18:22:02 Coordinated Universal Time
13:22:03  Running command: sh -c ls
13:22:03  Time spent starting: 63 milliseconds
13:22:03  Time spent executing: 90 milliseconds
13:22:03  Test result: FAILED
13:22:03  Output from test:
13:22:03   [OUT] core.20250207.181816.1297316.0001.dmp

@mpirvu
Copy link
Contributor Author

mpirvu commented Feb 7, 2025

@dsouzai could you please review/merge this PR? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

JITServer tests failing
1 participant