RFR: 8351334: [ubsan] memoryReserver.cpp:552:60: runtime error: applying non-zero offset 1073741824 to null pointer [v8]
Afshin Zafari
azafari at openjdk.org
Tue Oct 28 09:35:20 UTC 2025
On Tue, 28 Oct 2025 03:24:50 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> subtraction for checking overflow
>
> src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp line 288:
>
>> 286: // If an overflow happened in Arguments::set_heap_size(), MaxHeapSize will have too large a value.
>> 287: // Check for this by ensuring that MaxHeapSize plus the requested min base address still fit within max_uintx.
>> 288: if (std::numeric_limits<size_t>::max() - value < MaxHeapSize) { // overflow
>
> Sorry but I still don't see how this new check is in practice any different to the existing (albeit conditional) `(value > (max_uintx - MaxHeapSize))`?
No difference other than not depends on the other conditions. The existing condition needs two more conjunctions to be true.
Without this change here, when we run jvm with the options as shown in this [comment](https://github.com/openjdk/jdk/pull/26955#issuecomment-3241790796
) (to make the HeapMinBaseAddress overflow) it crashes with an assertion.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26955#discussion_r2468720165
More information about the hotspot-gc-dev
mailing list