RFR: 8349554: [UBSAN] os::attempt_reserve_memory_between reported applying non-zero offset to non-null pointer produced null pointer
Stefan Karlsson
stefank at openjdk.org
Fri Feb 7 12:54:09 UTC 2025
On Fri, 7 Feb 2025 11:01:29 GMT, SendaoYan <syan at openjdk.org> wrote:
> `hi_end` less than `lo_att` in some cases
Do you know if that only happens in our tests and not in normal JVM runs? If it is only in testing then it would be preferable to add preconditions to the function and then fix the testing to adhere to the preconditions.
With that said, an easy fix would be to just continue the tradition of the function and have early returns when this happens:
if (hi_end < lo_att) {
return nullptr; // no need to go on
}
uintptr_t max_range = hi_end - lo_att;
if (max_range < bytes) {
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23508#issuecomment-2642831766
More information about the hotspot-runtime-dev
mailing list