JDK-8316659 : assert(LockingMode != LM_LIGHTWEIGHT || flag == CCR0) failed: bad condition register
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21,22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2023-09-21
  • Updated: 2023-11-03
  • Resolved: 2023-09-21
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 21 JDK 22
21.0.2Fixed 22 b17Fixed
Related Reports
Relates :  
Description
We're running into the assertion (macroAssembler_ppc.cpp:2183) since JDK-8315880. The native wrapper doesn't use the correct ConditionRegister for the new locking mode:
V  [libjvm.so+0x14c65bc]  MacroAssembler::compiler_fast_lock_object(ConditionRegister, Register, Register, Register, Register, Register)+0x44c  (macroAssembler_ppc.cpp:2183)
V  [libjvm.so+0x18c4220]  SharedRuntime::generate_native_wrapper(MacroAssembler*, methodHandle const&, int, BasicType*, VMRegPair*, BasicType)+0x29f0  (sharedRuntime_ppc.cpp:2408)
V  [libjvm.so+0x18a1360]  AdapterHandlerLibrary::create_native_wrapper(methodHandle const&)+0x6e0  (sharedRuntime.cpp:3095)

Comments
[jdk21u-fix-request] Approval Request from Martin Bug is present in JDK21 and causes crashes when the new locking mode is used. The fix is small and only changes ConditionRegister usage for native wrappers. C2 uses the same one, so, the code is used this way already. The fix is tested in JDK22 and this PR for an additional week in JDK21. Applies cleanly.
30-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u/pull/287 Date: 2023-10-23 17:49:12 +0000
23-10-2023

I'll test it. Will request backport approval after some time.
23-10-2023

Martin, do you want to backport this to 21u?
02-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15857 Date: 2023-09-21 10:41:56 +0000
21-09-2023

Changeset: 6a4b6655 Author: Martin Doerr <mdoerr@openjdk.org> Date: 2023-09-21 12:06:27 +0000 URL: https://git.openjdk.org/jdk/commit/6a4b6655507582ff685a999c21e7fd3992a39816
21-09-2023

Workaround: Use another LockingMode.
21-09-2023