RFR: 8325870: Zap end padding bits for ArrayOops in non-release builds

Axel Boldt-Christmas aboldtch at openjdk.org
Fri Feb 16 12:44:07 UTC 2024


Make `ObjArrayAllocator` zap the end padding bits in not PRODUCT builds.

Issues like [JDK-8325074](https://bugs.openjdk.org/browse/JDK-8325074) / #17863 would then reproduce deterministically. Avoid future regressions.

Guarded `Copy::fill_to_bytes`, it was not clear if or how it handles `count == 0`. Given that almost all dispatch to memset, the `count == 0` would probably be alright, but as `obj_end - padding_in_bytes` may point beyond an object and thus outside the heap it seems prudent to guard it (I believe memset requires a valid pointer).

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

Commit messages:
 - Merge remote-tracking branch 'upstream_jdk/master' into JDK-8325870
 - 8325870: Zap end padding bits for ArrayOops in non-release builds

Changes: https://git.openjdk.org/jdk/pull/17864/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17864&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325870
  Stats: 23 lines in 4 files changed: 23 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/17864.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17864/head:pull/17864

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


More information about the hotspot-dev mailing list