RFR: 8345569: [ubsan] filemap.cpp:2215:47: runtime error: applying non-zero offset 34358689792 to null pointer [v2]
Matthias Baesken
mbaesken at openjdk.org
Thu Dec 12 15:22:12 UTC 2024
On Tue, 10 Dec 2024 05:10:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>>
>> address addition in FileMapInfo::heap_region_dumptime_address
>
> src/hotspot/share/memory/virtualspace.cpp line 439:
>
>> 437: }
>> 438:
>> 439: ATTRIBUTE_NO_UBSAN
>
> So it complains about line 462:
>
> (_base < aligned_heap_base_min_address || _base + size > upper_bound))) {
>
> and I presume the issue is `_base + size` could theoretically wrap to zero, which seems fixable via `size > upper_bound - _base` (though this pointer arithmetic should probably be converted to unsigned integer arithmetic to avoid UB).
Thanks for the hint, I adjusted the coding the removed the ubsan-disable attribute/macro .
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22603#discussion_r1882351183
More information about the hotspot-runtime-dev
mailing list