RFR: 8316401: sun/tools/jhsdb/JStackStressTest.java failed with "InternalError: We should have found a thread that owns the anonymous lock"

David Holmes dholmes at openjdk.org
Tue Sep 26 01:19:17 UTC 2023


On Tue, 26 Sep 2023 01:09:47 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Surely jstack thread dump and deadlock check _has_ to run at a safepoint?
>
> Also isn't "anonymous locking" an intermediate step in monitor inflation? The inflated monitor becomes anonymously owned until the real owner sees it has been inflated and updates the ownership accordingly.

To expand if deadlock detection does not run at a safepoint then this logic is non-atomic and completely broken:

 threads = VM.getVM().getThreads();
 heap = VM.getVM().getObjectHeap();
 createThreadTable();  // calls getThreads() again

Without a stable VM you could have three almost completely different set of threads when each of these statements run!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15907#discussion_r1336523076


More information about the serviceability-dev mailing list