[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
Thu Feb 8 09:01:05 UTC 2024


On Fri, 19 Jan 2024 08:11:03 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> 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

Thanks for your reviews!

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

PR Comment: https://git.openjdk.org/valhalla/pull/973#issuecomment-1933621002



More information about the valhalla-dev mailing list