When run with flag -Xcomp, jstack returns the frame java.lang.Object.wait without the monitor address (- waiting on <no object reference available). Since JDK-8214148 we do check for the address of the monitor so the test fails.
is cloned by
JDK-8215199[TESTBUG] serviceability/tmtools/jstack/WaitNotifyThreadTest.java still fails when run with flag -Xcomp
JDK-8214148[TESTBUG] serviceability/tmtools/jstack/WaitNotifyThreadTest.java is not doing what is expected