RFR: 8329757: Crash with fatal error: DEBUG MESSAGE: Fast Unlock lock on stack

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Apr 10 12:16:21 UTC 2024


`Deoptimization::relock_objects` may reorder locks within in the `LockStack` which are added inside the same vframe. This can be handled by the interpreter but if OSR has occurred C2 may observe this invalid order in the `LockStack`, which breaks its assumption leading to incorrect behaviour.

This patch functionally makes sure that the LockStack is always consistent by always inflating eliminated locks when `Deoptimization::relock_objects`  is called.

It also adds verification code which checks that the LockStack is consistent with the lock order observed inside the deoptimized vframes. 

Note: for leaf deoptimizations we have enough information to recreate a correct top of the LockStack with minimal inflations, however that should be a separate RFE. This only inflates eliminated locks so the worth of solving that may be minimal or even detrimental. 

Tests still running. Tier 1-3 done, Tier4-5 almost done, Tier 6-7 yet to be run.

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

Commit messages:
 - Remove whitespace
 - 8329757: Crash with fatal error: DEBUG MESSAGE: Fast Unlock lock on stack

Changes: https://git.openjdk.org/jdk/pull/18715/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18715&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8329757
  Stats: 146 lines in 4 files changed: 145 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/18715.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18715/head:pull/18715

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


More information about the hotspot-dev mailing list