8215050: [TESTBUG] serviceability/tmtools/jstack/WaitNotifyThreadTest.java fails when run with flag -Xcomp
authorpchilanomate
Mon, 10 Dec 2018 13:45:12 -0500
changeset 52933 13173122094f
parent 52932 3add7ef7c40c
child 52934 8deeb7bba516
8215050: [TESTBUG] serviceability/tmtools/jstack/WaitNotifyThreadTest.java fails when run with flag -Xcomp Summary: Identified special case when monitor address is not available in jstack Reviewed-by: dholmes, hseigel, coleenp
test/hotspot/jtreg/serviceability/tmtools/jstack/WaitNotifyThreadTest.java
--- a/test/hotspot/jtreg/serviceability/tmtools/jstack/WaitNotifyThreadTest.java	Mon Dec 10 13:24:17 2018 -0500
+++ b/test/hotspot/jtreg/serviceability/tmtools/jstack/WaitNotifyThreadTest.java	Mon Dec 10 13:45:12 2018 -0500
@@ -152,7 +152,11 @@
                     throw new RuntimeException("Cannot found monitor info associated with " + OBJECT_WAIT + " method");
                 }
                 if (mi.getLocks().size() == 1) {
-                    assertMonitorInfo("locked", mi.getLocks().getLast(), monitorAddress, RUN_METHOD);
+                    MonitorInfo monInfo = mi.getLocks().getLast();
+                    if (monitorAddress.equals("no object reference available")) {
+                        monitorAddress = monInfo.getMonitorAddress();
+                    }
+                    assertMonitorInfo("locked", monInfo, monitorAddress, RUN_METHOD);
                 }
                 else {
                     throw new RuntimeException(RUN_METHOD + " method has to contain one lock record but it contains "