RFR: 8360941: [ubsan] MemRegion::end() shows runtime error: applying non-zero offset 8388608 to null pointer [v4]

Matthias Baesken mbaesken at openjdk.org
Fri Jul 18 14:45:49 UTC 2025


On Fri, 18 Jul 2025 00:52:19 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Avoid assertions, align address in test
>
> test/hotspot/gtest/gc/g1/test_freeRegionList.cpp line 48:
> 
>> 46:   // does not access it.
>> 47:   int val = 1;
>> 48:   HeapWord* ptr = reinterpret_cast<HeapWord*>(&val);
> 
> The initial value for `val` doesn't matter, since we're using its address rather than value.
> And the cast could be removed by changing the type of `val`, leading to something like this:
> 
> HeapWord val{};
> HeapWord* ptr = align_up(&val, os::vm_page_size());

I adjusted the coding .

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26216#discussion_r2216231456


More information about the hotspot-runtime-dev mailing list