[jdk19] RFR: 8291496: Allocating card table before heap causes underflow asserts in CardTable::addr_for()

Thomas Schatzl tschatzl at openjdk.org
Thu Aug 4 15:39:55 UTC 2022


Hi all,

  can I have reviews for sidestepping a wrong assert in `CardTable::addr_for`?

So if `CardTable::_byte_map_base` gets negative (highest bit set) if it is allocated very much below the heap, the used `pointer_delta` method errors out with an assert that (in unsigned comparison) the "left" address is smaller than the "right" address.

Testing: tier 1-5, failures without change after modifying the code to allocate the card table at very low addresses and using `HeapBaseMinAddress`, no failures afterwards.

@albertnetymk analyzed this, so I'll add him as contributor of this patch.

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

Commit messages:
 - Fix pointer calculation
 - Initial version

Changes: https://git.openjdk.org/jdk19/pull/160/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk19&pr=160&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8291496
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk19/pull/160.diff
  Fetch: git fetch https://git.openjdk.org/jdk19 pull/160/head:pull/160

PR: https://git.openjdk.org/jdk19/pull/160



More information about the hotspot-gc-dev mailing list