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

Parsing logic for EnvDetector failed to grab CURL information #456

Closed
renfeiw opened this issue Jun 27, 2023 · 5 comments · Fixed by #457
Closed

Parsing logic for EnvDetector failed to grab CURL information #456

renfeiw opened this issue Jun 27, 2023 · 5 comments · Fixed by #457

Comments

@renfeiw
Copy link
Contributor

renfeiw commented Jun 27, 2023

For example: version prints out: “curl 7.71.1 (powerpc-ibm-aix6.1.9.0) libcurl/7.71.1 OpenSSL/1.0.2u zlib/1.2.11 libssh2/1.8.2 nghttp2/1.41.0” The parser reads 1.0.2 instead of 7.71.1

@renfeiw
Copy link
Contributor Author

renfeiw commented Jul 5, 2023

After digging more on the issue, found bash -c "curl --version" executed by java ProcessBuilder has the following output:

17:24:07  	exec(): 0509-036 Cannot load program curl because of the following errors:
17:24:07  		0509-022 Cannot load module /opt/freeware/lib64/libcurl.a(libcurl.so.4).
17:24:07  		0509-150   Dependent module /home/jenkins/workspace/Grinder/openjdkbinary/j2sdk-image/lib/libcrypto.a(libcrypto.so.1.0.2) could not be loaded.
17:24:07  		0509-152   Member libcrypto.so.1.0.2 is not found in archive 
17:24:07  		0509-022 Cannot load module curl_64.
17:24:07  		0509-150   Dependent module /opt/freeware/lib64/libcurl.a(libcurl.so.4) could not be loaded.

The same command outside of Java environment successfully prints out curl version.

@renfeiw
Copy link
Contributor Author

renfeiw commented Jul 5, 2023

@AdamBrousseau Do you have any idea?

@KostasTsiounis
Copy link

In the build that I was trying to test and ended up producing this error, I am bundling OpenSSL 3.0.9. This means that there is a file jdk/lib/libcrypto.a which contains only libcrypto.so.3.

But existing curl needs OpenSSL 1.0.2, so it looks for a libcrypto.a file, finds the bundled one first but there is no libcrypto.so.1.0.2 in that archive. This leads to the output mentioned in #456 (comment). And since the parser finds the first version looking string, 1.0.2 is saved as the curl version.

@AdamBrousseau
Copy link
Contributor

I believe what is happening, the Test framework is setting JAVA_HOME to the Java under test and when ant executes, it runs using this java instead of the system default java. This is coming from my memory of a past issue that had an environment issue which we tracked back to JAVA_HOME changing which java ant picked up. Ideally we would run ant with system default java.

As a potential solution, we are going to try and install a newer version of curl on one of the (aix) machines where we are seeing this issue. The newer version will be able to run with openssl 3. We are tracking that in an internal issue but will update here with the results.

@renfeiw
Copy link
Contributor Author

renfeiw commented Jul 12, 2023

Thanks @KostasTsiounis for pointing out the root cause. I have made a change to use parent shell environment in the processbuilder, this could fix this issue and avoid any error similar to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants