On Mon, 1 Aug 2022 07:41:50 GMT, Serguei Spitsyn <sspit...@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. This pull request has now been integrated. Changeset: 0ae83410 Author: Serguei Spitsyn <sspit...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/0ae834105740f7cf73fe96be22e0f564ad29b18d Stats: 8 lines in 1 file changed: 4 ins; 4 del; 0 mod 8290908: misc tests fail: assert(!thread->owns_locks()) failed: must release all locks when leaving VM Reviewed-by: cjplummer, amenkov ------------- PR: https://git.openjdk.org/jdk/pull/9699