RFR: 8345225: AARCH64: VM crashes with -NearCpool +UseShenandoahGC options
Boris Ulasevich
bulasevich at openjdk.org
Tue Apr 29 01:52:49 UTC 2025
On Fri, 25 Apr 2025 18:07:22 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:
> 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
Good, thanks for the review!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24883#issuecomment-2837213711
More information about the hotspot-dev
mailing list