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

David Holmes dholmes at openjdk.org
Thu Oct 9 02:03:16 UTC 2025


On Thu, 18 Sep 2025 15:37:38 GMT, Afshin Zafari <azafari at openjdk.org> wrote:

>> The minimum acceptable value was 0 where using it as address was problematic according to UBSAN.
>> The acceptable value is changed to 64K.
>> 
>> Tests:
>> linux-x64 tier1
>
> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fixed MAX2 template parameter

Sorry @afshin-zafari but this PR has me quite confused. The code changes do not reflect the PR description. The PR description does not obviously connect to the JBS problem statement. And the code changes in the PR seem unrelated to the value of aligned_heap_base_min_address as referenced in JBS.

And the cast changes in memoryReserver.cpp seem completely unrelated.

That said, I do not know how all of these heap variables interact and relate, so you really need the GC folk to understand and approve this.

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.

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

PR Review: https://git.openjdk.org/jdk/pull/26955#pullrequestreview-3316975754
PR Review Comment: https://git.openjdk.org/jdk/pull/26955#discussion_r2415374984


More information about the hotspot-dev mailing list