Integrated: 8338810: PPC, s390x: LightweightSynchronizer::exit asserts, missing lock

Axel Boldt-Christmas aboldtch at openjdk.org
Fri Aug 23 05:50:09 UTC 2024


On Thu, 22 Aug 2024 06:20:23 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> [JDK-8338638](https://bugs.openjdk.org/browse/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)
> 
> I am unable to test ppc and s390x, so I have not verified that the issue is reproduced nor that this fixes it. 
> Hopefully @TheRealMDoerr and @offamitkumar can assist me here with running `test/hotspot/jtreg/runtime/Monitor/UseObjectMonitorTableTest.java` with and without the patch on PPC and s390x respectively. 
> Thanks in advance. (And sorry for integrating without better testing of your respective platforms)

This pull request has now been integrated.

Changeset: e06652ad
Author:    Axel Boldt-Christmas <aboldtch at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e06652ad3c02dfe54104eaa04eaa3d117699b27f
Stats:     12 lines in 2 files changed: 10 ins; 0 del; 2 mod

8338810: PPC, s390x: LightweightSynchronizer::exit asserts, missing lock

Reviewed-by: mdoerr, amitkumar

-------------

PR: https://git.openjdk.org/jdk/pull/20672


More information about the hotspot-dev mailing list