RFR: 8282828: CDS uncompressed oops archive is not deterministic
Ioi Lam
iklam at openjdk.java.net
Fri Apr 29 23:00:10 UTC 2022
On Fri, 29 Apr 2022 22:50:45 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> During `java -Xshare:dump -XX:-UseCompressedOops`, the location of the Java heap is chosen by the OS. Due to Address Space Layout Randomization, the heap will always start at a different location. This causes the archive for uncompressed oops ($JAVA_HOME/lib/server/classes_nocoops.jsa) to be non-deterministic.
>
> The fix is to patch the archived object pointers to make it look like the heap starts at a fixed address -- I chose 0x10000000, but the exact value doesn't really matter.
>
> At runtime, the object pointers will be patched again according to the real location of the heap.
>
> Tested with tiers 1-5. I am running builds-tier5 several times to test the xxx-cmp-baseline builds.
src/hotspot/share/cds/heapShared.cpp line 184:
> 182: // Do not call p->identity_hash() as that will update the
> 183: // object header.
> 184: return primitive_hash(cast_from_oop<intptr_t>(p));
This fix doesn't affect the contents of the archive, but it's necessary to avoid incorrect output from `-Xlog:cds+map=trace`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8478
More information about the build-dev
mailing list