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

Generating jre from sdk on Macos gives error. #3

Open
prajwal-s-nayak opened this issue Oct 13, 2021 · 10 comments
Open

Generating jre from sdk on Macos gives error. #3

prajwal-s-nayak opened this issue Oct 13, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@prajwal-s-nayak
Copy link

prajwal-s-nayak commented Oct 13, 2021

Generating jre using jlink gives error on Macos. The modules provided for --add-modules are the ones which are listed in --list-modules option. On windows and linux it works fine.

Sdk used: http://w3.hursley.ibm.com/java/jim/ibmsdks/java11/110120/macosxx8664/index.html

version: 11.0.12

GOLO12854:macOS-JRE persistent$ ../jdk-11.0.12+7/Contents/Home/bin/jlink --output ./generate_jre11_macOS --add-modules java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.management.rmi,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.se,java.security.jgss,java.security.sasl,java.smartcardio,java.sql,java.sql.rowset,java.transaction.xa,java.xml,java.xml.crypto,jdk.accessibility,jdk.attach,jdk.charsets,jdk.compiler,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.dynalink,jdk.editpad,jdk.httpserver,jdk.internal.ed,jdk.internal.jvmstat,jdk.internal.le,jdk.internal.opt,jdk.jartool,jdk.javadoc,jdk.jcmd,jdk.jconsole,jdk.jdeps,jdk.jdi,jdk.jdwp.agent,jdk.jlink,jdk.jshell,jdk.jsobject,jdk.localedata,jdk.management,jdk.management.agent,jdk.naming.dns,jdk.naming.ldap,jdk.naming.rmi,jdk.net,jdk.pack,jdk.rmic,jdk.scripting.nashorn,jdk.scripting.nashorn.shell,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.unsupported.desktop,jdk.xml.dom,jdk.zipfs,openj9.cuda,openj9.dataaccess,openj9.dtfj,openj9.dtfjview,openj9.gpu,openj9.jvm,openj9.sharedclasses,openj9.traceformat,openj9.zosconditionhandling 
Error: Hash of java.rmi (bfbf4653051033eb3ed1e828bce58f617e609c0c7c6c8cb86d2743df0584c378) differs to expected hash (077dce096028d2862846b94a0b91c2dceaa504b056a6f3b0bc6cb04ce7295c33) recorded in java.base

Found a similar issue : AdoptOpenJDK/openjdk12-binaries#1

@AdamBrousseau
Copy link
Contributor

@narkedi is this the same issue you already are aware of or is this something new?

@narkedi
Copy link
Collaborator

narkedi commented Oct 13, 2021

@AdamBrousseau That's true, its the same issue which is due to the mismatch in SHA's.

@AdamBrousseau AdamBrousseau added the bug Something isn't working label Nov 11, 2021
@mbarbero
Copy link

mbarbero commented Dec 3, 2021

The error exists in 11.0.12 and 11.0.13 (latest as of today).

I cannot reproduce with 11.0.11.

@pshipton
Copy link
Member

It still occurs with the latest (11.0.16)

@keithc-ca
Copy link
Member

If signing occurs after the jmod is produced, it will affect the hash, so this should not be surprising. Has anyone checked builds from adoptium to see if they have the same symptoms?

@pshipton
Copy link
Member

Has anyone checked builds from adoptium to see if they have the same symptoms?

I believe I did and the Adoptium build worked. I think there is another issue about this somewhere where I documented that.

@AdamBrousseau
Copy link
Contributor

There's several issues at Adoptium but this one adoptium/temurin-build#1214 seem to be a good starting point. They've fixed the issue.

@aahlenst
Copy link

I was sent here by @tresf. I barely remember any details and it also wasn't me who implemented it at AdoptOpenJDK. If I remember correctly, the key is to make an exploded image, sign it, and then to reassemble it. Basically, you run the build twice with different arguments and skip the configure step on the second pass.

https://github.com/adoptium/ci-jenkins-pipelines/blob/83d8718155a85eb2dc5cdf0005bce62c7ace0ae2/pipelines/build/common/openjdk_build_pipeline.groovy#L1375-L1461 and https://github.com/adoptium/temurin-build/blob/3d0981f31c10ca3e6e533703bb7e6e168609e32c/sbin/build.sh#L574-L577 look like the most relevant parts.

@koppor
Copy link

koppor commented May 21, 2024

Also happens in the build available today. Minimal example repository: https://github.com/koppor/openj9-hash-issue

@koppor
Copy link

koppor commented May 27, 2024

Current output

Error: Hash of java.rmi (03f539ebf91c81cfc7a81236d2c1109e0d050c839d03c6f757022b99a10cb819) differs to expected hash (07126a5cefcc6c19d9059cfa4b42ec832f3714a1ef89f103afc2d1ab61b79bc7) recorded in java.base

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants