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

Ioi Lam iklam at openjdk.java.net
Mon Sep 21 05:23:57 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.

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes
the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last
revision:

 - Zero out memory for newly allocated HashtableEntry
 - Merge branch 'master' of https://github.com/iklam/jdk into 8253079-DeterministicDump-test-fails-product-build
 - Revert "8253079: runtime/cds/DeterministicDump.java fails due to garbage in structure padding"
   
   This reverts commit d380e0213283f5f28889d867bb2505a91781df6e.
 - 8253079: runtime/cds/DeterministicDump.java fails due to garbage in structure padding

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/267/files
  - new: https://git.openjdk.java.net/jdk/pull/267/files/d380e021..225c9272

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=267&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=267&range=00-01

  Stats: 195 lines in 14 files changed: 58 ins; 103 del; 34 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