From 285c833ffacdaabe7c4955cbbafb3bc459d26784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20=C3=96sterlund?= Date: Wed, 17 May 2023 11:47:30 +0000 Subject: [PATCH] 8308043: Deadlock in TestCSLocker.java due to blocking GC while allocating Reviewed-by: stefank, ayang, tschatzl --- test/hotspot/jtreg/ProblemList-Xcomp.txt | 2 -- test/hotspot/jtreg/gc/cslocker/TestCSLocker.java | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-Xcomp.txt b/test/hotspot/jtreg/ProblemList-Xcomp.txt index bfb74023f00..15f162017ef 100644 --- a/test/hotspot/jtreg/ProblemList-Xcomp.txt +++ b/test/hotspot/jtreg/ProblemList-Xcomp.txt @@ -40,6 +40,4 @@ serviceability/sa/TestJhsdbJstackMixed.java 8248675 linux-aarch64 serviceability/jvmti/VMObjectAlloc/VMObjectAllocTest.java 8307462 generic-all -gc/cslocker/TestCSLocker.java 8293289 generic-x64 - serviceability/sa/ClhsdbInspect.java 8283578 windows-x64 diff --git a/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java b/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java index 43cfea8e201..1627ae89e26 100644 --- a/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java +++ b/test/hotspot/jtreg/gc/cslocker/TestCSLocker.java @@ -48,10 +48,13 @@ public class TestCSLocker extends Thread // start CS locker thread CSLocker csLocker = new CSLocker(); csLocker.start(); + // After the CSLocker thread has started, any operation such as an allocation, + // which could rely on the GC to make progress, will cause a deadlock that will + // make the test time out. That includes printing. Please don't use any such + // code until unlock() is called below. // check timeout to success deadlocking - while(System.currentTimeMillis() < startTime + timeout) { - System.out.println("sleeping..."); + while (System.currentTimeMillis() < startTime + timeout) { sleep(1000); }