RFR: 8346157: [Ubsan]: runtime error: pointer index expression with base 0x000000001000 overflowed to 0xfffffffffffffff0

Amit Kumar amitkumar at openjdk.org
Fri Jan 3 06:34:34 UTC 2025


On Thu, 2 Jan 2025 16:19:39 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

>> Fixes ubsan warning in mallocTracker.cpp
>
> src/hotspot/share/nmt/mallocTracker.cpp line 243:
> 
>> 241:     const size_t smallest_possible_alignment = sizeof(void*);
>> 242:     uintptr_t here = (uintptr_t)align_down(addr, smallest_possible_alignment);
>> 243:     if (here == 0) {
> 
> We should use `nullptr` here not `0`:
> 
> if (here == nullptr) {

but `here` is of `uintptr_t` datatype.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22885#discussion_r1901502785


More information about the hotspot-runtime-dev mailing list