On Tue, 26 Sep 2023 03:07:14 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> And I shouldn't have said "cache". I was confusing this PR with another >> dealing with the Monitor Cache. > > ...although that is a pretty small window and we are seeing this bug quite a > lot. Seems if the code in question was the issue, it would take 1000s of > iterations to reproduce. Ok, so we are not (usually) at a safepoint, but no threads are moving. But the snapshot can not be taken atomically. Which means that the anonymous-state in the ObjectMonitor and the state of the lock-stack are not necessarily consistent, not even if we swap the popping and owner-update, right? This is what you mean by inconsistent state, right? Or is there a way to get an atomic snapshot of threads *and* monitors? So yeah, we could print a warning when that happens. However, even that problem would be pre-existing (monitors not agreeing with each other or with threads), and do we currently print a warning about it? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15907#discussion_r1336609109