RFR: 8346866: [ASAN] memoryReserver.cpp reported applying non-zero offset to non-null pointer produced null pointer [v6]

SendaoYan syan at openjdk.org
Tue Jan 7 10:59:02 UTC 2025


> Hi all,
> This PR add an extra loop condition check `p2u(attach_point) > stepsize` in function `HeapReserver::Instance::try_reserve_range` to make sure the loop will not wrap around, and make UndefinedBehaviorSanitizer silent. The change do not change the original logic, risk is low.
> 
> Additional testing:
> 
> - [x]  jtreg tests(include tier1/2/3 etc., which include tests added by [PR22712](https://github.com/openjdk/jdk/pull/22712)) on linux-x64 with release build
> - [x]  jtreg tests(include tier1/2/3 etc., which include tests added by [PR22712](https://github.com/openjdk/jdk/pull/22712)) on linux-x64 with fastdebug build
> - [x]  jtreg tests(include tier1/2/3 etc., which include tests added by [PR22712](https://github.com/openjdk/jdk/pull/22712)) on linux-aarch64 with release build
> - [x]  jtreg tests(include tier1/2/3 etc., which include tests added by [PR22712](https://github.com/openjdk/jdk/pull/22712)) on linux-aarch64 with fastdebug build

SendaoYan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:

 - Merge branch 'openjdk:master' into jbs8346866
 - Replace "(size_t) highest_start" instead as 1
 - remove ultra empty line
 - Use offsets in the loop logic instead
 - Use offsets in the loop logic instead
 - Update the comments
 - Add "attach_point <= stepsize" check at the end of for loop, to make sanitizer silent and avoid warp around.
 - 8346866: [ASAN] memoryReserver.cpp reported applying non-zero offset to non-null pointer produced null pointer

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/22897/files
  - new: https://git.openjdk.org/jdk/pull/22897/files/d5a205c4..e986d416

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22897&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22897&range=04-05

  Stats: 1998 lines in 89 files changed: 586 ins; 1198 del; 214 mod
  Patch: https://git.openjdk.org/jdk/pull/22897.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22897/head:pull/22897

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


More information about the hotspot-runtime-dev mailing list