RFR: 8346866: [ASAN] memoryReserver.cpp reported applying non-zero offset to non-null pointer produced null pointer [v10]

SendaoYan syan at openjdk.org
Wed Jan 8 04:42:14 UTC 2025


On Wed, 8 Jan 2025 03:41:26 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use size_t insread of uint64_t, use pointer_delta instead of pointer subtraction
>
> src/hotspot/share/memory/memoryReserver.cpp line 432:
> 
>> 430:   assert(is_aligned(lowest_start, attach_point_alignment), "precondition");
>> 431: 
>> 432:   const size_t attach_range = pointer_delta(highest_start, lowest_start, sizeof(char*));
> 
> I think use of `sizeof(char*)` is incorrect, and it should be 1 (or `sizeof(char)`, but that's 1 by definition).
> Sorry I didn't notice this earlier.

Oops, sorry for the mistake. `sizeof(char*)` has been replaced as `sizeof(char)`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22897#discussion_r1906459232


More information about the hotspot-runtime-dev mailing list