JDK-8338810 : PPC, s390x: LightweightSynchronizer::exit asserts, missing lock
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc,s390x
  • Submitted: 2024-08-22
  • Updated: 2024-09-02
  • Resolved: 2024-08-23
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 24
24 b13Fixed
Related Reports
Relates :  
Relates :  
Description
JDK-8338638 made me realise that PPC and s390x have the same issue. 

The issue is that the C2 unlock path will check if the monitor is inflated after popping of the last entry on the lock stack. With UseObjectMonitorTable (without the the cache lookup implemented), the slow path is incorrectly taken without resting the popped oop. Currently the runtime expects the the lock stack to be consistent (have an entry) in exit if a the monitor is anonymously inflated.

I'll provide a bandaid fix which pushes back the oop before the calling to the runtime. 

A future enhancement for all platform would be to allow the C2 entry point to redo the push when taking the slow path and it realises that the monitor is anonymously inflated or it is fast locked and the lock stack does not contain the oop. (Removing all the push back logic from the emitted C2 unlock nodes)
Comments
Changeset: e06652ad Branch: master Author: Axel Boldt-Christmas <aboldtch@openjdk.org> Date: 2024-08-23 05:47:29 +0000 URL: https://git.openjdk.org/jdk/commit/e06652ad3c02dfe54104eaa04eaa3d117699b27f
23-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20672 Date: 2024-08-22 06:20:23 +0000
22-08-2024