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

SendaoYan syan at openjdk.org
Tue Dec 31 08:12:35 UTC 2024


On Tue, 31 Dec 2024 05:44:07 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/memory/memoryReserver.cpp line 440:
>> 
>>> 438:   // Try attach points from top to bottom.
>>> 439:   for (char* attach_point = highest_start;
>>> 440:        attach_point >= lowest_start && attach_point <= highest_start && p2u(attach_point) > stepsize;  // Avoid wrap around.
>> 
>> The `attach_point <= highest_start` part of the test should be removed.
>> That's the old and incorrect attempt to avoid wrap around.
>
> The proposed change is not correct.  Consider if attach_point, lowest_start,
> and stepsize are all equal.  In such a case this would stop without trying
> that case, even though it should try it.  Changing the comparison with
> stepsize to >= would fix that.  But it still wouldn't be correct.  Consider if
> attach_point == lowest_start and stepsize > lowest_start.  That should also be
> tried.

Sorry, I need more investigate.

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

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


More information about the hotspot-runtime-dev mailing list