RFR: 8345225: AARCH64: VM crashes with -NearCpool +UseShenandoahGC options
Boris Ulasevich
bulasevich at openjdk.org
Fri Apr 25 23:18:58 UTC 2025
The -XX:-NearCpool option enables the use of an adrp + ldr sequence in the ldr_constant function. This legacy code assumed that constants could be outside the nmethod (though it is important that they remain inside the CodeHeap; otherwise, adrp offset limits could be violated). The description of NearCpool says: "constant pool is close to instructions". By "constant pool" it probably means the nmethod's consts section or possibly it's oops/metadata, not the constant pool of the class.
In any case, the NearCpool option value is used in the MacroAssembler::ldr_constant function to load oops. This creates a problem: the relocation patcher is not designed to handle an adrp + ldr sequence for relocInfo::oop_type entries. It causes the JVM to crash. The relocation patcher can be fixed, but the case with distant (but not too distant) oops does not correspond to any real VM configuration, so I prefer to eliminate the code path.
I suggest the following:
- Use a direct load in MacroAssembler::movoop
- Remove the ldr_constant function, as it is no longer needed
- Follow up: deprecate NearCpool option, as it is no longer used
- Follow up: update RISC-V accordingly
-------------
Commit messages:
- 8345225: AARCH64: VM crashes with -NearCpool +UseShenandoahGC options
Changes: https://git.openjdk.org/jdk/pull/24883/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24883&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8345225
Stats: 15 lines in 2 files changed: 0 ins; 14 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24883.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24883/head:pull/24883
PR: https://git.openjdk.org/jdk/pull/24883
More information about the hotspot-dev
mailing list