JDK-8253901 : ARM32: SIGSEGV during monitorexit due to incorrect register use (after JDK-8253540)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: arm
  • Submitted: 2020-10-01
  • Updated: 2024-12-06
  • Resolved: 2020-10-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b20Fixed
Related Reports
Relates :  
Relates :  
Description
JDK-8253540 changed InterpreterRuntime::monitorexit to be be a JRT_LEAF function.
For ARM32 the change crashes immediatelly on startup:

$ jdk-16/bin/java -version

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000000, pid=21691, tid=21692
#
# JRE version:  (16.0) (build )
# Java VM: OpenJDK Server VM (16-BellSoft+0-adhoc.boris.jdk, mixed mode, g1 gc, linux-arm)
# Problematic frame:
# C  0x00000000

hs_err log attached.

Comments
Changeset: fd0cb98e Author: Boris Ulasevich <bulasevich@openjdk.org> Date: 2020-10-08 06:52:27 +0000 URL: https://git.openjdk.java.net/jdk/commit/fd0cb98e
08-10-2020

Author: Boris Ulasevich <boris.ulasevich@bell-sw.com> Date: Thu Oct 1 12:01:42 2020 -0400 8253901: ARM32 build crashes after JDK-8253540 Move the parameter to R0 as ARM32 call_VM_leaf expects to find arg_1 in R0 diff --git a/src/hotspot/cpu/arm/interp_masm_arm.cpp b/src/hotspot/cpu/arm/interp_masm_arm.cpp index 78f7a7fb77c..601e207ff80 100644 --- a/src/hotspot/cpu/arm/interp_masm_arm.cpp +++ b/src/hotspot/cpu/arm/interp_masm_arm.cpp @@ -990,7 +990,8 @@ void InterpreterMacroAssembler::unlock_object(Register Rlock) { assert(Rlock == R1, "the second argument"); if (UseHeavyMonitors) { - call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), Rlock); + mov(R0, Rlock); + call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), R0); } else { Label done, slow_case; @@ -1031,7 +1032,8 @@ void InterpreterMacroAssembler::unlock_object(Register Rlock) { // Call the runtime routine for slow case. str(Robj, Address(Rlock, obj_offset)); // restore obj - call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), Rlock); + mov(R0, Rlock); + call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), R0); bind(done); }
01-10-2020