RFR: 8290908: misc tests fail: assert(!thread->owns_locks()) failed: must release all locks when leaving VM

Alex Menkov amenkov at openjdk.org
Tue Aug 2 22:03:06 UTC 2022


On Mon, 1 Aug 2022 07:41:50 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

> This is a regression that has been introduced by the fix of:
> [8256811](https://bugs.openjdk.org/browse/JDK-8256811): Delayed/missed jdwp class unloading events
> 
> This is the relevant comment from Zhengyu:
> 
> It is caused by https://bugs.openjdk.org/browse/JDK-8256811 as JvmtiExport::post_object_free() call does not expect under any lock.
> 
> I think we can move following code outside of lock, as flush_obect_free_events() races ServiceThread's JvmtiTagMap::flush_all_object_free_events() call anyway.
> 
>   if (event_type == JVMTI_EVENT_OBJECT_FREE) {
>     flush_object_free_events(env);
>   }
> 
> The fix is as was suggested by Zhengyu above.
> I was not able to reproduce JCK and nsk.jvmti test failures mentioned in the bug report.
> However, this fix should address the problem as it moves the call to `flush_object_free_events(env)` out of a critical section with a lock.

Marked as reviewed by amenkov (Reviewer).

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

PR: https://git.openjdk.org/jdk/pull/9699


More information about the serviceability-dev mailing list