RFR: 8351334: [ubsan] memoryReserver.cpp:552:60: runtime error: applying non-zero offset 1073741824 to null pointer [v7]

Afshin Zafari azafari at openjdk.org
Mon Oct 20 07:37:10 UTC 2025


On Thu, 9 Oct 2025 01:55:12 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixed MAX2 template parameter
>
> 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 (value + MaxHeapSize < MaxHeapSize) { // overflow
> 
> Sorry I am struggling to see how this check differs in practice to the existing check:
> 
> (value > (max_uintx - MaxHeapSize))
> 
> Further, the comment before the new check seems to relate to the existing check.

Sorry it's my mistake in reading `max - a < b` as `a - b < b` .

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

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


More information about the hotspot-gc-dev mailing list