On Sat, 26 Jun 2021 17:48:15 GMT, Leonid Mesnik <[email protected]> wrote:
> The crash happens because nmethod might become a zombie before it is enqueued
> in JvmtiDeferredEventQueue or after it is dequeued from it. The crash is
> reproduced by serviceability/jvmti/CompiledMethodLoad/Zombie.java. However,
> it takes ~3K runs to hit it. I verified the fix by running this test >100K
> on each platform. Also, I verified that protecting in 'void
> JvmtiDeferredEventQueue::post(JvmtiEnv* env)' is not enough.
Hi Leonid,
I'm not clear on the details here - please see comments below.
Thanks,
David
src/hotspot/share/code/nmethod.cpp line 1611:
> 1609: return;
> 1610: }
> 1611: mark_as_seen_on_stack();
Not obvious what this actually does in relation to the dequeuing problem.
src/hotspot/share/prims/jvmtiImpl.cpp line 968:
> 966: for (QueueNode* node = _queue_head; node != NULL; node = node->next())
> {
> 967: node->event().post_compiled_method_load_event(env);
> 968: }
Can't you dequeue() immediately after calling post_compiled_method_load_event()?
-------------
PR: https://git.openjdk.java.net/jdk/pull/4602