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

SendaoYan syan at openjdk.org
Tue Jan 7 12:29:00 UTC 2025


On Tue, 7 Jan 2025 08:09:36 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replace "(size_t) highest_start" instead as 1
>
> src/hotspot/share/memory/memoryReserver.cpp line 442:
> 
>> 440:        offset <= attach_range; // Avoid wrap around.
>> 441:        offset -= stepsize) {
>> 442:     ReservedSpace reserved = try_reserve_memory(size, alignment, page_size, lowest_start + offset);
> 
> I think I preferred the earlier version over this.  But I don't dislike this version enough to want to block it.
> I liked the explicitness of the pointer-based iteration path, and am unbothered by the 2nd loop exit.

I have update the code for use the explicitness of the pointer-based iteration path, and convert `attach_point` to size_t and then convert to `char*` again, to avoid ubsan report "produced null pointer" fail.

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

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


More information about the hotspot-runtime-dev mailing list