RFR: 8328866: Add raw monitor rank support to the debug agent. [v8]

Chris Plummer cjplummer at openjdk.org
Mon May 20 03:26:07 UTC 2024


On Mon, 20 May 2024 01:47:31 GMT, David Holmes <dholmes at openjdk.org> wrote:

> That smells fishy to me. A thread can always safely check if it owns something because it can't race with itself and get a wrong answer.

Unfortunately checking ownership means comparing jobjects, which you can't safely do if you are comparing to a jobject that could be freed at any moment (I'm referring the JNI ref being freed, not the object being GC'd). I ran into asserts in JNI IsSameObject() due to this happening. Basically the local ref became invalid between the time it was fetched from the DebugRawMonitor and when is was used by IsSameObject().

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

PR Comment: https://git.openjdk.org/jdk/pull/19044#issuecomment-2119592870


More information about the serviceability-dev mailing list