jlink fails due to unexpected hash of java.* modules

Bug #1868699 reported by Sebastian Stenzel
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
openjdk-14 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Ubuntu Focal Fossa (development branch)
Linux 4.4.0-176-generic
openjdk-14-jdk-headless 14~36-2

It appears that jlink fails to create runtime images. I expected the command mentioned below to succeed (exit code 0).

Instead it fails (exit code 1) with the following error message:

> Error: Hash of java.rmi (91a6fed418dc8e3f6af3874310ba35fbc6dc8cd437fc44ed87f8ac453c98d192) differs to expected hash (818ed0065f7ac05ec64de9c2619651dd3eac05cbf40ec3d8958ebb64f5aa3e83) recorded in java.base

When I remove java.rmi from my list of modules, it fails for a different module instead. I suspect that the hashes for all modules might be wrong.

To reproduce this, run (optionally try some other modules):

/usr/lib/jvm/java-14-openjdk-amd64/bin/jlink \
 --output myRuntimeImage \
 --no-header-files \
 --no-man-pages \
 --strip-debug \
 --compress=2 \
 --verbose \
 --add-modules java.base,java.logging,java.xml,java.sql,java.management,java.security.sasl,java.naming,java.datatransfer,java.security.jgss,java.rmi,java.scripting,java.prefs,java.desktop,jdk.security.auth,jdk.unsupported,java.net.http,jdk.crypto.ec

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-14 (Ubuntu):
status: New → Confirmed
Revision history for this message
Kirill Plyashkevich (ru-spirit) wrote :

the similar hash problem I have with 19.10
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu119.10.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu119.10.1, mixed mode, sharing)

And I for my use cases get:
Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base

looks like a general problem in the java package build

Revision history for this message
Francivan Bezerra (fba-rio) wrote :

Confirmed to happen on both OpenJDK 14 and OpenJDK 11.

Revision history for this message
Sebastian Stenzel (sebastian-stenzel) wrote :

I asked about this in the jigsaw mailing list and got a response that suggests that the Ubuntu build "is doing stripping or other modifications to the packaged modules".

If this is the case, the hashes stored in the java.base package need to be patched, too.

Revision history for this message
Kirill Plyashkevich (ru-spirit) wrote :
Revision history for this message
Sebastian Stenzel (sebastian-stenzel) wrote :

Works fine using docker openjdk:14-jdk-buster. No idea this is built, but they build it differently at the openjdk team.

Revision history for this message
Austin Lehman (lehman-austin) wrote :

I had this issue with openjdk-14-jdk. I then installed the AdoptOpenJDK repository instance (adoptopenjdk-14-hotspot) and have the same error.

Revision history for this message
Sebastian Stenzel (sebastian-stenzel) wrote :

@lehman-austin In fact jlink itself should work fine from both, openjdk and adoptopenjdk. The problem lies in the broken *.jmod files in openjdk. Thus your jlink from adoptopenjdk will also fail, if you point to the jmods in the JAVA_HOME dir of openjdk.

Revision history for this message
Kirill Plyashkevich (ru-spirit) wrote :

the issue is stated to be fixed in Debian in version 11.0.8+10-1.1 of openjdk-11 in September (Apply patch to strip nondeterminism before computing jmod hash).

when can we expect the changes arrive to Ubuntu?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.