RFR: 8351334: [ubsan] memoryReserver.cpp:552:60: runtime error: applying non-zero offset 1073741824 to null pointer [v11]
Afshin Zafari
azafari at openjdk.org
Wed Nov 19 13:48:21 UTC 2025
On Mon, 17 Nov 2025 01:18:11 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fix arguments.cpp for HeapMinBaseAddress type.
>
> src/hotspot/share/memory/memoryReserver.cpp line 586:
>
>> 584: lowest_start, highest_start);
>> 585: reserved = try_reserve_range((char*)highest_start, (char*)lowest_start, attach_point_alignment,
>> 586: (char*)aligned_heap_base_min_address, (char*)UnscaledOopHeapMax, size, alignment, page_size);
>
> Not obvious to me this actually improves anything - what is it fixing?
First, the pointer arithmetics are done on `uintptr_t` types to avoid UB.
Second, it is checked that `lowest` and `highest` are still valid after becoming larger or smaller, respectively.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26955#discussion_r2542076686
More information about the hotspot-gc-dev
mailing list