RFR: 8363986: Heap region in CDS archive is not at deterministic address [v3]
Ioi Lam
iklam at openjdk.org
Tue Nov 18 20:15:53 UTC 2025
> **Overview**
>
> This PR fixes the problem where the JDK build is not reproducible because the `lib/server/classes*.jsa` files do not always put the heap objects at the same addresses. This bug affects only `+UseCompressedOops`.
>
> This bug is in generic code and is not specific to any platform. We hadn't hit this bug because our build platforms always allocated the heap at the same location. However, this is no longer true with macOS 26, which puts the heap at random locations.
>
> **The fix**
>
> (1) In `ArchiveHeapWriter::init()`, we check if we need deterministic heap contents.
>
> (2) In `ArchiveHeapWriter::set_requested_address_range()`, if deterministic heap contents are needed, we always put the archived heap objects to just below `0x100000000`, so that we always write the archived oops into the CDS archive with zero-based, zero-shift encoding.
>
> Please see comments in the above two functions for more details.
Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
Updated comments per @vnkozlov review
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28052/files
- new: https://git.openjdk.org/jdk/pull/28052/files/d7dd0730..086c14d1
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28052&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28052&range=01-02
Stats: 11 lines in 1 file changed: 5 ins; 6 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/28052.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28052/head:pull/28052
PR: https://git.openjdk.org/jdk/pull/28052
More information about the hotspot-runtime-dev
mailing list