8308978: regression with a deadlock involving FollowReferences

Reviewed-by: sspitsyn, lmesnik
This commit is contained in:
Alex Menkov 2023-06-02 22:02:04 +00:00
parent aff9cea054
commit 62c935d4fa
2 changed files with 6 additions and 16 deletions

View File

@ -2968,14 +2968,15 @@ void JvmtiTagMap::iterate_over_reachable_objects(jvmtiHeapRootCallback heap_root
jvmtiStackReferenceCallback stack_ref_callback,
jvmtiObjectReferenceCallback object_ref_callback,
const void* user_data) {
// VTMS transitions must be disabled before the EscapeBarrier.
JvmtiVTMSTransitionDisabler disabler;
JavaThread* jt = JavaThread::current();
EscapeBarrier eb(true, jt);
eb.deoptimize_objects_all_threads();
Arena dead_object_arena(mtServiceability);
GrowableArray<jlong> dead_objects(&dead_object_arena, 10, 0, 0);
JvmtiVTMSTransitionDisabler disabler;
{
MutexLocker ml(Heap_lock);
BasicHeapWalkContext context(heap_root_callback, stack_ref_callback, object_ref_callback);
@ -3015,6 +3016,9 @@ void JvmtiTagMap::follow_references(jint heap_filter,
const jvmtiHeapCallbacks* callbacks,
const void* user_data)
{
// VTMS transitions must be disabled before the EscapeBarrier.
JvmtiVTMSTransitionDisabler disabler;
oop obj = JNIHandles::resolve(object);
JavaThread* jt = JavaThread::current();
Handle initial_object(jt, obj);
@ -3027,8 +3031,6 @@ void JvmtiTagMap::follow_references(jint heap_filter,
Arena dead_object_arena(mtServiceability);
GrowableArray<jlong> dead_objects(&dead_object_arena, 10, 0, 0);
JvmtiVTMSTransitionDisabler disabler;
{
MutexLocker ml(Heap_lock);
AdvancedHeapWalkContext context(heap_filter, klass, callbacks);

View File

@ -31,18 +31,6 @@ serviceability/dcmd/thread/PrintConcurrentLocksTest.java 8308033 generic-all
serviceability/dcmd/thread/PrintTest.java 8308033 generic-all
serviceability/dcmd/thread/ThreadDumpToFileTest.java 8308033 generic-all
serviceability/tmtools/jstack/DaemonThreadTest.java 8308033 generic-all
vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java 8308978 generic-all
vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java 8308978 generic-all
vmTestbase/nsk/jdi/ReferenceType/instances/instances003/instances003.java 8308978 generic-all
vmTestbase/nsk/jdi/ReferenceType/instances/instances004/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jdi/MonitorWaitedRequest/addThreadFilter/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts002/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jdi/stress/serial/monitorEvents002/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jdi/stress/serial/heapwalking002/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jdi/stress/serial/mixed001/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jvmti/scenarios/allocation/AP04/ap04t001/TestDescription.java 8308978 generic-all
vmTestbase/nsk/jvmti/scenarios/allocation/AP04/ap04t002/TestDescription.java 8308978 generic-all
####
## Classes not unloaded as expected (TODO, need to check if FJ keeps a reference)