JDK-8330027 : Identity hashes of archived objects must be based on a reproducible random seed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-04-10
  • Updated: 2024-06-27
  • Resolved: 2024-05-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21 JDK 22 JDK 23
21.0.5Fixed 22.0.2Fixed 23 b23Fixed
Related Reports
Relates :  
Relates :  
Description
CDS archive contains archived objects with identity hashes. 

These hashes are deliberately preserved or even generated during dumping. They are generated based on a seed that is initialized randomly on a per-thread basis. These generations preceede CDS dump initialization, so they are not affected by the init_random call there or by the changes of  JDK-8323900.

A random seed will not work for dumping archives since it prevents reproducible archive generation. Therefore, when dumping, these seeds must be initiated in a reproducible way.

Comments
[jdk21u-fix-request] Approval Request from Thomas Stuefe I would like to fix this in JDK 21, since it is important for our reproducible-build effort.
26-06-2024

[jdk22u-fix-request] Approval Request from Thomas Stuefe This fixes an issue with CDS archive reproducibility that can happen under rare circumstances. Since CDS reproducibility issues are time consuming to debug and the fix is simple and low risk, I would like to see this issue fixed in JDK 22.
11-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/562 Date: 2024-05-10 14:58:37 +0000
11-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk22u/pull/194 Date: 2024-05-10 10:47:35 +0000
10-05-2024

Changeset: 9f43ce5a Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2024-05-10 09:48:14 +0000 URL: https://git.openjdk.org/jdk/commit/9f43ce5a725b212cec0f3cd17491c4bada953676
10-05-2024

After discussions with Ioi, we settled on: 1 make sure CDS dump only ever calls ihash generation from one thread. Means we disable the explicit hash generation we had been doing before, since that one was called from the VM thread, not from the single java thread 2 Start out with a constant seed for all threads when dumping. This is fine and does not cause collisions between threads, since - see above - we only call ihash generation from a single thread.
02-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18735 Date: 2024-04-11 09:24:16 +0000
11-04-2024