[lworld] RFR: 8324114: [lworld] GTestWrapper.java fails with "assert(LockingMode == LM_LEGACY) failed: should only be called with legacy stack locking"

Christian Hagedorn chagedorn at openjdk.org
Fri Jan 19 08:17:55 UTC 2024


This patch fixes the gtests which fail with the lightweight locking mode (`-XX:LockingMode=2`) but also with heavy monitors (`-XX:LockingMode=0`). I've only noticed while working on this bug that in the meantime, we temporary enforce legacy stack-locking (`-XX:LockingMode=1`) since merging jdk-22+17:
https://github.com/openjdk/valhalla/blob/16fa7709f15465e736dd3a83707ffe88d7bc61bd/src/hotspot/share/runtime/arguments.cpp#L1922-L1925

Nevertheless, I think it's still worth to propose these test fixes now since we probably want to support lightweight locking at some point.

The gtest used `markWork::has_locker()` which only works with `LM_LEGACY`. For `LM_LIGHTWEIGHT`, we need to call `markWord::is_fast_locked()`. Additionally, when running with `LM_MONITOR`, the test to match some things in the mark word fails because we only use heavy monitors and do not use the mark word bits.

Thanks,
Christian

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

Commit messages:
 - 8324114: [lworld] GTestWrapper.java fails with "assert(LockingMode == LM_LEGACY) failed: should only be called with legacy stack locking"

Changes: https://git.openjdk.org/valhalla/pull/973/files
 Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=973&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8324114
  Stats: 18 lines in 1 file changed: 14 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/valhalla/pull/973.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/973/head:pull/973

PR: https://git.openjdk.org/valhalla/pull/973



More information about the valhalla-dev mailing list