jlink fails with "Hash of java.xyz differs to expected hash recorded in java.base"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

jlink fails with "Hash of java.xyz differs to expected hash recorded in java.base"

Sebastian Stenzel
Hi all,

not sure if this is the right mailing list to ask about this, but I found some previous mails in the archive that suggested it.

I noticed that whenever I use OpenJDK 11 - 14 on Ubuntu from the distro's official package repo, jlink always fails with messages like these:

    Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base

Using adoptopenjdk, it works just fine. So I believe there is something wrong with Ubuntu's OpenJDK package, however I can hardly tell what they did wrong, since I don't understand what exactly jlink hashes and where the expected hashes are stored.

Can anyone shed some light on what is happening here?

Thanks!
Sebastian
Reply | Threaded
Open this post in threaded view
|

Re: jlink fails with "Hash of java.xyz differs to expected hash recorded in java.base"

Alan Bateman
On 31/03/2020 08:18, Sebastian Stenzel wrote:
> Hi all,
>
> not sure if this is the right mailing list to ask about this, but I found some previous mails in the archive that suggested it.
>
> I noticed that whenever I use OpenJDK 11 - 14 on Ubuntu from the distro's official package repo, jlink always fails with messages like these:
>
>      Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base
>
>
The hashes of the standard and JDK modules are stored in the java.base
module to prevent accidental mismatch at link time. In this case it
suggests that java.base and java.xml came from different builds or maybe
the Ubuntu is doing stripping or other modifications to the packaged
modules. I did a quick search and it looks like it has been noticed by
others too [1]

-Alan

[1] https://bugs.launchpad.net/ubuntu/+source/openjdk-14/+bug/1868699
Reply | Threaded
Open this post in threaded view
|

Re: jlink fails with "Hash of java.xyz differs to expected hash recorded in java.base"

Sebastian Stenzel

> Am 31.03.2020 um 09:47:25 schrieb Alan Bateman <[hidden email]>:
>
> On 31/03/2020 08:18, Sebastian Stenzel wrote:
>> Hi all,
>>
>> not sure if this is the right mailing list to ask about this, but I found some previous mails in the archive that suggested it.
>>
>> I noticed that whenever I use OpenJDK 11 - 14 on Ubuntu from the distro's official package repo, jlink always fails with messages like these:
>>
>>     Hash of java.xml (c043b4c28b897656e2a4d36c92ba2f5d52134bce79643236dd36295e14178be7) differs to expected hash (4e7db7fc941d9f316c4aafe02717b5809ee722be8433d283050365e7fd49331f) recorded in java.base
>>
>>
> The hashes of the standard and JDK modules are stored in the java.base module to prevent accidental mismatch at link time. In this case it suggests that java.base and java.xml came from different builds or maybe the Ubuntu is doing stripping or other modifications to the packaged modules. I did a quick search and it looks like it has been noticed by others too [1]
>
> -Alan
>
> [1] https://bugs.launchpad.net/ubuntu/+source/openjdk-14/+bug/1868699

This was my bug report, that's why I'm investigating to give the Ubuntu guys some tips on how they can solve it (if they caused it in the first place). ;-)
Reply | Threaded
Open this post in threaded view
|

Re: jlink fails with "Hash of java.xyz differs to expected hash recorded in java.base"

Alan Bateman


On 31/03/2020 08:50, Sebastian Stenzel wrote:
> :
> This was my bug report, that's why I'm investigating to give the Ubuntu guys some tips on how they can solve it (if they caused it in the first place). ;-)
Ah, didn't see it was you :-)

I've seen a few reports of issues on Ubuntu go by (like the javac
launcher missing from a run-time image that claims to have the
jdk.compiler module) which hints to me that the bits in the Ubuntu
openjdk-* packages have additional patches and/or they are processed by
something that is changing the bits. I don't have cycles to dig into it
so hopefully your bug report will help the maintainers to track it down.

-Alan.