RFR: 8366062: [ubsan] add non-zero offset to nullptr in cds/archiveBuilder.cpp [v6]
Afshin Zafari
azafari at openjdk.org
Mon Oct 20 07:10:07 UTC 2025
On Wed, 17 Sep 2025 09:53:28 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
>> 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 incrementally with one additional commit since the last revision:
>
> fix after wrong merge.
Dear @iklam , in https://github.com/openjdk/jdk/pull/26955, it is suggested to use `uintptr_t` for addresses in pointer arithmetics and cast them to `address` when we pass them into functions. There are some of this conversions in related code here, do you want me to do this or as a separate RFE?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26983#issuecomment-3420850537
More information about the hotspot-runtime-dev
mailing list