RFR: 8341091: CDS: Segmented roots array misses roots [v2]

Aleksey Shipilev shade at openjdk.org
Wed Oct 2 16:08:18 UTC 2024


> There are a few bugs in [JDK-8338912](https://bugs.openjdk.org/browse/JDK-8338912) that we discovered in Leyden that uses multiple segments: a) root_index in ArchiveHeapWriter::copy_roots_to_buffer is initialized to zero for every segment, so all segments have the same set of roots; b) HeapShared::get_root and friends compute segment and internal indices modulo _byte_ size, while they should instead do it modulo _element_ size.
> 
> This does not affect current mainline directly, since we run with a single segment the overwhelming majority of the time.
> 
> Additional testing:
>  - [x] Linux x86_64 server fastdebug, `runtime/cds`
>  - [x] Linux x86_64 server fastdebug, `runtime/cds` + `-XX:-UseCompressedOops`
>  - [x] Transplanted the patch to Leyden repo and verified it passes `runtime/cds`
>  - [x]  Linux x86_64 server fastdebug, `all`

Aleksey Shipilev 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 three additional commits since the last revision:

 - Tighthen the comment
 - Merge branch 'master' into JDK-8341091-cds-segmented-roots-bugs
 - Fix

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21221/files
  - new: https://git.openjdk.org/jdk/pull/21221/files/c0635da3..bc76119e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21221&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21221&range=00-01

  Stats: 23508 lines in 410 files changed: 18005 ins; 3145 del; 2358 mod
  Patch: https://git.openjdk.org/jdk/pull/21221.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21221/head:pull/21221

PR: https://git.openjdk.org/jdk/pull/21221


More information about the hotspot-runtime-dev mailing list