RFR: 8354428: [ubsan] g1BiasedArray.hpp: pointer overflow in address calculation [v2]

Thomas Schatzl tschatzl at openjdk.org
Tue May 27 09:10:30 UTC 2025


> Hi all,
> 
>   please review this fix for an ubsan error related to pointer under- or overflows when using the biased array helper.
> 
> The fix is, instead of using direct address calculations that can cause these errors, use `uintptr_t` where the overflow behavior is defined in C++. Only convert to pointer at the actual access.
> 
> Testing: gha, tier1

Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:

  * change size_t to uintptr_t in vmstructs

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25447/files
  - new: https://git.openjdk.org/jdk/pull/25447/files/a9d80f5b..a87b3ed8

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

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/25447.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25447/head:pull/25447

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


More information about the hotspot-gc-dev mailing list