RFR: 8337981: ShenandoahHeap::is_in should check for alive regions

Aleksey Shipilev shade at openjdk.org
Wed Aug 7 11:57:02 UTC 2024


The expected behavior of `CollectedHeap::is_in` is to check whether the object belongs to the committed parts of the heap. This is useful to check if object resides in the parts of the heap the GC knows are not dead. Yet, Shenandoah's check just verifies that oop is within the heap bounds. So `is_in` check for an object that is in trashed/empty region would pass by accident, and we will miss detecting bugs. This should be rectified. 

I also re-wired assertions/verification code to be clear whether we check for heap bounds or actual in-heap conditions.

Additional testing:
 - [ ] Linux AArch64 server fastdebug, `all` with `-XX:+UseShenandoahGC`

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

Commit messages:
 - Fix

Changes: https://git.openjdk.org/jdk/pull/20492/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20492&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8337981
  Stats: 74 lines in 9 files changed: 35 ins; 0 del; 39 mod
  Patch: https://git.openjdk.org/jdk/pull/20492.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20492/head:pull/20492

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


More information about the hotspot-gc-dev mailing list