RFR: 8351334: [ubsan] memoryReserver.cpp:552:60: runtime error: applying non-zero offset 1073741824 to null pointer
Axel Boldt-Christmas
aboldtch at openjdk.org
Mon Sep 1 10:22:44 UTC 2025
On Fri, 29 Aug 2025 10:14:22 GMT, Afshin Zafari <azafari at openjdk.org> wrote:
> To answer 'when/how does this happen?', this issue can be reproduced by running `runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java`, in which invalid values of options will be tested, particularly here `0` for `HeapBaseMinAddress`.
Yeah I as I mentioned I figured that part out, it occurs when `MaxHeapSize` is not default set.
I am not sure that `0` is an invalid value for `HeapBaseMinAddress` nor that it is what the test is testing. It tests both valid and invalid values.
As mentioned when manually checking extreme values in `HeapBaseMinAddress` I could provoke an arithmetic overflow cause crash. `TestOptionsWithRanges.java` fails to capture this because of limitations in our `PrintFlagsRanges` option, which does not capture constraints. It prints:
size_t HeapBaseMinAddress [ 0 ... 18446744073709551615 ]
But on my machine (running with G1) the actual upper limit is `18446744072635809792`
And running `./images/jdk/bin/java -XX:HeapBaseMinAddress=18446744072635809792 -Xmx1g --version` results in:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (src/hotspot/share/utilities/globalDefinitions.hpp:440), pid=1726885, tid=1726886
# assert(left >= right) failed: avoid underflow - left: 0x00000000c0000000 right: 0xffffffffc0000000
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26955#issuecomment-3241790796
More information about the hotspot-dev
mailing list