RFR: 8253079: DeterministicDump.java fails due to garbage in structure padding

Ioi Lam iklam at openjdk.java.net
Sun Sep 20 05:51:53 UTC 2020


In product builds (-O3 without -g), when initializing a `PackageEntry`, gcc for x64 stores garbage into the structure
padding slot behind `BasicHashtableEntry::_hash` in `BasicHashtable<F>::new_entry()`. The garbage value turns out to be
the upper bits of a `Symbol*`, which are different on every run of `java -Xshare:dump`. As a result,
`java -Xshare:dump` cannot reproduce deterministic result.

The fix is to avoid copying contents of the structure padding slots when copying `PackageEntry` and `ModuleEntry`
objects into the CDS archive.

-------------

Commit messages:
 - 8253079: runtime/cds/DeterministicDump.java fails due to garbage in structure padding

Changes: https://git.openjdk.java.net/jdk/pull/267/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=267&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8253079
  Stats: 53 lines in 5 files changed: 51 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/267.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/267/head:pull/267

PR: https://git.openjdk.java.net/jdk/pull/267


More information about the hotspot-runtime-dev mailing list