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:56:04 UTC 2025


On Mon, 17 Nov 2025 01:21:52 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 590:
> 
>> 588: 
>> 589:     // zerobased: Attempt to allocate in the lower 32G.
>> 590:     size_t zerobased_max = OopEncodingHeapMax;
> 
> Again not obvious what this improves. We obviously have very inconsistent use of types here in that we loosely use `char*`, `uint64_t` and `size_t` to all mean a 64-bit unsigned value, ansd no matter what types we use in the declarations we have to cast something somewhere.

According to reviewers' suggestions, the pointers used in arithmeitc are typed as numeric like `size_t` or `uintptr_t`. And only when they are going to be passed as pointers to other functions, they will be cast to the desired pointers.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26955#discussion_r2542089700


More information about the hotspot-gc-dev mailing list