RFR: 8366062: [ubsan] add non-zero offset to nullptr in cds/archiveBuilder.cpp [v7]

Afshin Zafari azafari at openjdk.org
Tue Oct 21 12:23:13 UTC 2025


> It is acceptable that the `SharedBaseAddress` option gets `0` at command line. The corresponding pointer arithmetic with `0` (`nullptr`) in archiveBuilder is UB.
> Specific casts are used to avoid UBSAN error.
> 
> Tests:
> linux-x64-debug: tier1 passed

Afshin Zafari has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:

 - Merge remote-tracking branch 'origin/master' into _8366062_ubsan_nullptr_plus_nz_offset
 - fix after wrong merge.
 - Merge remote-tracking branch 'origin/master' into _8366062_ubsan_nullptr_plus_nz_offset
 - comment fixed
 - Merge remote-tracking branch 'origin/master' into _8366062_ubsan_nullptr_plus_nz_offset
 - comments improved
 - 8366062: [ubsan] add non-zero offset to nullptr in cds/archiveBuilder.cpp

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

Changes: https://git.openjdk.org/jdk/pull/26983/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26983&range=06
  Stats: 12 lines in 1 file changed: 6 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/26983.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26983/head:pull/26983

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


More information about the hotspot-runtime-dev mailing list