RFR: 8361487: [ubsan] test_committed_virtualmemory.cpp check_covered_pages shows overflow

Afshin Zafari azafari at openjdk.org
Wed Nov 5 15:04:12 UTC 2025


In the test,  page-numbers to be checked are passed to a checker function in which they will be changed to `-1` if they are as expected.
Use of these `-1` values for page-numbers in consequent checks result in overflow in pointer arithmetic of `base + (-1) * page_size` which is certainly less than `base`.

The fix is to skip cases where page-number under checking is `-1`.
Tested under UBSAN build.

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

Commit messages:
 - 8361487: [ubsan] test_committed_virtualmemory.cpp check_covered_pages shows overflow

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

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


More information about the hotspot-runtime-dev mailing list