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

Afshin Zafari azafari at openjdk.org
Thu Oct 30 11:13:06 UTC 2025


On Wed, 22 Oct 2025 22:14:59 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> You may already noticed that the root of all these UB complains is the option `-XX:SharedBaseAddress` as zero which is a corner case.
>
> Sorry, my suggested fix had a typo:
> 
> 
>   address ArchiveBuilder::offset_to_buffered_address(u4 offset) const {
> -   address requested_addr = _requested_static_archive_bottom + offset;  
> -   address buffered_addr = requested_addr - _buffer_to_requested_delta;
> +   address buffered_addr = _buffer_bottom + offset;
> 
> 
> This way this function will not depend on `-XX:SharedBaseAddress`

Done and fixed the problem here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26983#discussion_r2477592763


More information about the hotspot-runtime-dev mailing list