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
--- 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 "